Initial EPL Contribution default tip
authorJohnson Ma <johnson.ma@nokia.com>
Mon, 08 Mar 2010 15:04:18 +0800
changeset 0 3da2a79470a7
Initial EPL Contribution
testexecmgmt/ucc/BinInternal/readme.txt
testexecmgmt/ucc/BinInternal/rpcgen.exe
testexecmgmt/ucc/BinInternal/rpcgen/Makefile
testexecmgmt/ucc/BinInternal/rpcgen/ae_component_rpc.c
testexecmgmt/ucc/BinInternal/rpcgen/ae_component_rpc.h
testexecmgmt/ucc/BinInternal/rpcgen/rpc_clnt.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_cout.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_hout.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_main.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_pars.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_pars.h
testexecmgmt/ucc/BinInternal/rpcgen/rpc_scan.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_scan.h
testexecmgmt/ucc/BinInternal/rpcgen/rpc_svco.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_util.c
testexecmgmt/ucc/BinInternal/rpcgen/rpc_util.h
testexecmgmt/ucc/BinInternal/rpcgen/rpcgen.dsp
testexecmgmt/ucc/BinInternal/rpcgen/rpcgen.dsw
testexecmgmt/ucc/BuildScripts/BWINS/NETWORKEMULATORCONTROL.DEF
testexecmgmt/ucc/BuildScripts/BWINS/UCCCONTROLTEU.DEF
testexecmgmt/ucc/BuildScripts/EABI/NetworkEmulatorControl.def
testexecmgmt/ucc/BuildScripts/group/NetworkEmulatorControl.mmp
testexecmgmt/ucc/BuildScripts/group/UCCControlTE.mmp
testexecmgmt/ucc/BuildScripts/group/bld.exports.inf
testexecmgmt/ucc/BuildScripts/group/bld.inf
testexecmgmt/ucc/BuildScripts/group/release.txt
testexecmgmt/ucc/BuildScripts/group/ucc.configure.nsh
testexecmgmt/ucc/BuildScripts/group/ucc.iby
testexecmgmt/ucc/BuildScripts/group/ucc.mrp
testexecmgmt/ucc/BuildScripts/group/ucc.tdf
testexecmgmt/ucc/BuildTools/Makefile
testexecmgmt/ucc/BuildTools/cleantree.exe
testexecmgmt/ucc/BuildTools/cleantree/cleantree.cpp
testexecmgmt/ucc/BuildTools/cleantree/cleantree.dsp
testexecmgmt/ucc/BuildTools/cleantree/cleantree.dsw
testexecmgmt/ucc/BuildTools/cleantree/cleantree.h
testexecmgmt/ucc/BuildTools/readme.txt
testexecmgmt/ucc/GenericService/Common/inc/CUCCIniFile.h
testexecmgmt/ucc/GenericService/Common/src/CUCCIniFile.cpp
testexecmgmt/ucc/GenericService/GenericService.dsp
testexecmgmt/ucc/GenericService/GenericService.dsw
testexecmgmt/ucc/GenericService/SyncService/Configuration/SyncService.ini
testexecmgmt/ucc/GenericService/SyncService/Interface/Device/SyncService.ini
testexecmgmt/ucc/GenericService/SyncService/Interface/Host/SyncServiceInterface.ini
testexecmgmt/ucc/GenericService/SyncService/Interface/distribution.policy
testexecmgmt/ucc/GenericService/SyncService/SyncService.dsp
testexecmgmt/ucc/GenericService/SyncService/bin/Debug/SyncService.exe
testexecmgmt/ucc/GenericService/SyncService/bin/Release/SyncService.exe
testexecmgmt/ucc/GenericService/SyncService/inc/CSyncService.h
testexecmgmt/ucc/GenericService/SyncService/src/CSyncService.cpp
testexecmgmt/ucc/GenericService/SyncService/src/SyncService.c
testexecmgmt/ucc/GenericService/TestDriverService/Configuration/TestDriverService.ini
testexecmgmt/ucc/GenericService/TestDriverService/Interface/Device/TestDriverService.ini
testexecmgmt/ucc/GenericService/TestDriverService/Interface/Host/TestDriverServiceInterface.ini
testexecmgmt/ucc/GenericService/TestDriverService/TestDriverService.dsp
testexecmgmt/ucc/GenericService/TestDriverService/bin/Debug/TestDriverService.exe
testexecmgmt/ucc/GenericService/TestDriverService/bin/Release/TestDriverService.exe
testexecmgmt/ucc/GenericService/TestDriverService/inc/CAThread.h
testexecmgmt/ucc/GenericService/TestDriverService/inc/CListeningServer.h
testexecmgmt/ucc/GenericService/TestDriverService/inc/CTestDriverService.h
testexecmgmt/ucc/GenericService/TestDriverService/src/CAThread.cpp
testexecmgmt/ucc/GenericService/TestDriverService/src/CListeningServer.cpp
testexecmgmt/ucc/GenericService/TestDriverService/src/CTestDriverService.cpp
testexecmgmt/ucc/GenericService/TestDriverService/src/TestDriverService.c
testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Master/SyncService.ini
testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Master/master.script
testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Slave/sampletest.ini
testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Slave/slave.script
testexecmgmt/ucc/GenericService/TestService/Interface/TestService.ini
testexecmgmt/ucc/GenericService/TestService/TestService.dsp
testexecmgmt/ucc/GenericService/TestService/bin/Debug/TestService.exe
testexecmgmt/ucc/GenericService/TestService/bin/Release/TestService.exe
testexecmgmt/ucc/GenericService/TestService/inc/CTestService.h
testexecmgmt/ucc/GenericService/TestService/src/CTestService.cpp
testexecmgmt/ucc/GenericService/TestService/src/TestService.c
testexecmgmt/ucc/GenericService/bin/Debug/GenericService.lib
testexecmgmt/ucc/GenericService/bin/Release/GenericService.lib
testexecmgmt/ucc/GenericService/inc/CCall.h
testexecmgmt/ucc/GenericService/inc/CComponentManager.h
testexecmgmt/ucc/GenericService/inc/CSGenericstub.h
testexecmgmt/ucc/GenericService/inc/CService.h
testexecmgmt/ucc/GenericService/inc/CSvcGenericstub.h
testexecmgmt/ucc/GenericService/inc/CTestService.h
testexecmgmt/ucc/GenericService/inc/GenericStub.h
testexecmgmt/ucc/GenericService/src/CCall.cpp
testexecmgmt/ucc/GenericService/src/CSGenericstub.cpp
testexecmgmt/ucc/GenericService/src/CSvcGenericstub.cpp
testexecmgmt/ucc/GenericService/src/CTestService.cpp
testexecmgmt/ucc/GenericService/src/GenericStub_svc.c
testexecmgmt/ucc/GenericService/src/GenericStub_svc_stub_impl.cpp
testexecmgmt/ucc/GenericService/src/GenericStub_xdr.c
testexecmgmt/ucc/GenericService/src/TestService.c
testexecmgmt/ucc/RemoteInterface/RemoteInterface.dsp
testexecmgmt/ucc/RemoteInterface/RemoteInterface.dsw
testexecmgmt/ucc/RemoteInterface/Test/Test.dsp
testexecmgmt/ucc/RemoteInterface/Test/src/test.cpp
testexecmgmt/ucc/RemoteInterface/bin/Debug/RemoteInterface.lib
testexecmgmt/ucc/RemoteInterface/bin/Release/RemoteInterface.lib
testexecmgmt/ucc/RemoteInterface/inc/CRemoteInterface.h
testexecmgmt/ucc/RemoteInterface/inc/CTCPTransport.h
testexecmgmt/ucc/RemoteInterface/inc/MUCCTransport.h
testexecmgmt/ucc/RemoteInterface/src/CRemoteInterface.cpp
testexecmgmt/ucc/RemoteInterface/src/CTCPTransport.cpp
testexecmgmt/ucc/SampleScripts/create_package_for_70_lubbock.bat
testexecmgmt/ucc/SampleScripts/create_package_for_emulator.bat
testexecmgmt/ucc/SampleScripts/create_package_for_lubbock.bat
testexecmgmt/ucc/SampleScripts/script.0001.ucd
testexecmgmt/ucc/SampleScripts/script.0002.ucd
testexecmgmt/ucc/SampleScripts/script.0003.ucd
testexecmgmt/ucc/SampleScripts/script.0004.ucd
testexecmgmt/ucc/SampleScripts/script.0005.ucd
testexecmgmt/ucc/SampleScripts/script.0006.ucd
testexecmgmt/ucc/SampleScripts/script.0007.ucd
testexecmgmt/ucc/SampleScripts/sti.0003.ini
testexecmgmt/ucc/SampleScripts/sti.0004.ini
testexecmgmt/ucc/SampleScripts/sti.0005.ini
testexecmgmt/ucc/SampleScripts/sti.0006.ini
testexecmgmt/ucc/SampleScripts/sti.0007.ini
testexecmgmt/ucc/SampleScripts/sts.0003.script
testexecmgmt/ucc/SampleScripts/sts.0004.script
testexecmgmt/ucc/SampleScripts/sts.0005.script
testexecmgmt/ucc/SampleScripts/sts.0006.script
testexecmgmt/ucc/SampleScripts/sts.0007.script
testexecmgmt/ucc/SetupScripts/clean_emulation_environment.sh
testexecmgmt/ucc/SetupScripts/setup_emulation_environment.sh
testexecmgmt/ucc/Source/AliasLibrary/CInterfaceAlias.cpp
testexecmgmt/ucc/Source/AliasLibrary/CInterfaceAlias.h
testexecmgmt/ucc/Source/AliasLibrary/Makefile
testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/CXClient.cpp
testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/CXClient.h
testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/cprotocol.dsp
testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/cprotocol.dsw
testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/CXServer.cpp
testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/CXServer.h
testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/sprotocol.dsp
testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/sprotocol.dsw
testexecmgmt/ucc/Source/DynamicsCommandWrapper/CDynamicsCommand.cpp
testexecmgmt/ucc/Source/DynamicsCommandWrapper/CDynamicsCommand.h
testexecmgmt/ucc/Source/DynamicsCommandWrapper/DynamicsCommandWrapper.dsp
testexecmgmt/ucc/Source/DynamicsCommandWrapper/DynamicsCommandWrapper.dsw
testexecmgmt/ucc/Source/DynamicsCommandWrapper/Makefile
testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/CDynamicsConfigFile.cpp
testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/CDynamicsConfigFile.h
testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/DynamicsConfigurationLibrary.dsp
testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/DynamicsConfigurationLibrary.dsw
testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/Makefile
testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/file_utilities.cpp
testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/file_utilities.h
testexecmgmt/ucc/Source/HostExecuteAsync/CSHostexecuteasync.cpp
testexecmgmt/ucc/Source/HostExecuteAsync/CSHostexecuteasync.h
testexecmgmt/ucc/Source/HostExecuteAsync/CSvcHostexecuteasync.cpp
testexecmgmt/ucc/Source/HostExecuteAsync/CSvcHostexecuteasync.h
testexecmgmt/ucc/Source/HostExecuteAsync/HostExecute.dsp
testexecmgmt/ucc/Source/HostExecuteAsync/HostExecute.dsw
testexecmgmt/ucc/Source/HostExecuteAsync/Makefile
testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync.h
testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync.x
testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_svc.c
testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_svc_stub_impl.cpp
testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_xdr.c
testexecmgmt/ucc/Source/HostExecuteSimple/CSHostexecute.cpp
testexecmgmt/ucc/Source/HostExecuteSimple/CSHostexecute.h
testexecmgmt/ucc/Source/HostExecuteSimple/CSvcHostexecute.cpp
testexecmgmt/ucc/Source/HostExecuteSimple/CSvcHostexecute.h
testexecmgmt/ucc/Source/HostExecuteSimple/HostExecute.dsp
testexecmgmt/ucc/Source/HostExecuteSimple/HostExecute.dsw
testexecmgmt/ucc/Source/HostExecuteSimple/Makefile
testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute.h
testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute.x
testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_svc.c
testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_svc_stub_impl.cpp
testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_xdr.c
testexecmgmt/ucc/Source/IntegerAllocatorLibrary/CIntegerAllocator.cpp
testexecmgmt/ucc/Source/IntegerAllocatorLibrary/CIntegerAllocator.h
testexecmgmt/ucc/Source/IntegerAllocatorLibrary/IntegerAllocatorLibrary.dsp
testexecmgmt/ucc/Source/IntegerAllocatorLibrary/IntegerAllocatorLibrary.dsw
testexecmgmt/ucc/Source/IntegerAllocatorLibrary/Makefile
testexecmgmt/ucc/Source/MobileTermination/CDatalinkNull.cpp
testexecmgmt/ucc/Source/MobileTermination/CDatalinkNull.h
testexecmgmt/ucc/Source/MobileTermination/CDatalinkPacketise.cpp
testexecmgmt/ucc/Source/MobileTermination/CDatalinkPacketise.h
testexecmgmt/ucc/Source/MobileTermination/CLog.cpp
testexecmgmt/ucc/Source/MobileTermination/CLog.h
testexecmgmt/ucc/Source/MobileTermination/CLogPPPFilter.cpp
testexecmgmt/ucc/Source/MobileTermination/CLogPPPFilter.h
testexecmgmt/ucc/Source/MobileTermination/CPhone.cpp
testexecmgmt/ucc/Source/MobileTermination/CPhone.h
testexecmgmt/ucc/Source/MobileTermination/CPppFrame.cpp
testexecmgmt/ucc/Source/MobileTermination/CPppFrame.h
testexecmgmt/ucc/Source/MobileTermination/CTCPTEChannel.cpp
testexecmgmt/ucc/Source/MobileTermination/CTCPTEChannel.h
testexecmgmt/ucc/Source/MobileTermination/CUDPAirInterface.cpp
testexecmgmt/ucc/Source/MobileTermination/CUDPAirInterface.h
testexecmgmt/ucc/Source/MobileTermination/MTInterfaces.h
testexecmgmt/ucc/Source/MobileTermination/Makefile
testexecmgmt/ucc/Source/MobileTermination/mt.dsp
testexecmgmt/ucc/Source/MobileTermination/mt.dsw
testexecmgmt/ucc/Source/MobsterRPCService/CSMobster.cpp
testexecmgmt/ucc/Source/MobsterRPCService/CSMobster.h
testexecmgmt/ucc/Source/MobsterRPCService/CSvcMobster.cpp
testexecmgmt/ucc/Source/MobsterRPCService/CSvcMobster.h
testexecmgmt/ucc/Source/MobsterRPCService/Makefile
testexecmgmt/ucc/Source/MobsterRPCService/MobsterRPCService.dsp
testexecmgmt/ucc/Source/MobsterRPCService/MobsterRPCService.dsw
testexecmgmt/ucc/Source/MobsterRPCService/device0000.log.txt
testexecmgmt/ucc/Source/MobsterRPCService/linux_conv.h
testexecmgmt/ucc/Source/MobsterRPCService/mobster.h
testexecmgmt/ucc/Source/MobsterRPCService/mobster.x
testexecmgmt/ucc/Source/MobsterRPCService/mobster_client_server_protocol.cpp
testexecmgmt/ucc/Source/MobsterRPCService/mobster_client_server_protocol.h
testexecmgmt/ucc/Source/MobsterRPCService/mobster_clnt.c
testexecmgmt/ucc/Source/MobsterRPCService/mobster_svc.c
testexecmgmt/ucc/Source/MobsterRPCService/mobster_svc_stub_impl.cpp
testexecmgmt/ucc/Source/MobsterRPCService/mobster_xdr.c
testexecmgmt/ucc/Source/PppdGateway/Makefile
testexecmgmt/ucc/Source/PppdGateway/pppdgateway.c
testexecmgmt/ucc/Source/PppdGateway/socket_helper.c
testexecmgmt/ucc/Source/PppdGateway/socket_helper.h
testexecmgmt/ucc/Source/ProcessLibrary/Makefile
testexecmgmt/ucc/Source/ProcessLibrary/ProcessLibrary.dsp
testexecmgmt/ucc/Source/ProcessLibrary/ProcessLibrary.dsw
testexecmgmt/ucc/Source/ProcessLibrary/proclib.h
testexecmgmt/ucc/Source/ProcessLibrary/proclib_linux.cpp
testexecmgmt/ucc/Source/ProcessLibrary/proclib_windows.cpp
testexecmgmt/ucc/Source/SerialTcpRelay/CSerialPort.cpp
testexecmgmt/ucc/Source/SerialTcpRelay/CSerialPort.h
testexecmgmt/ucc/Source/SerialTcpRelay/CSerialTcpRelay.cpp
testexecmgmt/ucc/Source/SerialTcpRelay/CSerialTcpRelay.h
testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.cpp
testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.dsp
testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.dsw
testexecmgmt/ucc/Source/SocketLibrary/SocketLibrary.dsp
testexecmgmt/ucc/Source/SocketLibrary/SocketLibrary.dsw
testexecmgmt/ucc/Source/SocketLibrary/socket_helper.cpp
testexecmgmt/ucc/Source/SocketLibrary/socket_helper.h
testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCServer.cpp
testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCServer.h
testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTest.cpp
testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTest.h
testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTestStep.cpp
testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTestStep.h
testexecmgmt/ucc/Source/ThreadLibrary/CAThread.cpp
testexecmgmt/ucc/Source/ThreadLibrary/CAThread.h
testexecmgmt/ucc/Source/ThreadLibrary/CAThread.linux.cpp
testexecmgmt/ucc/Source/ThreadLibrary/CAThread.windows.cpp
testexecmgmt/ucc/Source/ThreadLibrary/Makefile
testexecmgmt/ucc/Source/ThreadLibrary/ThreadLibrary.dsp
testexecmgmt/ucc/Source/ThreadLibrary/ThreadLibrary.dsw
testexecmgmt/ucc/Source/UCCSDeviceControl/CNetworkEmulatorSetupCommdb.cpp
testexecmgmt/ucc/Source/UCCSDeviceControl/CNetworkEmulatorSetupCommdb.h
testexecmgmt/ucc/Source/UCCSDeviceControl/CSerialTransport.cpp
testexecmgmt/ucc/Source/UCCSDeviceControl/CSerialTransport.h
testexecmgmt/ucc/Source/UCCSDeviceControl/CTCPTransport.cpp
testexecmgmt/ucc/Source/UCCSDeviceControl/CTCPTransport.h
testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceControl.cpp
testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceControl.h
testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceProtocol.cpp
testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceProtocol.h
testexecmgmt/ucc/Source/UCCSDeviceControl/MUCCTransport.h
testexecmgmt/ucc/Source/UCCSDeviceControl/NetworkEmulatorControl.h
testexecmgmt/ucc/Source/UCCSDeviceControl/UCCSDeviceControl.cpp
testexecmgmt/ucc/Source/UCCSDeviceControl/assert.h
testexecmgmt/ucc/Source/UUInterface/CSUuinterface.cpp
testexecmgmt/ucc/Source/UUInterface/CSUuinterface.h
testexecmgmt/ucc/Source/UUInterface/CSvcUuinterface.cpp
testexecmgmt/ucc/Source/UUInterface/CSvcUuinterface.h
testexecmgmt/ucc/Source/UUInterface/Load.Nistnet
testexecmgmt/ucc/Source/UUInterface/Makefile
testexecmgmt/ucc/Source/UUInterface/UUInterface.dsp
testexecmgmt/ucc/Source/UUInterface/UUInterface.dsw
testexecmgmt/ucc/Source/UUInterface/UUInterface_svc.c
testexecmgmt/ucc/Source/UUInterface/UUInterface_xdr.c
testexecmgmt/ucc/Source/UUInterface/config_nistnet_add.pl
testexecmgmt/ucc/Source/UUInterface/config_nistnet_reset.pl
testexecmgmt/ucc/Source/UUInterface/distribution.policy
testexecmgmt/ucc/Source/UUInterface/uuinterface.h
testexecmgmt/ucc/Source/UUInterface/uuinterface.x
testexecmgmt/ucc/Source/UUInterface/uuinterface_svc_stub_impl.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromConsole.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromConsole.h
testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromFile.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromFile.h
testexecmgmt/ucc/Source/Uccs.v2/Core/CSynchronisation.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/CSynchronisation.h
testexecmgmt/ucc/Source/Uccs.v2/Core/CUCCIniFile.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/CUCCIniFile.h
testexecmgmt/ucc/Source/Uccs.v2/Core/HTMLOutput.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/HTMLOutput.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CBatchEngine.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CBatchEngine.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CCommandDecoder.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CCommandDecoder.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataField.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataField.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataRecord.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataRecord.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CExecuteCommand.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CExecuteCommand.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CServMgr.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CServMgr.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ErrorCodes.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ErrorCodes.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_Interfaces.h
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_Main.cpp
testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ServiceValues.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CApplicationControlNull.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CApplicationControlNull.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CConsolePort.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CConsolePort.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CFrameBuffer.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CFrameBuffer.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CProtocolTypes.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CSerialPort.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CSerialPort.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CTcpPort.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CTcpPort.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandControl.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandControl.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandProtocol.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandProtocol.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CommandControlErrors.cpp
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CommandControlErrors.h
testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/distribution.policy
testexecmgmt/ucc/Source/Uccs.v2/HOWTO_AddService.txt
testexecmgmt/ucc/Source/Uccs.v2/SCRIPT_Commands.txt
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/CommonServiceStub/CServiceAgentBase.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/CommonServiceStub/CServiceAgentBase.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CCFacontroller.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CCFacontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CForeignAgentServiceStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CForeignAgentServiceStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CAPICommandHandlerStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CAPICommandHandlerStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CCGpssimulator.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CCGpssimulator.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CCGenericstub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CCGenericstub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CGenericStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CGenericrStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CCHacontroller.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CCHacontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CHomeAgentServiceStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CHomeAgentServiceStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CCHostexecute.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CCHostexecute.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CHostExecuteStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CHostExecuteStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CCHostexecuteasync.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CCHostexecuteasync.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CHostExecuteAsyncStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CHostExecuteAsyncStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Internal/CInternalStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Internal/CInternalStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CCMncontroller.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CCMncontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CMobileAgentServiceStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CMobileAgentServiceStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CCMobster.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CCMobster.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CMobsterStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CMobsterStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CCPppcontroller.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CCPppcontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CPppControllerStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CPppControllerStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Test/CTestStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Test/CTestStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CCTestservice.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CCTestservice.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CTestServiceStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CTestServiceStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CCUuinterface.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CCUuinterface.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CUuinterfaceStub.cpp
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CUuinterfaceStub.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface.h
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface.x
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface_clnt.c
testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface_xdr.c
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/bullet.gif
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0000.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0001.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0002.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0003.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0004.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0005.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0020.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0021.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0022.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0023.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0099.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0100.ucd
testexecmgmt/ucc/Source/Uccs.v2/TestScripts/ScheduleTestScripts/sts_0100.script
testexecmgmt/ucc/Source/Uccs.v2/UCCS.dsp
testexecmgmt/ucc/Source/Uccs.v2/UCCS.dsw
testexecmgmt/ucc/Source/Uccs.v2/Ucc.ico
testexecmgmt/ucc/Source/Uccs.v2/resource.h
testexecmgmt/ucc/Source/Uccs.v2/ucc.rc
testexecmgmt/ucc/Source/facontroller/CSFacontroller.cpp
testexecmgmt/ucc/Source/facontroller/CSFacontroller.h
testexecmgmt/ucc/Source/facontroller/CSvcFacontroller.cpp
testexecmgmt/ucc/Source/facontroller/CSvcFacontroller.h
testexecmgmt/ucc/Source/facontroller/FAController.dsp
testexecmgmt/ucc/Source/facontroller/FAController.dsw
testexecmgmt/ucc/Source/facontroller/Makefile
testexecmgmt/ucc/Source/facontroller/facontroller.h
testexecmgmt/ucc/Source/facontroller/facontroller.x
testexecmgmt/ucc/Source/facontroller/facontroller_svc.c
testexecmgmt/ucc/Source/facontroller/facontroller_svc_stub_impl.cpp
testexecmgmt/ucc/Source/facontroller/facontroller_xdr.c
testexecmgmt/ucc/Source/hacontroller/CNetworkPartitionManager.cpp
testexecmgmt/ucc/Source/hacontroller/CNetworkPartitionManager.h
testexecmgmt/ucc/Source/hacontroller/CSHacontroller.cpp
testexecmgmt/ucc/Source/hacontroller/CSHacontroller.h
testexecmgmt/ucc/Source/hacontroller/CSvcHacontroller.cpp
testexecmgmt/ucc/Source/hacontroller/CSvcHacontroller.h
testexecmgmt/ucc/Source/hacontroller/HAController.dsp
testexecmgmt/ucc/Source/hacontroller/HAController.dsw
testexecmgmt/ucc/Source/hacontroller/Makefile
testexecmgmt/ucc/Source/hacontroller/hacontroller.h
testexecmgmt/ucc/Source/hacontroller/hacontroller.x
testexecmgmt/ucc/Source/hacontroller/hacontroller_svc.c
testexecmgmt/ucc/Source/hacontroller/hacontroller_svc_stub_impl.cpp
testexecmgmt/ucc/Source/hacontroller/hacontroller_xdr.c
testexecmgmt/ucc/Source/include/CComponentManager.h
testexecmgmt/ucc/Source/include/penstd.h
testexecmgmt/ucc/Source/include/penstd.x
testexecmgmt/ucc/Source/include/standard_service_manager.h
testexecmgmt/ucc/Source/include/standard_unix.h
testexecmgmt/ucc/Source/include/strncpynt.h
testexecmgmt/ucc/Source/mncontroller/CSMncontroller.cpp
testexecmgmt/ucc/Source/mncontroller/CSMncontroller.h
testexecmgmt/ucc/Source/mncontroller/CSvcMncontroller.cpp
testexecmgmt/ucc/Source/mncontroller/CSvcMncontroller.h
testexecmgmt/ucc/Source/mncontroller/HOWTO_add_new_methods.txt
testexecmgmt/ucc/Source/mncontroller/MNController.dsp
testexecmgmt/ucc/Source/mncontroller/MNController.dsw
testexecmgmt/ucc/Source/mncontroller/Makefile
testexecmgmt/ucc/Source/mncontroller/mncontroller.h
testexecmgmt/ucc/Source/mncontroller/mncontroller.x
testexecmgmt/ucc/Source/mncontroller/mncontroller_svc.c
testexecmgmt/ucc/Source/mncontroller/mncontroller_svc_stub_impl.cpp
testexecmgmt/ucc/Source/mncontroller/mncontroller_xdr.c
testexecmgmt/ucc/Source/pppcontroller/CSPppcontroller.cpp
testexecmgmt/ucc/Source/pppcontroller/CSPppcontroller.h
testexecmgmt/ucc/Source/pppcontroller/CSvcPppcontroller.cpp
testexecmgmt/ucc/Source/pppcontroller/CSvcPppcontroller.h
testexecmgmt/ucc/Source/pppcontroller/Makefile
testexecmgmt/ucc/Source/pppcontroller/pppcontroller.dsp
testexecmgmt/ucc/Source/pppcontroller/pppcontroller.dsw
testexecmgmt/ucc/Source/pppcontroller/pppcontroller.h
testexecmgmt/ucc/Source/pppcontroller/pppcontroller.x
testexecmgmt/ucc/Source/pppcontroller/pppcontroller_svc.c
testexecmgmt/ucc/Source/pppcontroller/pppcontroller_svc_stub_impl.cpp
testexecmgmt/ucc/Source/pppcontroller/pppcontroller_xdr.c
testexecmgmt/ucc/Source/readme.txt
testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-TCP/master.htm
testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-TCP/slave.htm
testexecmgmt/ucc/Test/Results/9.1/BasicSync/TCP-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.1/BasicSync/TCP-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-TCP/master.htm
testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-TCP/slave.htm
testexecmgmt/ucc/Test/Results/9.1/SetSharedData/TCP-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.1/SetSharedData/TCP-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-TCP/master.htm
testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-TCP/slave.htm
testexecmgmt/ucc/Test/Results/9.2/BasicSync/TCP-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.2/BasicSync/TCP-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/distribution.policy
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/distribution.policy
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/master.htm
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/slave.htm
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/distribution.policy
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/master.htm
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/slave.htm
testexecmgmt/ucc/Test/Results/9.2/SetSharedData/distribution.policy
testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Master/TestResults.htm
testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Master/master.htm
testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Slave/TestResults.htm
testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Slave/slave.htm
testexecmgmt/ucc/Test/Results/Legacy/output0001.debug.html
testexecmgmt/ucc/Test/Results/Legacy/output0001.log.html
testexecmgmt/ucc/Test/Results/Legacy/output0001.noref.html
testexecmgmt/ucc/Test/Results/TestResults.xls
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/SyncService.ini
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/TestDriverService.ini
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/master.script
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/SyncService.ini
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/TestDriverService.ini
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/master.script
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/SyncService.ini
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/TestDriverService.ini
testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/master.script
testexecmgmt/ucc/Test/Scripts/BasicSync/Slave/sampletest.ini
testexecmgmt/ucc/Test/Scripts/BasicSync/Slave/slave.script
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/SyncService.ini
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/TestDriverService.ini
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/distribution.policy
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/master.script
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/SyncService.ini
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/TestDriverService.ini
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/distribution.policy
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/master.script
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/SyncService.ini
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/TestDriverService.ini
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/distribution.policy
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/master.script
testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/distribution.policy
testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/SharedData.ini
testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/distribution.policy
testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/slave.script
testexecmgmt/ucc/Test/Scripts/SetSharedData/distribution.policy
testexecmgmt/ucc/Test/xml/CommandLineTest.dtd
testexecmgmt/ucc/Test/xml/RTest.dtd
testexecmgmt/ucc/Test/xml/RTestRom.dtd
testexecmgmt/ucc/Test/xml/SampleTestServer.xml
testexecmgmt/ucc/Test/xml/SampleTestServer/UCCSlaveTest.xml
testexecmgmt/ucc/Test/xml/SampleTestServer/distribution.policy
testexecmgmt/ucc/Test/xml/SampleTestServer/testExecuteServers/SampleServer.xml
testexecmgmt/ucc/Test/xml/SampleTestServer/testExecuteServers/distribution.policy
testexecmgmt/ucc/Test/xml/UCCSlave.xml
testexecmgmt/ucc/Test/xml/distribution.policy
testexecmgmt/ucc/Test/xml/root.xml
testexecmgmt/ucc/Test/xml/testExecuteServer.dtd
testexecmgmt/ucc/Test/xml/testExecuteTest.dtd
testexecmgmt/ucc/Test/xml/testSuite.dtd
testexecmgmt/ucc/bin/ucc.exe
testexecmgmt/ucc/bin/ucc.ini
testtoolsconn/oncrpc/bin/oncrpc.dll
testtoolsconn/oncrpc/bin/portmap.exe
testtoolsconn/oncrpc/bin/portmap.srg
testtoolsconn/oncrpc/bin/portmapinstall.bat
testtoolsconn/oncrpc/binaries_for_build/oncrpcms.lib
testtoolsconn/oncrpc/group/bld.inf
testtoolsconn/oncrpc/group/oncrpc.configure.nsh
testtoolsconn/oncrpc/group/oncrpc.mrp
testtoolsconn/oncrpc/group/oncrpc.tdf
testtoolsconn/oncrpc/group/release.txt
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/AUTH.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/AUTH_UNI.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/BCOPY.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/CLNT.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/NETDB.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/PMAP_CLN.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/PMAP_PRO.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/PMAP_RMT.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/RPC.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/RPC_MSG.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/SVC.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/SVC_AUTH.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/TYPES.H
testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/XDR.H
testtoolsconn/stat/common/inc/padpacket.h
testtoolsconn/stat/common/inc/serialpacketsize.h
testtoolsconn/stat/desktop/bin/dummy.txt
testtoolsconn/stat/desktop/group/bld.inf
testtoolsconn/stat/desktop/group/release.txt
testtoolsconn/stat/desktop/group/stat.mrp
testtoolsconn/stat/desktop/group/stat_desktop.tdf
testtoolsconn/stat/desktop/lib/dummy.txt
testtoolsconn/stat/desktop/source/common/inc/ini.h
testtoolsconn/stat/desktop/source/common/src/ini.cpp
testtoolsconn/stat/desktop/source/common/transport/inc/cclientsocket.h
testtoolsconn/stat/desktop/source/common/transport/inc/cstatmessagecom.h
testtoolsconn/stat/desktop/source/common/transport/inc/statsocket.h
testtoolsconn/stat/desktop/source/common/transport/src/cclientsocket.cpp
testtoolsconn/stat/desktop/source/common/transport/src/cstatmessagecom.cpp
testtoolsconn/stat/desktop/source/common/transport/src/statsocket.cpp
testtoolsconn/stat/desktop/source/desktop/group/bld.inf
testtoolsconn/stat/desktop/source/desktop/group/statdesktop.mk
testtoolsconn/stat/desktop/source/desktop/inc/logmessage.h
testtoolsconn/stat/desktop/source/desktop/inc/messagereporterimp.h
testtoolsconn/stat/desktop/source/desktop/inc/resource.h
testtoolsconn/stat/desktop/source/desktop/inc/scriptprogressmonitorimp.h
testtoolsconn/stat/desktop/source/desktop/inc/statdesktop.h
testtoolsconn/stat/desktop/source/desktop/inc/statdesktopdlg.h
testtoolsconn/stat/desktop/source/desktop/inc/statmanageconnection.h
testtoolsconn/stat/desktop/source/desktop/inc/stdafx.h
testtoolsconn/stat/desktop/source/desktop/inc/windowmessages.h
testtoolsconn/stat/desktop/source/desktop/res/statdesktop.ico
testtoolsconn/stat/desktop/source/desktop/res/statdesktop.rc2
testtoolsconn/stat/desktop/source/desktop/src/statdesktop.cpp
testtoolsconn/stat/desktop/source/desktop/src/statdesktop.rc
testtoolsconn/stat/desktop/source/desktop/src/statdesktopdlg.cpp
testtoolsconn/stat/desktop/source/desktop/src/statmanageconnection.cpp
testtoolsconn/stat/desktop/source/desktop/src/stdafx.cpp
testtoolsconn/stat/desktop/source/desktop/statdesktop.dep
testtoolsconn/stat/desktop/source/desktop/statdesktop.dsp
testtoolsconn/stat/desktop/source/desktop/statdesktop.mak
testtoolsconn/stat/desktop/source/desktop/updatedesktop.bat
testtoolsconn/stat/desktop/source/dll/group/bld.inf
testtoolsconn/stat/desktop/source/dll/group/statdll.mk
testtoolsconn/stat/desktop/source/dll/inc/resource.h
testtoolsconn/stat/desktop/source/dll/inc/stdafx.h
testtoolsconn/stat/desktop/source/dll/res/stat.rc2
testtoolsconn/stat/desktop/source/dll/src/statdll.rc
testtoolsconn/stat/desktop/source/dll/src/stdafx.cpp
testtoolsconn/stat/desktop/source/dll/stat.def
testtoolsconn/stat/desktop/source/dll/statd.def
testtoolsconn/stat/desktop/source/dll/statdll.dep
testtoolsconn/stat/desktop/source/dll/statdll.dsp
testtoolsconn/stat/desktop/source/dll/statdll.mak
testtoolsconn/stat/desktop/source/dll/updatedll.bat
testtoolsconn/stat/desktop/source/lib/group/bld.inf
testtoolsconn/stat/desktop/source/lib/group/statlib.mk
testtoolsconn/stat/desktop/source/lib/inc/creporter.h
testtoolsconn/stat/desktop/source/lib/inc/cstatdataformatconverter.h
testtoolsconn/stat/desktop/source/lib/inc/cstatimageverify.h
testtoolsconn/stat/desktop/source/lib/inc/cstatlogfile.h
testtoolsconn/stat/desktop/source/lib/inc/cstatreturncodes.h
testtoolsconn/stat/desktop/source/lib/inc/messagereporter.h
testtoolsconn/stat/desktop/source/lib/inc/messagetypes.h
testtoolsconn/stat/desktop/source/lib/inc/scriptprogressmonitor.h
testtoolsconn/stat/desktop/source/lib/inc/stat.h
testtoolsconn/stat/desktop/source/lib/inc/statbitmap.h
testtoolsconn/stat/desktop/source/lib/inc/statcommon.h
testtoolsconn/stat/desktop/source/lib/inc/statcomms.h
testtoolsconn/stat/desktop/source/lib/inc/statengine.h
testtoolsconn/stat/desktop/source/lib/inc/statexp.h
testtoolsconn/stat/desktop/source/lib/inc/statlist.h
testtoolsconn/stat/desktop/source/lib/inc/statmember.h
testtoolsconn/stat/desktop/source/lib/inc/statscriptdecoder.h
testtoolsconn/stat/desktop/source/lib/inc/statserial.h
testtoolsconn/stat/desktop/source/lib/inc/statserialbluetooth.h
testtoolsconn/stat/desktop/source/lib/inc/statsocket_block.h
testtoolsconn/stat/desktop/source/lib/inc/stattransport.h
testtoolsconn/stat/desktop/source/lib/inc/stdafx.h
testtoolsconn/stat/desktop/source/lib/inc/windowmessages.h
testtoolsconn/stat/desktop/source/lib/src/crepmisc.cpp
testtoolsconn/stat/desktop/source/lib/src/creporter.cpp
testtoolsconn/stat/desktop/source/lib/src/cstatdataformatconverter.cpp
testtoolsconn/stat/desktop/source/lib/src/cstatimageverify.cpp
testtoolsconn/stat/desktop/source/lib/src/cstatlogfile.cpp
testtoolsconn/stat/desktop/source/lib/src/cstatreturncodes.cpp
testtoolsconn/stat/desktop/source/lib/src/distribution.policy
testtoolsconn/stat/desktop/source/lib/src/statbitmap.cpp
testtoolsconn/stat/desktop/source/lib/src/statcomms.cpp
testtoolsconn/stat/desktop/source/lib/src/statengine.cpp
testtoolsconn/stat/desktop/source/lib/src/statexp.cpp
testtoolsconn/stat/desktop/source/lib/src/statlist.cpp
testtoolsconn/stat/desktop/source/lib/src/statmember.cpp
testtoolsconn/stat/desktop/source/lib/src/statscriptdecoder.cpp
testtoolsconn/stat/desktop/source/lib/src/statserial.cpp
testtoolsconn/stat/desktop/source/lib/src/statserialbluetooth.cpp
testtoolsconn/stat/desktop/source/lib/src/statsocket_block.cpp
testtoolsconn/stat/desktop/source/lib/src/stdafx.cpp
testtoolsconn/stat/desktop/source/lib/statlib.dep
testtoolsconn/stat/desktop/source/lib/statlib.dsp
testtoolsconn/stat/desktop/source/lib/statlib.mak
testtoolsconn/stat/desktop/source/lib/updatelib.bat
testtoolsconn/stat/desktop/source/perl/statapi.pm
testtoolsconn/stat/desktop/source/perl/using stat with perl.txt
testtoolsconn/stat/desktop/source/stat.dsw
testtoolsconn/stat/desktop/source/stat2perl/group/bld.inf
testtoolsconn/stat/desktop/source/stat2perl/group/stat2perl.mk
testtoolsconn/stat/desktop/source/stat2perl/inc/commandline.h
testtoolsconn/stat/desktop/source/stat2perl/inc/stdafx.h
testtoolsconn/stat/desktop/source/stat2perl/src/commandline.cpp
testtoolsconn/stat/desktop/source/stat2perl/src/distribution.policy
testtoolsconn/stat/desktop/source/stat2perl/src/stat2perl.cpp
testtoolsconn/stat/desktop/source/stat2perl/src/stdafx.cpp
testtoolsconn/stat/desktop/source/stat2perl/stat2perl.dep
testtoolsconn/stat/desktop/source/stat2perl/stat2perl.dsp
testtoolsconn/stat/desktop/source/stat2perl/stat2perl.mak
testtoolsconn/stat/desktop/source/stat2perl/updatestat2perl.bat
testtoolsconn/stat/desktop/source/trgtest/group/bld.inf
testtoolsconn/stat/desktop/source/trgtest/group/trgtest.mmp
testtoolsconn/stat/desktop/source/trgtest/src/trgtest.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/include.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/resource.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/stdafx.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/stdafx.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.dsp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.rc
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcomdlg.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcomdlg.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.dsp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.rc
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclientdlg.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclientdlg.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/resource.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/stdafx.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/stdafx.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.dsp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.rc
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclientdlg.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclientdlg.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/resource.h
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/stdafx.cpp
testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/stdafx.h
testtoolsconn/stat/desktop/testsource/dlltester/dlltest.dep
testtoolsconn/stat/desktop/testsource/dlltester/dlltest.dsp
testtoolsconn/stat/desktop/testsource/dlltester/dlltest.mak
testtoolsconn/stat/desktop/testsource/dlltester/dlltest.rc
testtoolsconn/stat/desktop/testsource/dlltester/group/bld.inf
testtoolsconn/stat/desktop/testsource/dlltester/group/statdlltester.mk
testtoolsconn/stat/desktop/testsource/dlltester/inc/dlltest.h
testtoolsconn/stat/desktop/testsource/dlltester/inc/dlltestdlg.h
testtoolsconn/stat/desktop/testsource/dlltester/inc/resource.h
testtoolsconn/stat/desktop/testsource/dlltester/inc/stdafx.h
testtoolsconn/stat/desktop/testsource/dlltester/inc/utils.h
testtoolsconn/stat/desktop/testsource/dlltester/res/dlltest.ico
testtoolsconn/stat/desktop/testsource/dlltester/res/dlltest.rc2
testtoolsconn/stat/desktop/testsource/dlltester/src/distribution.policy
testtoolsconn/stat/desktop/testsource/dlltester/src/dlltest.cpp
testtoolsconn/stat/desktop/testsource/dlltester/src/dlltestdlg.cpp
testtoolsconn/stat/desktop/testsource/dlltester/src/stdafx.cpp
testtoolsconn/stat/desktop/testsource/dlltester/src/utils.cpp
testtoolsconn/stat/desktop/testsource/dlltestermt/dlltest_multithreaded.dep
testtoolsconn/stat/desktop/testsource/dlltestermt/dlltest_multithreaded.dsp
testtoolsconn/stat/desktop/testsource/dlltestermt/dlltest_multithreaded.mak
testtoolsconn/stat/desktop/testsource/dlltestermt/group/bld.inf
testtoolsconn/stat/desktop/testsource/dlltestermt/group/statdlltestermt.mk
testtoolsconn/stat/desktop/testsource/dlltestermt/inc/dlltest_worker.h
testtoolsconn/stat/desktop/testsource/dlltestermt/inc/stattask.h
testtoolsconn/stat/desktop/testsource/dlltestermt/inc/stdafx.h
testtoolsconn/stat/desktop/testsource/dlltestermt/src/dlltest_multithreaded.cpp
testtoolsconn/stat/desktop/testsource/dlltestermt/src/dlltest_worker.cpp
testtoolsconn/stat/desktop/testsource/dlltestermt/src/stattask.cpp
testtoolsconn/stat/desktop/testsource/dlltestermt/src/stdafx.cpp
testtoolsconn/stat/desktop/testsource/testsource.dsw
testtoolsconn/stat/group/release.txt
testtoolsconn/stat/scripts/perl/stat.pl
testtoolsconn/stat/scripts/standard/file_transfer.txt
testtoolsconn/stat/scripts/standard/hamlet.txt
testtoolsconn/stat/scripts/standard/prepare.txt
testtoolsconn/stat/scripts/standard/sample.txt
testtoolsconn/stat/scripts/standard/simpleword.txt
testtoolsconn/stat/scripts/standard/statdlltest.txt
testtoolsconn/stat/scripts/standard/various.txt
testtoolsconn/stat/scripts/standard/various_eka1.txt
testtoolsconn/stat/scripts/standard/various_eka2.txt
testtoolsconn/wintap/bin/ethertap.pdd
testtoolsconn/wintap/driver/OemWin2k.inf
testtoolsconn/wintap/driver/license.txt
testtoolsconn/wintap/driver/tap0801.sys
testtoolsconn/wintap/driver/tap0901.cat
testtoolsconn/wintap/driver/tap0901.inf
testtoolsconn/wintap/driver/tap0901.sys
testtoolsconn/wintap/driver/tapinstaller.cpp
testtoolsconn/wintap/driver/tapinstaller.dsp
testtoolsconn/wintap/driver/tapinstaller.dsw
testtoolsconn/wintap/driver/tapinstaller.exe
testtoolsconn/wintap/driver/wintap-config.doc
testtoolsconn/wintap/driver/wintap.configure.nsh
testtoolsconn/wintap/driver/wintap.uninstaller.nsh
testtoolsconn/wintap/driver/x64driver/tap0901.cat
testtoolsconn/wintap/driver/x64driver/tap0901.inf
testtoolsconn/wintap/driver/x64driver/tap0901.sys
testtoolsconn/wintap/driver/x64driver/tapinstaller.x64.exe
testtoolsconn/wintap/group/bld.inf
testtoolsconn/wintap/group/ethertap.mmp
testtoolsconn/wintap/group/release.txt
testtoolsconn/wintap/group/wintap.mrp
testtoolsconn/wintap/group/wintap.tdf
testtoolsconn/wintap/group/wintaplib.mmp
testtoolsconn/wintap/group/wintaplibinst.mmp
testtoolsconn/wintap/inc/wintap.h
testtoolsconn/wintap/src/ethertap.cpp
testtoolsconn/wintap/src/wintap.cpp
testtoolsconn/wintap/utils/commdbupdate.pl
testtoolsconn/wintap/utils/simplecommdb.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/readme.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,3 @@
+Non-releasable binaries should build into this directory. This includes test tools and libs to be
+used by releasable binaries. This does not include tools used during the build (or code management)
+process -- these should be in BuildTools.
Binary file testexecmgmt/ucc/BinInternal/rpcgen.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,42 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../../../BuildTools/rpcgen.3gne.linux
+CFLAGS=		-g -Wall -DWIN32_TARGET
+INCLUDES=	-I..\rpc
+OBJECTS=		rpc_clnt.o	\
+			rpc_cout.o	\
+			rpc_hout.o	\
+			rpc_main.o	\
+			rpc_pars.o	\
+			rpc_scan.o	\
+			rpc_svco.o	\
+			rpc_util.o	\
+			ae_component_rpc.o
+
+LIBS= 		-lpthread
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS)
+	gcc $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/ae_component_rpc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2132 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include "rpc_util.h"
+#include "rpc_pars.h"
+#include "rpc_scan.h"
+
+
+/*********************************************************************
+ *
+ * Local Includes
+ *
+ ********************************************************************/
+#include "ae_component_rpc.h"
+
+
+/*********************************************************************
+ *
+ * Definitions
+ *
+ ********************************************************************/
+#define BANNER_START "/****************************************************************************************\n"
+#define BANNER_LINE  " * "
+#define BANNER_END   " ***************************************************************************************/\n"
+
+
+/*********************************************************************
+ *
+ * Macro Functions
+ *
+ ********************************************************************/
+#define O(x)	     f_print(fout,x);
+
+
+/*********************************************************************
+ *
+ * Types
+ *
+ ********************************************************************/
+typedef void (*header_func_t)(char *filename, definition *program);
+typedef void (*footer_func_t)(definition *program);
+typedef void (*proc_func_t)(definition *program,proc_list *proc, char *version);
+
+
+/*********************************************************************
+ *
+ * Prototypes
+ *
+ ********************************************************************/
+void open_input( char *infile, char *define );
+void open_output( char *infile, char *outfile );
+char *extendfile( char *file, char *ext );
+char *locase( char *str);
+
+// filename related helpers
+void PrintStartDefs( definition *def );
+void PrintEndDefs( definition *def );
+void PrintIncludeInterfaceHeader();
+
+// banners
+void PrintFileBanner( char *filename );
+void PrintBanner( char *title );
+void PrintAutogenBanner( char *filename );
+void PrintAutogenModBanner( char *filename );
+
+// classname helpers
+char *ComponentClassname( definition *def );
+char *ClientComponentClassname( definition *def );
+char *ServiceManagerClassname( definition *def );
+
+// function helpers
+void PrintClientStubSignature( int indent, char *classname, proc_list *proc );
+void PrintComponentInstanceMethodSignature( char *classname, definition *program, proc_list *proc );
+void PrintSetErrorValue( int indent, definition *program, proc_list *proc, char *error );
+int IsSetErrorCallRequired( proc_list *proc );
+void PrintServiceCheck( definition *program, proc_list *proc );
+void PrintCallFromServiceStubToInstance( definition *program, proc_list *proc, char *extraargs );
+void PrintCallFromServiceStubToStatic( definition *program, proc_list *proc, char *extra_args );
+
+// misc helpers
+char *ucase( char *str );
+void trace( int indent, definition *program, proc_list *proc, char *fname, int enter );
+
+// service stub implementations
+void output_header_service_implementation( char *filename, definition *program );
+void output_footer_service_implementation( definition *program );
+void output_proc_service_implementation( definition *program, proc_list *proc, char *version );
+void output_std_proc_service_implementation( definition *program, proc_list *proc );
+void output_cstr_proc_service_implementation( definition *program, proc_list *proc );
+void output_dstr_proc_service_implementation( definition *program, proc_list *proc );
+void output_startup_proc_service_implementation( definition *program, proc_list *proc );
+void output_shutdown_proc_service_implementation( definition *program, proc_list *proc );
+void output_list_proc_service_implementation( definition *program, proc_list *proc );
+void output_static_proc_service_implementation( definition *program, proc_list *proc );
+
+// service manager class header
+void output_header_svc_header( char *filename, definition *program );
+void output_footer_svc_header( definition *program );
+void output_proc_svc_header( definition *program, proc_list *proc, char *version );
+
+// service manager class cpp
+void output_header_svc_cpp( char *filename, definition *program );
+void output_footer_svc_cpp( definition *program );
+void output_proc_svc_cpp( definition *program, proc_list *proc, char *version );
+
+// server component class header
+void output_header_inst_header( char *filename, definition *program );
+void output_footer_inst_header( definition *program );
+void output_proc_inst_header( definition *program, proc_list *proc, char *version );
+
+// server component class cpp
+void output_header_inst_cpp( char *filename, definition *program );
+void output_footer_inst_cpp( definition *program );
+void output_proc_inst_cpp( definition *program, proc_list *proc, char *version );
+
+// client component stub class header
+void output_header_stub_header( char *filename, definition *program );
+void output_footer_stub_header( definition *program );
+void output_proc_stub_header( definition *program, proc_list *proc, char *version );
+
+// client component stub class cpp
+void output_header_stub_cpp( char *filename, definition *program );
+void output_footer_stub_cpp( definition *program );
+void output_proc_stub_cpp( definition *program, proc_list *proc, char *version );
+void output_proc_stub_cpp_std( definition *program, proc_list *proc, char *version );
+
+
+/*********************************************************************
+ *
+ * Static Vars
+ *
+ ********************************************************************/
+static header_func_t hf[] = { output_header_service_implementation, output_header_svc_header, output_header_svc_cpp,	output_header_inst_header,	output_header_inst_cpp,	output_header_stub_header,	output_header_stub_cpp	};
+static footer_func_t ff[] = { output_footer_service_implementation, output_footer_svc_header, output_footer_svc_cpp,	output_footer_inst_header,	output_footer_inst_cpp,	output_footer_stub_header,	output_footer_stub_cpp	};
+static proc_func_t   pf[] = { output_proc_service_implementation,   output_proc_svc_header,	  output_proc_svc_cpp,		output_proc_inst_header,	output_proc_inst_cpp,	output_proc_stub_header,	output_proc_stub_cpp	};
+
+static char *input_filename;
+static int gtype;
+static int trace_points[7] = { 0 };
+
+/*********************************************************************
+ *
+ * ae_output_rpc_file()
+ *
+ ********************************************************************/
+void ae_output_rpc_file( char *infile, char *outfile, int type )
+{
+	char tmpfilename[128];
+	char *outfilename;
+	int foundprogram = 0;
+	definition *def, *def_program;
+	version_list *vp;
+	proc_list *proc;
+
+	// save some stuff for use down the chain
+	input_filename = infile;
+	gtype = type;
+
+	// open the input file 
+	open_input( infile, "-DRPC_SVC" );
+
+	// look for the program definition
+	while( (def = get_definition()) ) {
+		if( def->def_kind == DEF_PROGRAM ) {
+			def_program = def;
+			foundprogram++;
+		}
+	}
+
+	// if there is no program then exit 
+	if( foundprogram == 0 ) {
+		return;
+	}
+
+	// open the output file
+	if( (type == TYPE_SVC_MGR_H) || (type == TYPE_SVC_MGR_C) ) {
+		sprintf( tmpfilename, "%s", ServiceManagerClassname(def_program) );
+		infile = tmpfilename;
+	} else if( (type == TYPE_INST_H) || (type == TYPE_INST_C) ) {
+		sprintf( tmpfilename, "%s", ComponentClassname(def_program) );
+		infile = tmpfilename;
+	} else if( (type == TYPE_CLIENT_H) || (type == TYPE_CLIENT_C) ) {
+		sprintf( tmpfilename, "%s", ClientComponentClassname(def_program) );
+		infile = tmpfilename;
+	}
+	outfilename = extendfile(infile, outfile);
+	open_output( infile, outfilename );
+
+	// if there is more than one program then say I don't handle this
+	if( foundprogram > 1 ) {
+		fprintf( stderr, "ERROR: PR0094 modifications can't handle multiple program definitions in a single file.\n" );
+		return;
+	}
+
+	// I also don't handle multiple versions in a single file
+	vp = def_program->def.pr.versions;
+	if( vp->next != NULL ) {
+		fprintf( stderr, "ERROR: PR0094 modifications can't handle multiple program versions in a single file.\n" );
+		return;
+	}
+
+	// HOOK: Insert header code
+	hf[type]( outfilename, def_program );
+
+	// process each procedure
+	for( proc = vp->procs; proc != NULL; proc = proc->next ) {
+		// HOOK: Insert proc code
+		pf[type]( def_program, proc, vp->vers_num );
+	}
+
+	// HOOK: Insert footer code
+	ff[type]( def_program );
+
+	// done
+	return;
+}
+
+
+/*********************************************************************
+ *
+ * SECTION: Service Stub Implementation
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- START
+ *
+ ********************************************************************/
+void output_header_service_implementation( char *filename, definition *program )
+{
+	// output the autogen banner
+	PrintAutogenBanner( filename );
+
+	// output the system includes
+	PrintBanner( "System Includes" );
+	f_print( fout, "#include <assert.h>\n" );
+
+	// output the local includes
+	PrintBanner( "Local Includes" );
+	f_print( fout, "#include \"%s.h\"\n", ServiceManagerClassname(program) );
+	f_print( fout, "#include \"%s.h\"\n", ComponentClassname(program) );
+	f_print( fout, "#include \"CComponentManager.h\"\n" );
+
+	// output the static variables
+	PrintBanner( "Static Variables" );
+	f_print( fout, "static CComponentManager<%s> *iComponentManager;\n", ComponentClassname(program) );
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- END
+ *
+ ********************************************************************/
+void output_footer_service_implementation( definition *program )
+{
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (TOP LEVEL)
+ *
+ ********************************************************************/
+void output_proc_service_implementation( definition *program, proc_list *proc, char *version )
+{
+	char str[512];
+
+	// print banner
+	sprintf( str, "PUBLIC FUNCTION: %s", locase(proc->proc_name) );
+	PrintBanner( str );
+
+	// print the function signature
+	ptype( proc->res_prefix, proc->res_type, 1 );
+	f_print( fout, "*");
+	pvname( proc->proc_name, version );
+	f_print(fout, "( ");
+	ptype( proc->arg_prefix, proc->arg_type, 1 );
+	f_print(fout, "*aArgs, CLIENT *aDutout )\n");
+
+	// demux based on the name of the prefix
+	if( strncmp(proc->proc_name,"SS_",3) == 0 ) {
+		output_startup_proc_service_implementation( program, proc );
+	} else if( strncmp(proc->proc_name,"SC_",3) == 0 ) {
+		output_shutdown_proc_service_implementation( program, proc );
+	} else if( strncmp(proc->proc_name,"CSTR_",5) == 0 ) {
+		output_cstr_proc_service_implementation( program, proc );
+	} else if( strncmp(proc->proc_name,"DSTR_",5) == 0 ) {
+		output_dstr_proc_service_implementation( program, proc );
+	} else if( strncmp(proc->proc_name,"LIST_",5) == 0 ) {
+		output_list_proc_service_implementation( program, proc );
+	} else if( strncmp(proc->proc_name,"ST_",3) == 0 ) {
+		output_static_proc_service_implementation( program, proc );
+	} else {
+		output_std_proc_service_implementation( program, proc );
+	}
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (STANDARD METHODS)
+ *
+ ********************************************************************/
+void output_std_proc_service_implementation( definition *program, proc_list *proc )
+{
+	int void_return_type = 0;
+
+	// start
+	f_print( fout, "{\n" );
+
+	// check for void return value
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_return_type = 1;
+	}
+
+	// declare variables
+	f_print( fout, "\tstatic " );
+	if( void_return_type == 0 ) {
+		ptype( proc->res_prefix, proc->res_type, 1 );
+	} else {
+		f_print( fout, "int " );
+	}	
+	f_print( fout, "rv;\n");
+	f_print( fout, "\tint instance_key;\n" );
+	f_print( fout, "\t%s *session;\n\n", ComponentClassname(program) );
+	trace( 1, program, proc, NULL, 1 );
+
+	// check that the service is already started
+	PrintServiceCheck( program, proc );
+
+	// set the return value to generic error
+	O( "\t// set the return value to generic error\n" );
+	PrintSetErrorValue( 1, program, proc, "ERR_FAILED_TO_RETRIEVE_KEY" );
+	f_print( fout, "\n" );
+
+	// get the key for the instance from the args
+	O( "\t// get the key for the instance from the args\n" );
+	f_print( fout, "\tinstance_key = %s::GetInstanceKeyFromArgs( %s, (void*)aArgs );\n", ServiceManagerClassname(program), proc->proc_name );
+	O( "\tif( instance_key < 0 ) {\n" );
+	trace( 2, program, proc, NULL, 0 );
+	O( "\t\treturn &rv;\n" );
+	O( "\t}\n" );
+	O( "\n" );
+
+	// make sure the key is valid
+	O( "\t// make sure the key is valid\n" );
+	O( "\tif( iComponentManager->IsValidKey(instance_key) == 0 ) {\n" );		
+	PrintSetErrorValue( 2, program, proc, "ERR_INSTANCE_DOES_NOT_EXIST" );
+	O( "\t\treturn &rv;\n" );
+	O( "\t}\n" );
+	O( "\n" );
+	
+	// get the instance
+	O( "\t// get the instance\n" );
+	O( "\tsession = iComponentManager->GetInstance( instance_key );\n" );
+	O( "\tassert( session != NULL );\n" );
+	O( "\n" );
+
+	// call the corresponding method on the instance and return the result
+	PrintCallFromServiceStubToInstance( program, proc, NULL );
+	trace( 1, program, proc, NULL, 0 );
+	f_print( fout, "\treturn &rv;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (STATIC METHODS)
+ *
+ ********************************************************************/
+void output_static_proc_service_implementation( definition *program, proc_list *proc )
+{
+	int void_return_type = 0;
+
+	// start
+	f_print( fout, "{\n" );
+
+	// check for void return value
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_return_type = 1;
+	}
+
+	// declare the return variable
+	f_print( fout, "\tstatic " );
+	if( void_return_type == 0 ) {
+		ptype( proc->res_prefix, proc->res_type, 1 );
+	} else {
+		f_print( fout, "int " );
+	}	
+	f_print( fout, "rv;\n");
+	trace( 1, program, proc, NULL, 1 );
+	O( "\n" );
+
+	// check that the service is already started
+	PrintServiceCheck( program, proc );
+
+	// call the corresponding method on the instance and return the result
+	PrintCallFromServiceStubToStatic( program, proc, NULL );
+	trace( 1, program, proc, NULL, 0 );
+	f_print( fout, "\treturn &rv;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (CSTR METHODS)
+ *
+ ********************************************************************/
+void output_cstr_proc_service_implementation( definition *program, proc_list *proc )
+{
+	int integer_return_type;
+
+	// start
+	f_print( fout, "{\n" );
+
+	// a void return type is illegal for a cstr_ method
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		fprintf( stderr, "ERROR: 'cstr_' methods must not have void return type.\n" );
+		return;
+	}
+
+	// declare variables
+	f_print( fout, "\tstatic " );
+	ptype( proc->res_prefix, proc->res_type, 1 );
+	f_print( fout, "rv;\n" );
+	f_print( fout, "\tint result;\n" );
+	f_print( fout, "\tint internal_err;\n" );
+	f_print( fout, "\tint instance_key;\n" );
+	f_print( fout, "\t%s *session;\n", ComponentClassname(program) );
+	trace( 1, program, proc, NULL, 1 );
+	O( "\n" );
+	
+	// check that the service is already started
+	PrintServiceCheck( program, proc );
+
+	// create a new component instance
+	O( "\t// create a new component instance\n" );
+	O( "\tinstance_key = iComponentManager->CreateInstance();\n" );
+	O( "\tif( instance_key < 0 ) {\n" );
+	PrintSetErrorValue( 2, program, proc, "instance_key" );
+	trace( 2, program, proc, NULL, 0 );
+	O( "\t\treturn &rv;\n" );
+	O( "\t}\n\n" );
+
+	// get the instance
+	O( "\t// get the instance\n" );
+	O( "\tsession = iComponentManager->GetInstance( instance_key );\n" );
+	O( "\tassert( session != NULL );\n" );
+	O( "\n" );
+
+	// call the corresponding method on the instance
+	PrintCallFromServiceStubToInstance( program, proc, NULL );
+
+	// now extract the top level error code
+	integer_return_type = IsSetErrorCallRequired( proc );
+	if( integer_return_type == 0 ) {
+		f_print( fout, "\tresult = rv;\n" );
+	} else {
+		f_print( fout, "\tresult = %s::GetError( %s, (void*)&rv );\n", ServiceManagerClassname(program), proc->proc_name );
+	}
+	O( "\n" );
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	O( "\t// if the method fails then we cleanup the instance -- otherwise we set the instance key\n" );
+	O( "\t// as the return value\n" );
+	O( "\tif( result != ERR_NONE ) {\n" );
+	O( "\t\tinternal_err = iComponentManager->DeleteInstance( instance_key );\n" );
+	O( "\t\tassert( internal_err == 0 );\n" );
+	O( "\t} else { \n" );
+	PrintSetErrorValue( 2, program, proc, "instance_key" );
+	O( "\t}\n" );
+	O( "\n" );
+
+	// done
+	f_print( fout, "\t// done\n" );
+	trace( 1, program, proc, NULL, 0 );
+	f_print( fout, "\treturn &rv;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (DSTR METHODS)
+ *
+ ********************************************************************/
+void output_dstr_proc_service_implementation( definition *program, proc_list *proc )
+{
+	int integer_return_type;
+
+	// start
+	f_print( fout, "{\n" );
+
+	// declare variables
+	f_print( fout, "\tstatic " );
+	ptype( proc->res_prefix, proc->res_type, 1 );
+	f_print( fout, "rv;\n" );
+	f_print( fout, "\tint result;\n" );
+	f_print( fout, "\tint internal_err;\n" );
+	f_print( fout, "\tint instance_key;\n" );
+	f_print( fout, "\tint should_delete = 1;\n" );
+	f_print( fout, "\t%s *session;\n\n", ComponentClassname(program) );
+	trace( 1, program, proc, NULL, 1 );
+	
+	// check that the service is already started
+	PrintServiceCheck( program, proc );
+
+	// get the key for the instance from the args
+	O( "\t// get the key for the instance from the args\n" );
+	f_print( fout, "\tinstance_key = %s::GetInstanceKeyFromArgs( %s, (void*)aArgs );\n", ServiceManagerClassname(program), proc->proc_name );
+	O( "\tif( instance_key < 0 ) {\n" );
+	PrintSetErrorValue( 2, program, proc, "instance_key" );
+	trace( 2, program, proc, NULL, 0 );
+	O( "\t\treturn &rv;\n" );
+	O( "\t}\n" );
+
+	// make sure the key is valid
+	O( "\t// make sure the key is valid\n" );
+	O( "\tif( iComponentManager->IsValidKey(instance_key) == 0 ) {\n" );		
+	PrintSetErrorValue( 2, program, proc, "ERR_INSTANCE_DOES_NOT_EXIST" );
+	O( "\t\treturn &rv;\n" );
+	O( "\t}\n" );
+	O( "\n" );
+
+	// get the instance
+	O( "\t// get the instance\n" );
+	O( "\tsession = iComponentManager->GetInstance( instance_key );\n" );
+	O( "\tassert( session != NULL );\n" );
+	O( "\n" );
+
+	// call the corresponding method on the instance
+	PrintCallFromServiceStubToInstance( program, proc, "&should_delete" );
+	O( "\n" );
+
+	// now extract the top level error code
+	integer_return_type = IsSetErrorCallRequired( proc );
+	if( integer_return_type == 0 ) {
+		f_print( fout, "\tresult = rv;\n" );
+	} else {
+		f_print( fout, "\tresult = %s::GetError( %s, (void*)&rv );\n", ServiceManagerClassname(program), proc->proc_name );
+	}
+	O( "\n" );
+
+	// it is illegal for the method to succeed but not delete the instance
+	O( "\t// it is illegal for the method to succeed but not delete the instance\n" );	
+	O( "\tassert( (result != ERR_NONE) || (should_delete == 1) );\n\n" );
+
+	// delete the instance if requested
+	O( "\t// delete the instance if requested\n" );
+	O( "\tif( should_delete != 0 ) {\n" );
+	O( "\t\tinternal_err = iComponentManager->DeleteInstance( instance_key );\n" );
+	O( "\t\tassert( internal_err == ERR_NONE );\n" );
+	O( "\t}\n\n" );
+
+	// done
+	f_print( fout, "\t// done\n" );
+	trace( 1, program, proc, NULL, 0 );
+	f_print( fout, "\treturn &rv;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (STARTUP METHODS)
+ *
+ ********************************************************************/
+void output_startup_proc_service_implementation( definition *program, proc_list *proc )
+{
+	// check the function's signature
+	if( strcmp(proc->res_type,"int") != 0 ) {
+		fprintf( stderr, "ERROR: 'SS_' method has the incorrect return type. Must be 'int'.\n" );
+	}
+
+	// start
+	f_print( fout, "{\n" );
+
+	// declare variables
+	f_print( fout, "\tstatic int rv;\n" );
+	trace( 1, program, proc, NULL, 1 );
+
+	// check that the service isn't already started
+	f_print( fout, "\n" );
+	f_print( fout, "\t// if the service is already started then return an error\n" );
+	f_print( fout, "\tif( iComponentManager != NULL ) {\n" );
+	f_print( fout, "\t\trv = ERR_SERVICE_ALREADY_STARTED;\n" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t\treturn &rv;\n" );
+	f_print( fout, "\t}\n" );
+
+	// create the component manager
+	f_print( fout, "\n" );
+	f_print( fout, "\t// create the component manager\n" );
+	f_print( fout, "\tiComponentManager = new CComponentManager<%s>( INFO_MAXIMUM_OBJECTS );\n", ComponentClassname(program) );
+	f_print( fout, "\tif( iComponentManager == NULL ) {\n" );
+	f_print( fout, "\t\trv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;\n" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t\treturn &rv;\n" );
+	f_print( fout, "\t}\n" );
+
+	// call the service manager
+	f_print( fout, "\n" );
+	f_print( fout, "\t// call the custom service manager\n" );
+	f_print( fout, "\trv = %s::StartRPCService( iComponentManager, aArgs );\n", ServiceManagerClassname(program) );
+	f_print( fout, "\tif( rv != ERR_NONE ) {\n" );
+	f_print( fout, "\t\tdelete iComponentManager;\n" );
+	f_print( fout, "\t\tiComponentManager = NULL;\n" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t\treturn &rv;\n" );
+	f_print( fout, "\t}\n" );
+
+	// done
+	f_print( fout, "\n" );
+	f_print( fout, "\t// success\n" );
+	f_print( fout, "\trv = ERR_NONE;\n" );
+	trace( 1, program, proc, NULL, 0 );
+	f_print( fout, "\treturn &rv;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (SHUTDOWN METHODS)
+ *
+ ********************************************************************/
+void output_shutdown_proc_service_implementation( definition *program, proc_list *proc )
+{
+	// check the function's signature
+	if( strcmp(proc->res_type,"int") != 0 ) {
+		fprintf( stderr, "ERROR: 'SC_' method has the incorrect return type. Must be 'int'.\n" );
+	}
+	if( strcmp(proc->arg_type,"int") != 0 ) {
+		fprintf( stderr, "ERROR: 'SC_' method has the incorrect argument type. Must be 'int'.\n" );
+	}
+
+	// start
+	f_print( fout, "{\n" );
+
+	// declare variables
+	f_print( fout, "\tstatic int rv;\n" );
+	f_print( fout, "\tint instance_count;\n" );
+	f_print( fout, "\tint err;\n" );
+	trace( 1, program, proc, NULL, 1 );
+	f_print( fout, "\n" );
+	
+	// check that the service is already started
+	PrintServiceCheck( program, proc );
+
+	// check for active sessions
+	f_print( fout, "\t// if there are active sessions and the force flag isn't set then return an error\n" );
+	f_print( fout, "\tinstance_count = iComponentManager->GetInstanceCount();\n" );
+	f_print( fout, "\tif( (instance_count > 0) && (*aArgs == 0) ) {\n" );
+	f_print( fout, "\t\trv = ERR_ACTIVE_USER_SESSIONS;\n" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t\treturn &rv;\n" );
+	f_print( fout, "\t};\n" );
+
+	f_print( fout, "\n" );
+	f_print( fout, "\t// if the force flag IS set then reset all active connections\n" );
+	f_print( fout, "\tinstance_count = iComponentManager->GetInstanceCount();\n" );
+	f_print( fout, "\tif( instance_count > 0 ) {\n" );
+	f_print( fout, "\t\terr = iComponentManager->DeleteAllInstances();\n" );
+	f_print( fout, "\t\tif( err != 0 ) {\n" ); 
+	f_print( fout, "\t\t\trv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;\n" );
+	trace( 3, program, proc, NULL, 0 );
+	f_print( fout, "\t\t\treturn &rv;\n" );
+	f_print( fout, "\t\t}\n" );
+	f_print( fout, "\t}\n" );
+
+	// call the service manager
+	f_print( fout, "\n" );
+	f_print( fout, "\t// call the custom service manager\n" );
+	f_print( fout, "\trv = %s::StopRPCService();\n", ServiceManagerClassname(program) );
+	f_print( fout, "\tif( rv != ERR_NONE ) {\n" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t\treturn &rv;\n" );
+	f_print( fout, "\t}\n" );
+	
+	// delete the component manager
+	f_print( fout, "\n" );
+	f_print( fout, "\t// delete the component manager\n" );
+	f_print( fout, "\tdelete iComponentManager;\n" );
+	f_print( fout, "\tiComponentManager = NULL;\n" );
+
+	// done
+	f_print( fout, "\n" );
+	f_print( fout, "\t// success\n" );
+	f_print( fout, "\trv = ERR_NONE;\n" );
+	trace( 1, program, proc, NULL, 0 );
+	f_print( fout, "\treturn &rv;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Stub Implementation -- METHOD GENERATION (LIST METHODS)
+ *
+ ********************************************************************/
+void output_list_proc_service_implementation( definition *program, proc_list *proc )
+{
+	int void_return_type = 0;
+
+	// check that the signature is correct
+	if( strcmp(proc->res_type,"TComponentList") != 0 ) {
+		fprintf( stderr, "ERROR: 'LIST_' method has incorrect return type. Must be TComponentList.\n" );
+		return;
+	}
+	if( strcmp(proc->arg_type,"void") != 0 ) {
+		fprintf( stderr, "ERROR: 'LIST_' method has incorrect argument type. Must be void.\n" );
+		return;
+	}
+
+	// start
+	f_print( fout, "{\n" );
+
+	// check for void return value
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_return_type = 1;
+	}
+
+	// declare variables
+	f_print( fout, "\tstatic " );
+	if( void_return_type == 0 ) {
+		ptype( proc->res_prefix, proc->res_type, 1 );
+	} else {
+		f_print( fout, "int " );
+	}	
+	f_print( fout, "rv;\n");
+	f_print( fout, "\tint i, valid_count, component_instance_count;\n" );
+	f_print( fout, "\n" );
+	trace( 1, program, proc, NULL, 1 );
+
+	// free any allocate memory
+	O( "\t//free any allocated memory\n" );
+	O( "\tif( rv.TComponentList_val != NULL ) {\n" );
+	O( "\t\tfree( rv.TComponentList_val );\n" );
+	O( "\t\trv.TComponentList_val = NULL;\n" );
+	O( "\t\trv.TComponentList_len = 0;\n" );
+	O( "\t}\n" );
+	O( "\n" );
+
+	// check that the service is already started
+	PrintServiceCheck( program, proc );
+
+	// set the return value to generic error
+	O( "\t// set the return value to generic error\n" );
+	PrintSetErrorValue( 1, program, proc, "ERR_FAILED_TO_RETRIEVE_KEY" );
+	f_print( fout, "\n" );
+
+	// get the number of active component instances
+	O( "\t// get the number of active component instances\n" );
+	O( "\tcomponent_instance_count = iComponentManager->GetInstanceCount();\n" );
+	O( "\n" );
+	O( "\t// if there are one or more instances then allocate the memory\n" );
+	O( "\tif( component_instance_count > 0 ) {\n" );
+	O( "\t\trv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );\n" );
+	O( "\t\tassert( rv.TComponentList_val != NULL );\n" );
+	O( "\t\trv.TComponentList_len = component_instance_count;\n" );
+	O( "\t}\n" );
+	O( "\n" );
+
+	// set the values
+	O( "\t// store all the currently active IDs in the list\n" );
+	O( "\tfor( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {\n" );
+	O( "\t\tif( iComponentManager->IsValidKey(i) != 0 ) {\n" );
+	O( "\t\t\tassert( valid_count < component_instance_count );\n" );
+	O( "\t\t\t(rv.TComponentList_val)[valid_count++] = i;\n" );
+	O( "\t\t}\n" );
+	O( "\t}\n" );
+	O( "\n" );
+
+	// ok finish up
+	O( "\t// ok return everything\n" );
+	f_print( fout, "\treturn &rv;\n" );
+	f_print( fout, "}\n" );
+}
+
+/*********************************************************************
+ *
+ * SECTION: Service Manager Definition (HEADER FILE)
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * Service Manager Definition -- START
+ *
+ ********************************************************************/
+void output_header_svc_header( char *filename, definition *program )
+{
+	char cname[256];
+
+	// output the autogen banner
+	PrintAutogenModBanner( filename );
+	PrintStartDefs( program );
+
+	// output the local includes
+	PrintBanner( "Local Includes" );
+	PrintIncludeInterfaceHeader();
+	f_print( fout, "#include \"%s.h\"\n", ComponentClassname(program) );
+	f_print( fout, "#include \"CComponentManager.h\"\n" );
+
+	// output the definition banner
+	sprintf( cname, "Definition: %s", ServiceManagerClassname(program) );
+	PrintBanner( cname );
+
+	// output the definition 
+	f_print( fout, "class %s\n{\n", ServiceManagerClassname(program) );
+	f_print( fout, "public:\n" );
+	f_print( fout, "\t/* standard methods */\n" );
+	f_print( fout, "\tstatic int GetInstanceKeyFromArgs( int aMethod, void *aArgs );\n" );
+	f_print( fout, "\tstatic int SetError( int aMethod, void *aArgs, int aError );\n" );
+	f_print( fout, "\tstatic int GetError( int aMethod, void *aArgs );\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Manager Definition -- END
+ *
+ ********************************************************************/
+void output_footer_svc_header( definition *program )
+{
+	f_print( fout, "};\n" );
+	PrintEndDefs( program );
+}
+
+
+/*********************************************************************
+ *
+ * Service Manager Definition -- METHOD GENERATION
+ *
+ ********************************************************************/
+void output_proc_svc_header( definition *program, proc_list *proc, char *version )
+{
+	static int custom_comment_written = 0;
+
+	// the StartRPCService function takes the argument to the SS_ function.
+	if( strncmp(proc->proc_name,"SS_",3) == 0 ) {
+		f_print( fout, "\tstatic int StartRPCService( CComponentManager<%s> *aComponentManager, %s *aArg );\n", ComponentClassname(program), proc->arg_type );
+	}
+
+	// the StopRPCService function takes no params
+	if( strncmp(proc->proc_name,"SC_",3) == 0 ) {
+		f_print( fout, "\tstatic int StopRPCService();\n" );
+	}
+
+	// print the header for any static methods
+	if( strncmp(proc->proc_name,"ST_",3) == 0 ) {
+		if( custom_comment_written == 0 ) {
+			f_print( fout, "\n\t/* custom methods */\n" );
+			custom_comment_written = 1;
+		}
+		f_print( fout, "\tstatic " );
+		PrintComponentInstanceMethodSignature( NULL, program, proc );
+		f_print( fout, ";\n" );
+	}
+}
+
+
+/*********************************************************************
+ *
+ * SECTION: Service Manager Implementation (CPP FILE)
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * Service Manager Implementation -- START
+ *
+ ********************************************************************/
+void output_header_svc_cpp( char *filename, definition *program )
+{
+	proc_list *proc;
+
+	// output the autogen banner
+	PrintAutogenModBanner( filename );
+
+	// output the system includes
+	PrintBanner( "System Includes" );
+	f_print( fout, "#include <stdio.h>\n" );
+
+	// output the local includes
+	PrintBanner( "Local Includes" );
+	f_print( fout, "#include \"%s.h\"\n", ServiceManagerClassname(program) );
+	PrintIncludeInterfaceHeader();
+
+	// file-scope statics
+	PrintBanner( "File-scope variables" );
+	f_print( fout, "static CComponentManager<%s> *iComponentManager;\n", ComponentClassname(program) );
+
+	// output the implementation banner
+	PrintBanner( "Implementation" );
+
+	// output GetInstanceKeyFromArgs
+	PrintBanner( "PUBLIC: GetInstanceKeyFromArgs" );
+	f_print( fout, "int %s::GetInstanceKeyFromArgs( int aMethod, void *aArgs )\n", ServiceManagerClassname(program) );
+	f_print( fout, "{\n" );
+	f_print( fout, "\tint rv;\n" );
+	trace( 1, program, NULL, "GetInstanceKeyFromArgs", 1 );
+	f_print( fout, "\tswitch( aMethod ) {\n" );
+	for( proc = (program->def.pr.versions)->procs; proc != NULL; proc = proc->next ) {
+		if( strncmp(proc->proc_name,"SS_",3) != 0 ) {
+			if( strncmp(proc->proc_name,"SC_",3) != 0 ) {
+				if( strncmp(proc->proc_name,"LIST_",5) != 0 ) {
+					if( strncmp(proc->proc_name,"CSTR_",5) != 0 ) {
+						if( strncmp(proc->proc_name,"ST_",3) != 0 ) {
+							f_print( fout, "\tcase %s:\n", proc->proc_name );
+						}
+					}
+				}
+			}
+		}
+	}
+	f_print( fout, "\tdefault:\n" );
+	f_print( fout, "\t\trv = ERR_INVALID_METHOD;\n" );
+	f_print( fout, "\t\tbreak;\n" );
+	f_print( fout, "\t}\n" );
+	trace( 1, program, NULL, "GetInstanceKeyFromArgs", 0 );
+	f_print( fout, "\treturn rv;\n" );
+	f_print( fout, "}\n" );
+
+	// output SetError
+	PrintBanner( "PUBLIC: SetError" );
+	f_print( fout, "int %s::SetError( int aMethod, void *aArgs, int aError )\n", ServiceManagerClassname(program) );
+	f_print( fout, "{\n" );
+	f_print( fout, "\tint rv;\n" );
+	trace( 1, program, NULL, "SetError", 1 );
+	f_print( fout, "\tswitch( aMethod ) {\n" );
+	for( proc = (program->def.pr.versions)->procs; proc != NULL; proc = proc->next ) {
+		if( IsSetErrorCallRequired(proc) ) {
+			f_print( fout, "\tcase %s:\n", proc->proc_name );
+		}
+	}
+	f_print( fout, "\tdefault:\n" );
+	f_print( fout, "\t\trv = ERR_INVALID_METHOD;\n" );
+	f_print( fout, "\t\tbreak;\n" );
+	f_print( fout, "\t}\n" );
+	trace( 1, program, NULL, "SetError", 0 );
+	f_print( fout, "\treturn rv;\n" );
+	f_print( fout, "}\n" );
+
+	// output GetError
+	PrintBanner( "PUBLIC: GetError" );
+	f_print( fout, "int %s::GetError( int aMethod, void *aArgs )\n", ServiceManagerClassname(program) );
+	f_print( fout, "{\n" );
+	f_print( fout, "\tint rv = ERR_NONE;\n" );
+	trace( 1, program, NULL, "GetError", 1 );
+	f_print( fout, "\tswitch( aMethod ) {\n" );
+	for( proc = (program->def.pr.versions)->procs; proc != NULL; proc = proc->next ) {
+		if( IsSetErrorCallRequired(proc) ) {
+			f_print( fout, "\tcase %s:\n", proc->proc_name );
+		}
+	}
+	f_print( fout, "\tdefault:\n" );
+	f_print( fout, "\t\tassert( \"!INVALID CALL\" );\n" );
+//	f_print( fout, "\t\trv = ERR_INVALID_METHOD;\n" );
+	f_print( fout, "\t\tbreak;\n" );
+	f_print( fout, "\t}\n" );
+	trace( 1, program, NULL, "GetError", 0 );
+	f_print( fout, "\treturn rv;\n" );
+	f_print( fout, "}\n" );
+
+}
+
+
+/*********************************************************************
+ *
+ * Service Manager Implementation -- END
+ *
+ ********************************************************************/
+void output_footer_svc_cpp( definition *program )
+{
+}
+
+
+/*********************************************************************
+ *
+ * Service Manager Implementation -- METHOD GENERATION
+ *
+ ********************************************************************/
+void output_proc_svc_cpp( definition *program, proc_list *proc, char *version )
+{
+	int void_return_type = 0;
+	char str[512];
+
+	// output StartService
+	if( strncmp(proc->proc_name,"SS_",3) == 0 ) {
+		PrintBanner( "PUBLIC: StartRPCService" );
+		f_print( fout, "int %s::StartRPCService( CComponentManager<%s> *aComponentManager, %s *aArg )\n", ServiceManagerClassname(program), ComponentClassname(program), proc->arg_type );
+		f_print( fout, "{\n" );
+		trace( 1, program, NULL, "StartRPCService", 1 );
+		f_print( fout, "\tassert( iComponentManager == NULL );\n" );
+		f_print( fout, "\tiComponentManager = aComponentManager;\n" );
+		trace( 1, program, NULL, "StartRPCService", 0 );
+		f_print( fout, "\treturn ERR_NONE;\n" );
+		f_print( fout, "}\n" );
+	}
+
+	// output StopRPCService
+	if( strncmp(proc->proc_name,"SC_",3) == 0 ) {
+		PrintBanner( "PUBLIC: StopRPCService" );
+		f_print( fout, "int %s::StopRPCService()\n", ServiceManagerClassname(program) );
+		f_print( fout, "{\n" );
+		trace( 1, program, NULL, "StopRPCService", 1 );
+		f_print( fout, "\tiComponentManager = NULL;\n" );
+		trace( 1, program, NULL, "StopRPCService", 0 );
+		f_print( fout, "\treturn ERR_NONE;\n" );
+		f_print( fout, "}\n" );
+	}
+
+	// if this isn't a static method then exit
+	if( strncmp(proc->proc_name,"ST_",3) != 0 ) {
+		return;
+	}
+
+	// print banner
+	_snprintf( str, 512, "PUBLIC: %s", locase(proc->proc_name) );
+	PrintBanner( str );
+
+	// print the function signature
+	PrintComponentInstanceMethodSignature( ServiceManagerClassname(program), program, proc );
+	f_print( fout, "\n");
+
+	// check if the returntype is void
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_return_type = 1;
+	}
+
+	// open the function
+	f_print( fout, "{\n" );
+
+	// declare the return value
+	if( void_return_type == 0 ) {
+		f_print( fout, "\t" );
+		ptype( proc->res_prefix, proc->res_type, 1 );
+		f_print( fout, "rv;\n" );
+		trace( 1, program, proc, NULL, 1 );
+		PrintSetErrorValue( 1, program, proc, "ERR_NONE" );
+	} else {
+		trace( 1, program, proc, NULL, 1 );
+	}
+
+	// return the value
+	trace( 1, program, proc, NULL, 0 );
+	if( void_return_type == 0 ) {
+		f_print( fout, "\treturn rv;\n" );
+	}
+
+	// close the function
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * SECTION: Service Component Definition (HEADER FILE)
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * Service Component Definition - START
+ *
+ ********************************************************************/
+void output_header_inst_header( char *filename, definition *program )
+{
+	char cname[256];
+
+	// output the file banner
+	PrintAutogenModBanner( filename );
+	PrintStartDefs( program );
+
+	// output the local includes
+	PrintBanner( "Local Includes" );
+	PrintIncludeInterfaceHeader();
+
+	// output the definition banner
+	sprintf( cname, "Definition: %s", ComponentClassname(program) );
+	PrintBanner( cname );
+
+	// output the definition 
+	f_print( fout, "class %s\n{\n", ComponentClassname(program) );
+	f_print( fout, "public:\n" );
+	f_print( fout, "\t// Standard Methods\n" );
+	f_print( fout, "\t%s();\n", ComponentClassname(program) );
+	f_print( fout, "\t~%s();\n", ComponentClassname(program) );
+	f_print( fout, "\tint GetKey();\n" );
+	f_print( fout, "\tvoid SetKey( int aKey );\n" );
+	f_print( fout, "\n" );
+	f_print( fout, "\t// RPC Service Methods\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Component Definition - END
+ *
+ ********************************************************************/
+void output_footer_inst_header( definition *program )
+{
+	f_print( fout, "\n" );
+	f_print( fout, "private:\n" );
+	f_print( fout, "\tint iKey;\n" );
+	f_print( fout, "};\n" );
+	PrintEndDefs( program );
+}
+
+
+/*********************************************************************
+ *
+ * Service Component Definition - METHOD GENERATION
+ *
+ ********************************************************************/
+void output_proc_inst_header( definition *program, proc_list *proc, char *version )
+{
+	// ss and sc methods aren't included in the component
+	if( strncmp(proc->proc_name,"SS_",3) == 0 ) {
+		return;
+	}
+	if( strncmp(proc->proc_name,"SC_",3) == 0 ) {
+		return;
+	}
+	if( strncmp(proc->proc_name,"LIST_",5) == 0 ) {
+		return;
+	}
+	if( strncmp(proc->proc_name,"ST_",3) == 0 ) {
+		return;
+	}
+	// print the function signature
+	f_print( fout, "\t" );
+	PrintComponentInstanceMethodSignature( NULL, program, proc );
+	f_print( fout, ";\n" );
+}
+
+
+/*********************************************************************
+ *
+ * SECTION: Service Component Implementation 
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * Service Component Implementation - START
+ *
+ ********************************************************************/
+void output_header_inst_cpp( char *filename, definition *program )
+{
+	// output the system includes
+	PrintAutogenModBanner( filename );
+	PrintFileBanner( "System Includes" );
+	f_print( fout, "#include <stdio.h>\n" );
+
+	// output the local includes
+	PrintBanner( "Local Includes" );
+	f_print( fout, "#include \"%s.h\"\n", ServiceManagerClassname(program) );
+	f_print( fout, "#include \"%s.h\"\n", ComponentClassname(program) );
+
+	// output the implementation banner
+	PrintBanner( "Implementation" );
+
+	// output the impl for the constructor
+	f_print( fout, "%s::%s()\n", ComponentClassname(program), ComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "Constructor", 1 );
+	trace( 1, program, NULL, "Constructor", 0 );
+	f_print( fout, "}\n\n" );
+
+	// output the impl for the destructor
+	f_print( fout, "%s::~%s()\n", ComponentClassname(program), ComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "Destructor", 1 );
+	trace( 1, program, NULL, "Destructor", 0 );
+	f_print( fout, "}\n\n" );
+
+	// output the impl for get key
+	f_print( fout, "int %s::GetKey()\n", ComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "GetKey", 1 );
+	trace( 1, program, NULL, "GetKey", 0 );
+	f_print( fout, "\treturn iKey;\n" );
+	f_print( fout, "}\n\n" );
+
+	// output the impl for set key
+	f_print( fout, "void %s::SetKey( int aKey )\n", ComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "SetKey", 1 );
+	f_print( fout, "\tiKey = aKey;\n" );
+	trace( 1, program, NULL, "SetKey", 0 );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Service Component Implementation - END
+ *
+ ********************************************************************/
+void output_footer_inst_cpp( definition *program )
+{
+}
+
+
+/*********************************************************************
+ *
+ * Service Component Implementation - METHOD GENERATION
+ *
+ ********************************************************************/
+void output_proc_inst_cpp( definition *program, proc_list *proc, char *version )
+{
+	char str[256];
+	int void_return_type = 0;
+
+	// ss and sc methods aren't included in the component
+	if( strncmp(proc->proc_name,"SS_",3) == 0 ) {
+		return;
+	}
+	if( strncmp(proc->proc_name,"SC_",3) == 0 ) {
+		return;
+	}
+	if( strncmp(proc->proc_name,"LIST_",5) == 0 ) {
+		return;
+	}
+	if( strncmp(proc->proc_name,"ST_",3) == 0 ) {
+		return;
+	}
+
+	// print banner
+	sprintf( str, "PUBLIC FUNCTION: %s", locase(proc->proc_name) );
+	PrintBanner( str );
+
+	// print the function signature
+	PrintComponentInstanceMethodSignature( ComponentClassname(program), program, proc );
+	f_print( fout, "\n");
+
+	// check if the returntype is void
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_return_type = 1;
+	}
+
+	// open the function
+	f_print( fout, "{\n" );
+
+	// declare the return value
+	if( void_return_type == 0 ) {
+		f_print( fout, "\t" );
+		ptype( proc->res_prefix, proc->res_type, 1 );
+		f_print( fout, "rv;\n" );
+		trace( 1, program, proc, NULL, 1 );
+		PrintSetErrorValue( 1, program, proc, "ERR_NONE" );
+	} else {
+		trace( 1, program, proc, NULL, 1 );
+	}
+
+	// return the value
+	trace( 1, program, proc, NULL, 0 );
+	if( void_return_type == 0 ) {
+		f_print( fout, "\treturn rv;\n" );
+	}
+
+	// close the function
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * SECTION - Client Stub Class Definition (HEADER FILE)
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * Client Stub Class Definition - START
+ *
+ ********************************************************************/
+void output_header_stub_header( char *filename, definition *program )
+{
+	char cname[256];
+
+	// output the file banner
+	PrintFileBanner( filename );
+	PrintStartDefs( program );
+
+	// output the system includes
+	PrintBanner( "System Includes" );
+	O( "#include <rpc/rpc.h>\n" );
+	O( "#include <string>\n" );
+	O( "using namespace std;\n" );
+	PrintIncludeInterfaceHeader();
+
+	// output the definition banner
+	sprintf( cname, "Definition: %s", ClientComponentClassname(program) );
+	PrintBanner( cname );
+
+	// output the definition 
+	f_print( fout, "class %s\n{\n", ClientComponentClassname(program) );
+	f_print( fout, "public:\n" );
+	f_print( fout, "\t// standard methods\n" );
+	f_print( fout, "\t%s();\n", ClientComponentClassname(program) );
+	f_print( fout, "\t~%s();\n", ClientComponentClassname(program) );
+	f_print( fout, "\tint Connect( string aRemoteHost );\n" );
+	f_print( fout, "\tint Disconnect();\n" );
+	f_print( fout, "\tchar *GetLastRPCError( int *aIntErr );\n" );
+	f_print( fout, "\n" );
+	f_print( fout, "\t// service methods\n" );
+
+}
+
+/*********************************************************************
+ *
+ * Client Stub Class Definition - END
+ *
+ ********************************************************************/
+void output_footer_stub_header( definition *program )
+{
+	f_print( fout, "\n" );
+	f_print( fout, "private:\n" );
+	f_print( fout, "\tstruct rpc_err iLastRPCError;\n" );
+	f_print( fout, "\tCLIENT *cl;\n" );
+	f_print( fout, "};\n" );
+	PrintEndDefs( program );
+}
+
+
+/*********************************************************************
+ *
+ * Client Stub Class Definition - METHOD GENERATION
+ *
+ ********************************************************************/
+void output_proc_stub_header( definition *program, proc_list *proc, char *version )
+{
+	// Print the signature header
+	PrintClientStubSignature( 1, NULL, proc );
+	f_print( fout, ";\n" );
+}
+
+
+/*********************************************************************
+ *
+ * SECTION - Client Stub Class Implementation
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * Client Stub Class Implementation - START
+ *
+ ********************************************************************/
+void output_header_stub_cpp( char *filename, definition *program )
+{
+	version_list *vp;
+
+	// get the version info for use later 
+	vp = program->def.pr.versions;
+
+	// output the system includes
+	PrintFileBanner( "System Includes" );
+	O( "#include <stdio.h>\n" );
+	O( "#include <assert.h>\n" );
+	O( "#include <rpc/types.h>\n" );
+
+	// output the local includes
+	PrintBanner( "Local Includes" );
+	f_print( fout, "#include \"%s.h\"\n", ClientComponentClassname(program) );
+
+	// output the implementation banner
+	PrintBanner( "Implementation" );
+
+	// output the impl for the constructor
+	f_print( fout, "%s::%s()\n", ClientComponentClassname(program), ClientComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "Constructor", 1 );
+	f_print( fout, "\tcl = NULL;\n" );
+	f_print( fout, "\tiLastRPCError.re_status = RPC_SUCCESS;\n" );
+	trace( 1, program, NULL, "Constructor", 0 );
+	f_print( fout, "}\n\n" );
+
+	// output the impl for the destructor
+	f_print( fout, "%s::~%s()\n", ClientComponentClassname(program), ClientComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "Destructor", 1 );
+	f_print( fout, "\tassert( cl == NULL );\n" );
+	trace( 1, program, NULL, "Destructor", 0 );
+	f_print( fout, "}\n\n" );
+
+	// output the impl for getlastrpcerror
+	f_print( fout, "char *%s::GetLastRPCError( int *aIntErr )\n", ClientComponentClassname(program) );
+	f_print( fout, "{\n" );
+	f_print( fout, "\tstruct rpc_err rpcerr;\n" );
+	f_print( fout, "\n" );
+	trace( 1, program, NULL, "GetLastRPCError", 1 );
+	f_print( fout, "\t// check that the handle is valid\n" );
+	f_print( fout, "\tif( cl == NULL ) {\n" );
+	f_print( fout, "\t\treturn NULL;\n" );
+	f_print( fout, "\t}\n" );
+	f_print( fout, "\n" );
+	O( "\t// pass the aIntErr\n" );
+	O( "\tif( aIntErr != NULL ) {\n" );
+	O( "\t\tclnt_geterr( cl, &rpcerr );\n" );
+	O( "\t\t*aIntErr = rpcerr.re_status;\n" );
+	O( "\t}\n" );
+	O( "\n" );
+	O( "\t// return the errorstring\n" );
+	trace( 1, program, NULL, "GetLastRPCError", 0 );
+	O( "\treturn clnt_sperror( cl, NULL );\n" );
+	O( "}\n" );
+	f_print( fout, "\n" );
+
+	// output the impl for connect
+	f_print( fout, "int %s::Connect( string aRemoteHost )\n", ClientComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "Connect", 1 );
+	f_print( fout, "\t// check that we are not already connected\n" );
+	f_print( fout, "\tif( cl != NULL ) {\n" );
+	trace( 2, program, NULL, "Connect", 0 );
+	f_print( fout, "\t\treturn ERR_STUB_ALREADY_CONNECTED;\n" );
+	f_print( fout, "\t}\n" );
+	f_print( fout, "\n" );
+	f_print( fout, "\t// start the rpc library\n" );
+	f_print( fout, "\trpc_nt_init();\n" );
+	f_print( fout, "\n" );
+	f_print( fout, "\t// connect to the service\n" );
+	f_print( fout, "\tcl = clnt_create( aRemoteHost.c_str(), %s, %s, \"tcp\" );\n", program->def_name, vp->vers_name );
+	f_print( fout, "\tif( cl == NULL ) {\n" );
+	f_print( fout, "\t\trpc_nt_exit();\n" );
+	trace( 2, program, NULL, "Connect", 0 );
+	f_print( fout, "\t\treturn ERR_FAILED_TO_CONNECT;\n" );
+	f_print( fout, "\t}\n" );
+	f_print( fout, "\n" );
+	f_print( fout, "\t// done\n" );
+	trace( 1, program, NULL, "Connect", 0 );
+	f_print( fout, "\treturn ERR_NONE;\n" );
+	f_print( fout, "}\n\n" );
+
+	// output the impl for disconnect
+	f_print( fout, "int %s::Disconnect( )\n", ClientComponentClassname(program) );
+	f_print( fout, "{\n" );
+	trace( 1, program, NULL, "Disconnect", 1 );
+	f_print( fout, "\t// check that we are connected\n" );
+	f_print( fout, "\tif( cl == NULL ) {\n" );
+	trace( 2, program, NULL, "Disconnect", 0 );
+	f_print( fout, "\t\treturn ERR_STUB_NOT_CONNECTED;\n" );
+	f_print( fout, "\t}\n" );
+	f_print( fout, "\n" );
+	f_print( fout, "\t// cleanup the client handle\n" );
+	f_print( fout, "\tclnt_destroy( cl );\n" );
+	f_print( fout, "\tcl = NULL;\n" );
+	f_print( fout, "\trpc_nt_exit();\n" );
+	f_print( fout, "\n" );
+	f_print( fout, "\t// done\n" );
+	trace( 1, program, NULL, "Disconnect", 0 );
+	f_print( fout, "\treturn ERR_NONE;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+/*********************************************************************
+ *
+ * Client Stub Class Implementation - END
+ *
+ ********************************************************************/
+void output_footer_stub_cpp( definition *program )
+{
+}
+
+
+/*********************************************************************
+ *
+ * Client Stub Class Implementation - METHOD GENERATION
+ *
+ ********************************************************************/
+void output_proc_stub_cpp( definition *program, proc_list *proc, char *version )
+{
+	char str[256];
+	//	int void_return_type = 0;
+
+	// ss and sc methods aren't included in the component
+//	if( strncmp(proc->proc_name,"SS_",3) == 0 ) {
+//		return;
+//	}
+//	if( strncmp(proc->proc_name,"SC_",3) == 0 ) {
+//		return;
+//	}
+
+	// print banner
+	sprintf( str, "PUBLIC FUNCTION: %s", locase(proc->proc_name) );
+	PrintBanner( str );
+
+	// print the function signature
+	sprintf( str, "%s", ClientComponentClassname(program) );
+	PrintClientStubSignature( 0, str, proc );
+	f_print( fout, "\n" );
+
+	// print the body
+	output_proc_stub_cpp_std( program, proc, version );
+}
+
+
+void output_proc_stub_cpp_std( definition *program, proc_list *proc, char *version )
+{
+	int void_return_value = 0;
+	int void_arg_type = 0;
+	version_list *vp = program->def.pr.versions;
+
+	// open the body
+	f_print( fout, "{\n" );
+
+	// find out if we have a void return value
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_return_value = 1;
+	}
+
+	// find out if we have a void arg, if so then declare a dummy arg
+	f_print( fout, "\tstruct rpc_err rerr;\n" );
+	if( strncmp(proc->arg_type,"void",4) == 0 ) {
+		void_arg_type = 1;
+		f_print( fout, "\tint aArgs = 0;\n" );
+	}
+	f_print( fout, "\n" );
+	trace( 1, program, proc, NULL, 1 );
+
+	// check the rv (if needed)
+	if( void_return_value == 0 ) {
+		f_print( fout, "\t// check the rv pointer\n" );
+		f_print( fout, "\tif( rv == NULL ) {\n" );
+		trace( 2, program, proc, NULL, 0 );
+		f_print( fout, "\t\treturn ERR_INVALID_RV_POINTER;\n" );
+		f_print( fout, "\t}\n" );
+		f_print( fout, "\n" );
+	}
+
+	// check that we are connected
+	f_print( fout, "\t// check that we have a connection\n" );
+	f_print( fout, "\tif( cl == NULL ) {\n" );
+	f_print( fout, "\t\treturn ERR_STUB_NOT_CONNECTED;\n" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t}\n" );
+	f_print( fout, "\n" );
+
+	// do the call
+	f_print( fout, "\t// do the call\n\t" );
+	if( void_return_value == 0 ) {
+		f_print( fout, "*rv = *" );
+	}
+	f_print( fout, "%s_%s( &aArgs, cl );\n", locase(proc->proc_name), vp->vers_num );
+	f_print( fout, "\n" );
+
+	// check for rpc errors and return the result
+	f_print( fout, "\t// check for rpc errors and return the result\n" );
+	f_print( fout, "\tclnt_geterr( cl, &rerr );\n" );
+	f_print( fout, "\tif( rerr.re_status != RPC_SUCCESS ) {\n" );
+	f_print( fout, "\t\tiLastRPCError = rerr;\n" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t\treturn ERR_RPC_ERROR;\n" );
+	f_print( fout, "\t}\n" );
+	trace( 1, program, proc, NULL, 0 );
+	f_print( fout, "\treturn ERR_NONE;\n" );
+	f_print( fout, "}\n" );
+}
+
+
+
+/*********************************************************************
+ *
+ * SECTION - HELPERS
+ *
+ ********************************************************************/
+
+/*********************************************************************
+ *
+ * HELPERS: Filename Related Code Generation
+ *
+ ********************************************************************/
+void PrintStartDefs( definition *def )
+{
+	char cstr[64];
+
+	// find the prefix
+	cstr[0] = 0;
+	if( gtype == TYPE_CLIENT_H ) {
+		sprintf( cstr, "CC" );
+	} else if( gtype == TYPE_INST_H ) {
+		sprintf( cstr, "CS" );
+	} else if( gtype == TYPE_SVC_MGR_H ) {
+		sprintf( cstr, "CSVC" );
+	}
+
+	// print the tags
+	f_print( fout, "#ifndef __%s%s_H__\n", cstr, ucase(def->def_name) );
+	f_print( fout, "#define __%s%s_H__\n", cstr, ucase(def->def_name) );
+}
+
+
+void PrintEndDefs( definition *def )
+{
+	f_print( fout, "\n#endif\n" ); 
+}
+
+
+void PrintIncludeInterfaceHeader()
+{
+	char *ptr, delim = 0;
+
+	// find the '.' in the input filename (.x) and set to null
+	ptr = strchr( input_filename, '.' );
+	if( ptr != NULL ) {
+		delim = *ptr;
+		*ptr = 0;
+	}
+
+	// print the line
+	f_print( fout, "#include \"%s.h\"\n", input_filename );
+
+	// put the dot back
+	if( delim != 0 ) {
+		*ptr = delim;
+	}
+}
+
+
+/*********************************************************************
+ *
+ * HELPERS: Classname Related Code Generation
+ *
+ ********************************************************************/
+char *ComponentClassname( definition *def )
+{
+	static char component_classname[256];
+	sprintf( component_classname, "CS%c%s", toupper(def->def_name[0]), locase(&(def->def_name[1])) );
+	return component_classname;
+}
+
+
+char *ClientComponentClassname( definition *def )
+{
+	static char component_classname[256];
+	sprintf( component_classname, "CC%c%s", toupper(def->def_name[0]), locase(&(def->def_name[1])) );
+	return component_classname;
+}
+
+
+char *ServiceManagerClassname( definition *def )
+{
+	static char service_manager_classname[256];
+	sprintf( service_manager_classname, "CSvc%c%s", toupper(def->def_name[0]), locase(&(def->def_name[1])) );
+	return service_manager_classname;
+}
+
+
+/*********************************************************************
+ *
+ * HELPERS: Function Related Code Generation
+ *
+ ********************************************************************/
+void PrintCallFromServiceStubToInstance( definition *program, proc_list *proc, char *extra_args )
+{
+	int void_arg_type = 0;
+	int void_res_type = 0;
+
+	// check for a void argument
+	if( strncmp(proc->arg_type,"void",4) == 0 ) {
+		void_arg_type = 1;
+	}
+
+	// check for a void ret
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_res_type = 1;
+	}
+
+	// print the comment
+	O( "\t// call the corresponding method on the instance\n\t" );
+
+	// only store the return value is the thing doesn't return void
+	if( void_res_type == 0 ) {
+		f_print( fout, "rv = " );
+	} else {
+		f_print( fout, "rv = ERR_NONE;\n\t" );
+	}
+
+	// print the method name and open the bracket
+	f_print( fout, "session->%s(", locase(proc->proc_name) );
+
+	// if we have more to print then put in a space
+	if( (void_arg_type == 0) || (extra_args != NULL) ) {
+		f_print( fout, " " );
+	}
+
+	// put in the args 
+	if( void_arg_type == 0 ) {
+		f_print( fout, "*aArgs" );
+		if( extra_args != NULL ) {
+			f_print( fout, "," );
+		}
+		f_print( fout, " " );
+	}
+
+	// put the extra args + space
+	if( extra_args != NULL ) {
+		f_print( fout, "%s ", extra_args );
+	}
+
+	// close up
+	f_print( fout, ");\n" );
+}
+
+
+void PrintCallFromServiceStubToStatic( definition *program, proc_list *proc, char *extra_args )
+{
+	int void_arg_type = 0;
+	int void_res_type = 0;
+
+	// check for a void argument
+	if( strncmp(proc->arg_type,"void",4) == 0 ) {
+		void_arg_type = 1;
+	}
+
+	// check for a void ret
+	if( strncmp(proc->res_type,"void",4) == 0 ) {
+		void_res_type = 1;
+	}
+
+	// print the comment
+	O( "\t// call the corresponding method on the instance\n" );
+
+	// only store the return value is the thing doesn't return void
+	if( void_res_type == 0 ) {
+		f_print( fout, "\trv = " );
+	} else {
+		f_print( fout, "\trv = ERR_NONE;\n\t" );
+	}
+
+	// print the method name and open the bracket
+	f_print( fout, "%s::", ServiceManagerClassname(program) );
+	f_print( fout, "%s(", locase(proc->proc_name) );
+
+	// if we have more to print then put in a space
+	if( (void_arg_type == 0) || (extra_args != NULL) ) {
+		f_print( fout, " " );
+	}
+
+	// put in the args 
+	if( void_arg_type == 0 ) {
+		f_print( fout, "*aArgs" );
+		if( extra_args != NULL ) {
+			f_print( fout, "," );
+		}
+		f_print( fout, " " );
+	}
+
+	// put the extra args + space
+	if( extra_args != NULL ) {
+		f_print( fout, "%s ", extra_args );
+	}
+
+	// close up
+	f_print( fout, ");\n" );
+}
+
+
+void PrintServiceCheck( definition *program, proc_list *proc )
+{
+	// check that the service is already started
+	f_print( fout, "\t// check that the service is started\n" );
+	f_print( fout, "\tif( iComponentManager == NULL ) {\n" );
+	PrintSetErrorValue( 2, program, proc, "ERR_SERVICE_NOT_RUNNING" );
+	trace( 2, program, proc, NULL, 0 );
+	f_print( fout, "\t\treturn &rv;\n" );
+	f_print( fout, "\t}\n\n" );
+}
+
+
+void PrintClientStubSignature( int indent, char *classname, proc_list *proc )
+{
+	int i;
+	int non_void_argument;
+
+	// indent
+	for( i = 0; i < indent; i++ ) {
+		f_print( fout, "\t" );
+	}
+
+	// print the function signature
+	f_print( fout, "int " );
+	
+	// print classname if defined
+	if( classname != NULL ) {
+		f_print( fout, "%s::", classname );
+	}
+	f_print( fout, "%s( ", locase(proc->proc_name) );
+
+	// only put in the arg if it isn't void
+	if( strncmp(proc->arg_type,"void",4) != 0 ) {
+		ptype( proc->arg_prefix, proc->arg_type, 1 );
+		f_print( fout, "aArgs" );
+		non_void_argument = 1;
+	}
+
+	// only put the return value if it is non-null
+	if( strncmp(proc->res_type,"void",4) != 0 ) {
+		if( non_void_argument == 1 ) {
+			f_print( fout, ", " );
+		}
+		ptype( proc->res_prefix, proc->res_type, 1 );
+		f_print( fout, "*rv " );
+	} else {
+		f_print( fout, " " );
+	}
+
+	// close the bracket
+	f_print( fout, ")" );
+}
+
+
+void PrintComponentInstanceMethodSignature( char *classname, definition *program, proc_list *proc )
+{
+	int void_arg_type = 0;
+	int i_am_a_destructor = 0;
+
+	// print the return type
+	ptype( proc->res_prefix, proc->res_type, 1 );
+
+	// now print the method name
+	if( classname != NULL ) {
+		f_print( fout, "%s::", classname );
+	}
+	f_print( fout, "%s( ", locase(proc->proc_name) );
+
+	// see if the arg is null
+	if( strncmp(proc->arg_type,"void",4) == 0 ) {
+		void_arg_type = 1;
+	}
+
+	// see if this is a destr
+	if( strncmp(proc->proc_name,"DSTR_",5) == 0 ) {
+		i_am_a_destructor = 1;
+	}
+
+	// if the rv is null and we are not a destructor then
+	if( (void_arg_type == 1) && (i_am_a_destructor == 1) ) {
+		f_print( fout, "int *aDeleteInstance " );
+	} else if( (void_arg_type == 0) && (i_am_a_destructor == 1) ) {
+		ptype( proc->arg_prefix, proc->arg_type, 1 );
+		f_print( fout, "aArgs, int *aDeleteInstance " );
+	} else if( (void_arg_type == 1) && (i_am_a_destructor == 0) ) {
+		f_print( fout, "void " );
+	} else if( (void_arg_type == 0) && (i_am_a_destructor == 0) ) {
+		ptype( proc->arg_prefix, proc->arg_type, 1 );
+		f_print( fout, "aArgs " );
+	}
+	f_print( fout, ")");
+}
+
+
+void PrintSetErrorValue( int indent, definition *program, proc_list *proc, char *error )
+{
+	int i;
+	int set_error_call_required = 0;
+
+	// check params
+	assert( program != NULL );
+	assert( proc != NULL );
+	assert( error != NULL );
+
+	// write the indent
+	for( i = 0; i < indent; i++ ) {
+		f_print( fout, "\t" );
+	}
+
+	// check if we need a set error call
+	set_error_call_required = IsSetErrorCallRequired( proc );
+
+	// if it is integral then we just do an assignment
+	if( set_error_call_required == 0 ) {
+		f_print( fout, "rv = %s;\n", error );
+	} else {
+		f_print( fout, "%s::SetError( %s, (void*)&rv, %s );\n", ServiceManagerClassname(program), proc->proc_name, error );
+	}
+
+	// done
+}
+
+
+int IsSetErrorCallRequired( proc_list *proc )
+{
+	int set_error_call_required = 1;
+
+	if( strncmp(proc->res_type,"int",3) == 0 ) {
+		set_error_call_required = 0;
+	} else if( strncmp(proc->res_type,"short",5) == 0 ) {
+		set_error_call_required = 0;
+	} else if( strncmp(proc->res_type,"long",4) == 0 ) {
+		set_error_call_required = 0;
+	} else if( strncmp(proc->res_type,"void",4) == 0 ) {
+		set_error_call_required = 0;
+	}
+
+	return set_error_call_required;
+}
+
+/*********************************************************************
+ *
+ * HELPERS: File Banners
+ *
+ ********************************************************************/
+void PrintAutogenBanner( char *filename )
+{
+	time_t ltime;
+
+	f_print( fout, "%s", BANNER_START );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%sTHIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly\n", BANNER_LINE );
+	f_print( fout, "%sas changes will be lost\n", BANNER_LINE );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s%s\n", BANNER_LINE, filename );
+	time( &ltime );
+	f_print( fout, "%s%s", BANNER_LINE, ctime(&ltime) );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s", BANNER_END );
+}
+
+void PrintAutogenModBanner( char *filename )
+{
+	time_t ltime;
+
+	f_print( fout, "%s", BANNER_START );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%sThis file was autogenerated by rpcgen, but should be modified by the developer.\n", BANNER_LINE );
+	f_print( fout, "%sMake sure you don't use the -component_mod flag in future or this file will be overwritten.\n", BANNER_LINE );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s%s\n", BANNER_LINE, filename );
+	time( &ltime );
+	f_print( fout, "%s%s", BANNER_LINE, ctime(&ltime) );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s", BANNER_END );
+}
+
+
+void PrintBanner( char *title )
+{
+	f_print( fout, "\n\n%s", BANNER_START );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s%s\n", BANNER_LINE, title );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s", BANNER_END );
+}
+
+
+void PrintFileBanner( char *filename )
+{
+	f_print( fout, "%s", BANNER_START );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s%s\n", BANNER_LINE, filename );
+	f_print( fout, "%s\n", BANNER_LINE );
+	f_print( fout, "%s", BANNER_END );
+}
+
+
+/*********************************************************************
+ *
+ * HELPERS: Miscellaneous Helpers
+ *
+ ********************************************************************/
+char *ucase( char *str )
+{
+	unsigned int i;
+	static char rstr[1024];
+	assert( strlen(str) < (1024 + 1) );
+	for( i = 0; i < strlen(str); i++ ) {
+		rstr[i] = toupper(str[i]);
+	}
+	rstr[i] = 0;
+	return rstr;
+}
+
+
+void trace( int indent, definition *program, proc_list *proc, char *fname, int enter )
+{
+	int i;
+	char direction[32];
+	char function_name[512];
+
+	// return if the type is not traced
+	if( trace_points[gtype] == 0 ) {
+		return;
+	}
+
+	// do the indent
+	for( i = 0; i < indent; i++ ) {
+		f_print( fout, "\t" );
+	}	
+
+	// get the direction string
+	sprintf( direction, "%s", ((enter == 1) ? "Entering " : "Exiting" ) );
+
+	// get the classname
+	switch( gtype ) {
+	case TYPE_SVC_STUB_IMPL:
+		sprintf( function_name, "%s::", "ServiceStub" );
+		break;
+
+	case TYPE_SVC_MGR_C:
+		sprintf( function_name, "%s::", ServiceManagerClassname(program) );
+		break;
+
+	case TYPE_INST_C:
+		sprintf( function_name, "%s::", ComponentClassname(program) );
+		break;
+
+	case TYPE_CLIENT_C:
+		sprintf( function_name, "%s::", ClientComponentClassname(program) );
+		break;
+
+	case TYPE_SVC_MGR_H:
+	case TYPE_INST_H:
+	case TYPE_CLIENT_H:
+		assert( !"INVALID TYPE" );
+		break;
+	}
+
+	// append the function name
+	if( proc == NULL ) {
+		sprintf( &(function_name[strlen(function_name)]), "%s", fname );
+	} else {
+		sprintf( &(function_name[strlen(function_name)]), "%s", proc->proc_name );
+	}
+
+	// output the trace line
+	f_print( fout, "fprintf( stderr, \"TRACE: " );
+	f_print( fout, "%s ", direction );
+	f_print( fout, "%s ", function_name );
+	f_print( fout, "(%%d)\\n\", __LINE__ );\n" );
+}
+	
+	 
+/*********************************************************************
+ *
+ * PUBLIC FUNCTION: ae_set_trace
+ *
+ ********************************************************************/
+void ae_set_trace( int type )
+{
+	trace_points[type] = 1;
+}
+
+
+/*********************************************************************
+ *
+ * PUBLIC FUNCTION: ae_extend_custom_types - if the passed type is
+ * one of the basic types then it is returned unmodified. Otherwise
+ * we extend it with some namespacing construct.
+ *
+ * I am going to say that any type that begins with 'T' is a custom
+ * type. This is true of everything (I think). I'm still going to 
+ * check whether it is one of the in-built types to verify this. If
+ * something is neither 'T' nor an inbuilt type then I'll print a 
+ * warning.
+ *
+ ********************************************************************/
+char *ae_extend_custom_types( char *base_type )
+{
+	int is_basic_type = 0, match, i;
+	char *ptr, *n;
+	static char *basic_type[] = { "void", "int", "bool", "short", "array", "bytes", "char", "double", "float", "long", "string", "u_char", "u_int", "u_long", "u_short", "vector", "enum", "struct", "wrapstring", NULL };
+
+	// see if the type is one of the basic types. 	
+	for( i = 0; basic_type[i] != NULL; i++ ) {
+		match = strcmp( base_type, basic_type[i] );
+		if( match == 0 ) {
+			is_basic_type = 1;
+		}
+	}
+
+	// check that either 'T' or is_basic_type is set
+	if( (base_type[0] != 'T') && (is_basic_type == 0) ) {
+		fprintf( stderr, "WARNING: don't know how to handle type '%s'.\n", base_type );
+		is_basic_type = 1;
+	}
+
+	// check that both are not set
+	assert( (base_type[0] != 'T') || (is_basic_type != 1) );
+
+	// if is_basic_type is set then just strcpy
+	if( is_basic_type ) {
+		n = base_type;
+	}
+
+	// if 'T' then extend
+	if( base_type[0] == 'T' ) {
+		n = (char*)malloc( strlen(infilename) + 1 + strlen(base_type) + 1 ); 
+		assert( n != NULL );
+		strcpy( n, infilename );
+		ptr = strchr( n, '.' );
+		if( ptr != NULL )
+			*ptr = 0;
+		strcat( n, "_" );
+		strcat( n, base_type );
+	}
+
+	return n;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/ae_component_rpc.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __AE_COMPONENT_RPC_H__
+#define __AE_COMPONENT_RPC_H__
+
+/*********************************************************************
+ *
+ * Definitions
+ *
+ ********************************************************************/
+#define TYPE_SVC_STUB_IMPL	0
+#define TYPE_SVC_MGR_H		1
+#define TYPE_SVC_MGR_C		2
+#define TYPE_INST_H			3
+#define TYPE_INST_C			4
+#define TYPE_CLIENT_H		5
+#define TYPE_CLIENT_C		6
+
+#define MAXEXTENDEDNAME		256
+
+/*********************************************************************
+ *
+ * Prototypes
+ *
+ ********************************************************************/
+void ae_output_rpc_file( char *infile, char *outfile, int type );
+void ae_set_trace( int type );
+char *ae_extend_custom_types( char *base_type );
+
+#endif //__AE_COMPONENT_RPC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,150 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_clntout.c	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_clntout.c 1.2 87/06/24 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_clntout.c, Client-stub outputter for the RPC protocol compiler
+ * Copyright (C) 1987, Sun Microsytsems, Inc.
+ */
+#include <stdio.h>
+#ifdef WIN32
+#include <stdlib.h>
+#include <string.h>
+#include "rpc_pars.h"
+#else
+#include <strings.h>
+#include "rpc_pars.h"
+#endif
+#include "rpc_util.h"
+#include "ae_component_rpc.h"
+
+#define DEFAULT_TIMEOUT 25	/* in seconds */
+
+/* prototypes */
+static void printbody( proc_list *proc );
+
+/* implementation */
+static void
+write_program(def)
+	definition *def;
+{
+	version_list *vp;
+	proc_list *proc;
+
+	for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
+		for (proc = vp->procs; proc != NULL; proc = proc->next) {
+			f_print(fout, "\n");
+			ptype(proc->res_prefix, proc->res_type, 1);
+			f_print(fout, "*\n");
+			pvname(proc->proc_name, vp->vers_num);
+			f_print(fout, "(argp, clnt)\n");
+			f_print(fout, "\t");
+			ptype(proc->arg_prefix, proc->arg_type, 1);
+			f_print(fout, "*argp;\n");
+			f_print(fout, "\tCLIENT *clnt;\n");
+			f_print(fout, "{\n");
+			printbody(proc);
+			f_print(fout, "}\n\n");
+		}
+	}
+}
+
+static char *
+ampr(type)
+	char *type;
+{
+	if (isvectordef(type, REL_ALIAS)) {
+		return ("");
+	} else {
+		return ("&");
+	}
+}
+
+static void
+printbody(proc)
+	proc_list *proc;
+{
+	f_print(fout, "\tstatic ");
+	if (streq(proc->res_type, "void")) {
+		f_print(fout, "char ");
+	} else {
+		ptype(proc->res_prefix, proc->res_type, 0);
+	}
+	f_print(fout, "res;\n");
+	f_print(fout, "\n");
+ 	f_print(fout, "\tbzero((char *)%sres, sizeof(res));\n",
+ 		ampr(proc->res_type));
+	f_print(fout,
+		"\tclnt_call(clnt, %s, xdr_%s, argp, xdr_%s, %sres, TIMEOUT);\n",
+		proc->proc_name, ae_extend_custom_types(stringfix(proc->arg_type)),
+		ae_extend_custom_types(stringfix(proc->res_type)), ampr(proc->res_type));
+//		"\tif (clnt_call(clnt, %s, xdr_%s, argp, xdr_%s, %sres, TIMEOUT) != RPC_SUCCESS) {\n",
+//		proc->proc_name, stringfix(proc->arg_type),
+//		stringfix(proc->res_type), ampr(proc->res_type));
+//	f_print(fout, "\t\treturn (NULL);\n");
+//	f_print(fout, "\t}\n");
+	if (streq(proc->res_type, "void")) {
+		f_print(fout, "\treturn ((void *)%sres);\n",
+			ampr(proc->res_type));
+	} else {
+		f_print(fout, "\treturn (%sres);\n", ampr(proc->res_type));
+	}
+}
+
+void
+write_stubs()
+{
+	list *l;
+	definition *def;
+
+ 	f_print(fout,
+ 		"\n/* Default timeout can be changed using clnt_control() */\n");
+ 	f_print(fout, "static struct timeval TIMEOUT = { %d, 0 };\n",
+		DEFAULT_TIMEOUT);
+	for (l = defined; l != NULL; l = l->next) {
+		def = (definition *) l->val;
+		if (def->def_kind == DEF_PROGRAM) {
+			write_program(def);
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_cout.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,386 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_cout.c	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_cout.c 1.8 87/06/24 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_cout.c, XDR routine outputter for the RPC protocol compiler 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef WIN32
+#include <string.h>
+#include "rpc_util.h"
+#include "rpc_pars.h"
+#else
+#include <string.h>
+#include "rpc_util.h"
+#include "rpc_pars.h"
+#endif
+#include "ae_component_rpc.h"
+
+/* prototypes */
+static void print_ifstat( int indent, char *prefix, char *type, relation rel, char *amax, char *objname, char *name );
+
+
+/* implementation */
+static void
+print_stat(dec)
+	declaration *dec;
+{
+	char *prefix = dec->prefix;
+	char *type = dec->type;
+	char *amax = dec->array_max;
+	relation rel = dec->rel;
+	char name[256];
+
+	if (isvectordef(type, rel)) {
+		s_print(name, "objp->%s", dec->name);
+	} else {
+		s_print(name, "&objp->%s", dec->name);
+	}
+	print_ifstat(1, prefix, type, rel, amax, name, dec->name);
+}
+
+
+static void
+space()
+{
+	f_print(fout, "\n\n");
+}
+
+static int
+findtype(def, type)
+	definition *def;
+	char *type;
+{
+	if (def->def_kind == DEF_PROGRAM || def->def_kind == DEF_CONST) {
+		return (0);
+	} else {
+		return (streq(def->def_name, type));
+	}
+}
+
+static int
+undefined(type)
+	char *type;
+{
+	definition *def;
+
+	def = (definition *) FINDVAL(defined, type, findtype);
+	return (def == NULL);
+}
+
+
+static void
+print_header(def)
+	definition *def;
+{
+	space();
+	f_print(fout, "bool_t\n");
+	f_print(fout, "xdr_%s(xdrs, objp)\n", ae_extend_custom_types(def->def_name));
+	f_print(fout, "\tXDR *xdrs;\n");
+	f_print(fout, "\t%s ", def->def_name);
+	if (def->def_kind != DEF_TYPEDEF ||
+	    !isvectordef(def->def.ty.old_type, def->def.ty.rel)) {
+		f_print(fout, "*");
+	}
+	f_print(fout, "objp;\n");
+	f_print(fout, "{\n");
+}
+
+static void
+print_trailer()
+{
+	f_print(fout, "\treturn (TRUE);\n");
+	f_print(fout, "}\n");
+	space();
+}
+
+
+static void
+print_ifopen(indent, name)
+	int indent;
+	char *name;
+{
+	tabify(fout, indent);
+	f_print(fout, "if (!xdr_%s(xdrs", ae_extend_custom_types(name));
+}
+
+
+static void
+print_ifarg(arg)
+	char *arg;
+{
+	f_print(fout, ", %s", arg);
+}
+
+
+static void
+print_ifsizeof(prefix, type)
+	char *prefix;
+	char *type;
+{
+	if (streq(type, "bool")) {
+		f_print(fout, ", sizeof(bool_t), xdr_bool");
+	} else {
+		f_print(fout, ", sizeof(");
+		if (undefined(type) && prefix) {
+			f_print(fout, "%s ", prefix);
+		}
+		f_print(fout, "%s), (void*)xdr_%s", type, ae_extend_custom_types(type));
+	}
+}
+
+static void
+print_ifclose(indent)
+	int indent;
+{
+	f_print(fout, ")) {\n");
+	tabify(fout, indent);
+	f_print(fout, "\treturn (FALSE);\n");
+	tabify(fout, indent);
+	f_print(fout, "}\n");
+}
+
+static void
+print_ifstat(indent, prefix, type, rel, amax, objname, name)
+	int indent;
+	char *prefix;
+	char *type;
+	relation rel;
+	char *amax;
+	char *objname;
+	char *name;
+{
+	char *alt = NULL;
+
+	switch (rel) {
+	case REL_POINTER:
+		{
+			int ischar;
+			ischar = strcmp( type, "char" );
+			if( (ischar == 0) && (command_line.wrapstring_flag) ) {
+				print_ifopen( indent, "wrapstring" );
+				f_print(fout, ", %s", objname);
+			} else {
+				print_ifopen(indent, "pointer");
+				print_ifarg("(char **)");
+				f_print(fout, "%s", objname);
+				print_ifsizeof(prefix, type);
+			}
+			break;
+		}
+	case REL_VECTOR:
+		if (streq(type, "string")) {
+			alt = "string";
+		} else if (streq(type, "opaque")) {
+			alt = "opaque";
+		}
+		if (alt) {
+			print_ifopen(indent, alt);
+			print_ifarg(objname);
+		} else {
+			print_ifopen(indent, "vector");
+			print_ifarg("(char *)");
+			f_print(fout, "%s", objname);
+		}
+		print_ifarg(amax);
+		if (!alt) {
+			print_ifsizeof(prefix, type);
+		}
+		break;
+	case REL_ARRAY:
+		if (streq(type, "string")) {
+			alt = "string";
+		} else if (streq(type, "opaque")) {
+			alt = "bytes";
+		}
+		if (streq(type, "string")) {
+			print_ifopen(indent, alt);
+			print_ifarg(objname);
+		} else {
+			if (alt) {
+				print_ifopen(indent, alt);
+			} else {
+				print_ifopen(indent, "array");
+			}
+			print_ifarg("(char **)");
+			if (*objname == '&') {
+				f_print(fout, "%s.%s_val, (u_int *)%s.%s_len",
+					objname, name, objname, name);
+			} else {
+				f_print(fout, "&%s->%s_val, (u_int *)&%s->%s_len",
+					objname, name, objname, name);
+			}
+		}
+		print_ifarg(amax);
+		if (!alt) {
+			print_ifsizeof(prefix, type);
+		}
+		break;
+	case REL_ALIAS:
+		print_ifopen(indent, type);
+		print_ifarg(objname);
+		break;
+	}
+	print_ifclose(indent);
+}
+
+
+/* ARGSUSED */
+static void
+emit_enum(def)
+	definition *def;
+{
+	print_ifopen(1, "enum");
+	print_ifarg("(enum_t *)objp");
+	print_ifclose(1);
+}
+
+
+static void
+emit_union(def)
+	definition *def;
+{
+	declaration *dflt;
+	case_list *cl;
+	declaration *cs;
+	char *object;
+	char *format = "&objp->%s_u.%s";
+
+	print_stat(&def->def.un.enum_decl);
+	f_print(fout, "\tswitch (objp->%s) {\n", def->def.un.enum_decl.name);
+	for (cl = def->def.un.cases; cl != NULL; cl = cl->next) {
+		cs = &cl->case_decl;
+		f_print(fout, "\tcase %s:\n", cl->case_name);
+		if (!streq(cs->type, "void")) {
+			object = alloc(strlen(def->def_name) + strlen(format) +
+				       strlen(cs->name) + 1);
+			s_print(object, format, def->def_name, cs->name);
+			print_ifstat(2, cs->prefix, cs->type, cs->rel, cs->array_max,
+				     object, cs->name);
+			free(object);
+		}
+		f_print(fout, "\t\tbreak;\n");
+	}
+	dflt = def->def.un.default_decl;
+	if (dflt != NULL) {
+		if (!streq(dflt->type, "void")) {
+			f_print(fout, "\tdefault:\n");
+			object = alloc(strlen(def->def_name) + strlen(format) +
+				       strlen(dflt->name) + 1);
+			s_print(object, format, def->def_name, dflt->name);
+			print_ifstat(2, dflt->prefix, dflt->type, dflt->rel,
+				     dflt->array_max, object, dflt->name);
+			free(object);
+			f_print(fout, "\t\tbreak;\n");
+		}
+	} else {
+		f_print(fout, "\tdefault:\n");
+		f_print(fout, "\t\treturn (FALSE);\n");
+	}
+	f_print(fout, "\t}\n");
+}
+
+
+
+static void
+emit_struct(def)
+	definition *def;
+{
+	decl_list *dl;
+
+	for (dl = def->def.st.decls; dl != NULL; dl = dl->next) {
+		print_stat(&dl->decl);
+	}
+}
+
+
+
+
+static void
+emit_typedef(def)
+	definition *def;
+{
+	char *prefix = def->def.ty.old_prefix;
+	char *type = def->def.ty.old_type;
+	char *amax = def->def.ty.array_max;
+	relation rel = def->def.ty.rel;
+
+	print_ifstat(1, prefix, type, rel, amax, "objp", def->def_name);
+}
+
+
+
+
+/*
+ * Emit the C-routine for the given definition 
+ */
+void
+emit(def)
+	definition *def;
+{
+	if (def->def_kind == DEF_PROGRAM || def->def_kind == DEF_CONST) {
+		return;
+	}
+	print_header(def);
+	switch (def->def_kind) {
+	case DEF_UNION:
+		emit_union(def);
+		break;
+	case DEF_ENUM:
+		emit_enum(def);
+		break;
+	case DEF_STRUCT:
+		emit_struct(def);
+		break;
+	case DEF_TYPEDEF:
+		emit_typedef(def);
+		break;
+	case DEF_CONST:
+	case DEF_PROGRAM:
+		break;
+	}
+	print_trailer();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_hout.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,431 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_hout.c	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_hout.c 1.6 87/07/28 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_hout.c, Header file outputter for the RPC protocol compiler 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include "rpc_util.h"
+#include "rpc_pars.h"
+#include "ae_component_rpc.h"
+
+/* prototypes */
+static void pdefine( char *name, char *num );
+static void pdeclaration( char *name, declaration *dec, int tab );
+void pprocdef( proc_list *proc, version_list *vp );
+static int undefined2( char *type, char *stop );
+
+/* implementation */
+static void
+pconstdef(def)
+	definition *def;
+{
+	pdefine(def->def_name, def->def.co);
+}
+
+static void
+pstructdef(def)
+	definition *def;
+{
+	decl_list *l;
+	char *name = def->def_name;
+
+	f_print(fout, "struct %s {\n", name);
+	for (l = def->def.st.decls; l != NULL; l = l->next) {
+		pdeclaration(name, &l->decl, 1);
+	}
+	f_print(fout, "};\n");
+	f_print(fout, "typedef struct %s %s;\n", name, name);
+}
+
+static void 
+puniondef(def)
+	definition *def;
+{
+	case_list *l;
+	char *name = def->def_name;
+	declaration *decl;
+
+	f_print(fout, "struct %s {\n", name);
+	decl = &def->def.un.enum_decl;
+	if (streq(decl->type, "bool")) {
+		f_print(fout, "\tbool_t %s;\n", decl->name);
+	} else {
+		f_print(fout, "\t%s %s;\n", decl->type, decl->name);
+	}
+	f_print(fout, "\tunion {\n");
+	for (l = def->def.un.cases; l != NULL; l = l->next) {
+		pdeclaration(name, &l->case_decl, 2);
+	}
+	decl = def->def.un.default_decl;
+	if (decl && !streq(decl->type, "void")) {
+		pdeclaration(name, decl, 2);
+	}
+	f_print(fout, "\t} %s_u;\n", name);
+	f_print(fout, "};\n");
+	f_print(fout, "typedef struct %s %s;\n", name, name);
+}
+
+
+
+static void
+pdefine(name, num)
+	char *name;
+	char *num;
+{
+	f_print(fout, "#define %s %s\n", name, num);
+}
+
+static void
+puldefine(name, num)
+	char *name;
+	char *num;
+{
+	f_print(fout, "#define %s ((u_long)%s)\n", name, num);
+}
+
+static int
+define_printed(stop, start)
+	proc_list *stop;
+	version_list *start;
+{
+	version_list *vers;
+	proc_list *proc;
+
+	for (vers = start; vers != NULL; vers = vers->next) {
+		for (proc = vers->procs; proc != NULL; proc = proc->next) {
+			if (proc == stop) {
+				return (0);
+			} else if (streq(proc->proc_name, stop->proc_name)) {
+				return (1);
+			}
+		}
+	}
+	abort();
+	/* NOTREACHED */
+}
+
+
+static void
+pprogramdef(def)
+	definition *def;
+{
+	version_list *vers;
+	proc_list *proc;
+
+	puldefine(def->def_name, def->def.pr.prog_num);
+	for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) {
+		puldefine(vers->vers_name, vers->vers_num);
+		for (proc = vers->procs; proc != NULL; proc = proc->next) {
+			if (!define_printed(proc, def->def.pr.versions)) {
+				puldefine(proc->proc_name, proc->proc_num);
+			}
+			pprocdef(proc, vers);
+		}
+	}
+}
+
+void 
+pprocdef(proc, vp)
+	proc_list *proc;
+	version_list *vp;
+{
+	f_print(fout, "#ifdef __cplusplus\nextern \"C\" {\n");
+	
+	f_print(fout, "extern ");
+	if (proc->res_prefix) {
+		if (streq(proc->res_prefix, "enum")) {
+			f_print(fout, "enum ");
+		} else {
+			f_print(fout, "struct ");
+		}
+	}
+	if (streq(proc->res_type, "bool")) {
+		f_print(fout, "bool_t *");
+	} else if (streq(proc->res_type, "string")) {
+		f_print(fout, "char **");
+	} else {
+		f_print(fout, "%s *", fixtype(proc->res_type));
+	}
+	pvname(proc->proc_name, vp->vers_num);
+
+	// AE -- modified to make it print out the correct headers
+	{
+	//	f_print(fout, "(...);\n}\n#else\n");
+		f_print(fout, "( " );
+
+
+		if (streq(proc->arg_type, "bool")) {
+			f_print(fout, "bool_t *");
+		} else if (streq(proc->arg_type, "string")) {
+			f_print(fout, "char **");
+		} else {
+			f_print(fout, "%s *", fixtype(proc->arg_type));
+		}
+
+		f_print(fout, " arg, CLIENT *cl ");
+		f_print(fout, ");\n}\n#else\n" );
+	}
+
+	f_print(fout, "extern ");
+	if (proc->res_prefix) {
+		if (streq(proc->res_prefix, "enum")) {
+			f_print(fout, "enum ");
+		} else {
+			f_print(fout, "struct ");
+		}
+	}
+	if (streq(proc->res_type, "bool")) {
+		f_print(fout, "bool_t *");
+	} else if (streq(proc->res_type, "string")) {
+		f_print(fout, "char **");
+	} else {
+		f_print(fout, "%s *", fixtype(proc->res_type));
+	}
+	pvname(proc->proc_name, vp->vers_num);
+	f_print(fout, "();\n#endif /* __cplusplus */\n");
+
+}
+
+static void
+penumdef(def)
+	definition *def;
+{
+	char *name = def->def_name;
+	enumval_list *l;
+	char *last = NULL;
+	int count = 0;
+
+	f_print(fout, "enum %s {\n", name);
+	for (l = def->def.en.vals; l != NULL; l = l->next) {
+		f_print(fout, "\t%s", l->name);
+		if (l->assignment) {
+			f_print(fout, " = %s", l->assignment);
+			last = l->assignment;
+			count = 1;
+		} else {
+			if (last == NULL) {
+				f_print(fout, " = %d", count++);
+			} else {
+				f_print(fout, " = %s + %d", last, count++);
+			}
+		}
+		f_print(fout, ",\n");
+	}
+	f_print(fout, "};\n");
+	f_print(fout, "typedef enum %s %s;\n", name, name);
+}
+
+static void
+ptypedef(def)
+	definition *def;
+{
+	char *name = def->def_name;
+	char *old = def->def.ty.old_type;
+	char prefix[8];	/* enough to contain "struct ", including NUL */
+	relation rel = def->def.ty.rel;
+
+
+	if (!streq(name, old)) {
+		if (streq(old, "string")) {
+			old = "char";
+			rel = REL_POINTER;
+		} else if (streq(old, "opaque")) {
+			old = "char";
+		} else if (streq(old, "bool")) {
+			old = "bool_t";
+		}
+		if (undefined2(old, name) && def->def.ty.old_prefix) {
+			s_print(prefix, "%s ", def->def.ty.old_prefix);
+		} else {
+			prefix[0] = 0;
+		}
+		f_print(fout, "typedef ");
+		switch (rel) {
+		case REL_ARRAY:
+			f_print(fout, "struct {\n");
+			f_print(fout, "\tu_int %s_len;\n", name);
+			f_print(fout, "\t%s%s *%s_val;\n", prefix, old, name);
+			f_print(fout, "} %s", name);
+			break;
+		case REL_POINTER:
+			f_print(fout, "%s%s *%s", prefix, old, name);
+			break;
+		case REL_VECTOR:
+			f_print(fout, "%s%s %s[%s]", prefix, old, name,
+				def->def.ty.array_max);
+			break;
+		case REL_ALIAS:
+ 			f_print(fout, "%s%s %s", prefix, old, name);
+			break;
+		}
+		f_print(fout, ";\n");
+	}
+}
+
+
+static void
+pdeclaration(name, dec, tab)
+	char *name;
+	declaration *dec;
+	int tab;
+{
+	char buf[8];	/* enough to hold "struct ", include NUL */
+	char *prefix;
+	char *type;
+
+	if (streq(dec->type, "void")) {
+		return;
+	}
+	tabify(fout, tab);
+	if (streq(dec->type, name) && !dec->prefix) {
+		f_print(fout, "struct ");
+	}
+	if (streq(dec->type, "string")) {
+		f_print(fout, "char *%s", dec->name);
+	} else {
+		prefix = "";
+		if (streq(dec->type, "bool")) {
+			type = "bool_t";
+		} else if (streq(dec->type, "opaque")) {
+			type = "char";
+		} else {
+			if (dec->prefix) {
+				s_print(buf, "%s ", dec->prefix);
+				prefix = buf;
+			}
+			type = dec->type;
+		}
+		switch (dec->rel) {
+		case REL_ALIAS:
+			f_print(fout, "%s%s %s", prefix, type, dec->name);
+			break;
+		case REL_VECTOR:
+			f_print(fout, "%s%s %s[%s]", prefix, type, dec->name,
+				dec->array_max);
+			break;
+		case REL_POINTER:
+			f_print(fout, "%s%s *%s", prefix, type, dec->name);
+			break;
+		case REL_ARRAY:
+			f_print(fout, "struct {\n");
+			tabify(fout, tab);
+			f_print(fout, "\tu_int %s_len;\n", dec->name);
+			tabify(fout, tab);
+			f_print(fout, "\t%s%s *%s_val;\n", prefix, type, dec->name);
+			tabify(fout, tab);
+			f_print(fout, "} %s", dec->name);
+			break;
+		}
+	}
+	f_print(fout, ";\n");
+}
+
+
+
+static int
+undefined2(type, stop)
+	char *type;
+	char *stop;
+{
+	list *l;
+	definition *def;
+
+	for (l = defined; l != NULL; l = l->next) {
+		def = (definition *) l->val;
+		if (def->def_kind != DEF_PROGRAM) {
+			if (streq(def->def_name, stop)) {
+				return (1);
+			} else if (streq(def->def_name, type)) {
+				return (0);
+			}
+		}
+	}
+	return (1);
+}
+
+/*
+ * Print the C-version of an xdr definition 
+ */
+void
+print_datadef(def)
+	definition *def;
+{
+	if (def->def_kind != DEF_CONST) {
+		f_print(fout, "\n");
+	}
+	switch (def->def_kind) {
+	case DEF_STRUCT:
+		pstructdef(def);
+		break;
+	case DEF_UNION:
+		puniondef(def);
+		break;
+	case DEF_ENUM:
+		penumdef(def);
+		break;
+	case DEF_TYPEDEF:
+		ptypedef(def);
+		break;
+	case DEF_PROGRAM:
+		pprogramdef(def);
+		break;
+	case DEF_CONST:
+		pconstdef(def);
+		break;
+	}
+	if (def->def_kind != DEF_PROGRAM && def->def_kind != DEF_CONST) {
+		f_print(fout, "#ifdef __cplusplus\nextern \"C\" {\n");
+		f_print(fout, "bool_t xdr_%s(...);\n", ae_extend_custom_types(def->def_name));
+		f_print(fout, "}\n#else\n");
+		f_print(fout, "bool_t xdr_%s();\n", ae_extend_custom_types(def->def_name));
+		f_print(fout, "#endif\n");
+	}
+	if (def->def_kind != DEF_CONST) {
+		f_print(fout, "\n");
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_main.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,587 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_main.c	2.2 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_main.c 1.7 87/06/24 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_main.c, Top level of the RPC protocol compiler. 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include "rpc_util.h"
+#include "rpc_pars.h"
+#include "rpc_scan.h"
+
+#ifdef WIN32
+#include <direct.h>
+#include <process.h>
+#include <io.h>
+#include <fcntl.h>
+#else
+#include <unistd.h>
+#include <sys/file.h>
+#endif
+
+#include "ae_component_rpc.h"
+
+#define EXTEND	1		/* alias for TRUE */
+
+static char *cmdname;
+#ifdef WIN32
+#ifdef __BORLANDC__
+static char CPP[] = "cpp32";
+static char CPPFLAGS[] = "-C -P- -oCON";
+#else
+static char CPP[] = "cl";
+static char CPPFLAGS[] = "/C /EP /nologo";
+#endif
+#else
+static char CPP[] = "/usr/bin/cpp";
+static char CPPFLAGS[] = "-C";
+#endif
+static char *allv[] = {
+	"rpcgen", "-s", "udp", "-s", "tcp",
+};
+static int allc = sizeof(allv)/sizeof(allv[0]);
+
+
+/* prototypes */
+extern void crash();
+static void do_registers( int argc, char *argv[] );
+struct commandline command_line;
+
+
+/*
+ * add extension to filename 
+ */
+char *
+extendfile(file, ext)
+	char *file;
+	char *ext;
+{
+#ifdef WIN32
+	int i;
+#endif
+	char *res;
+	char *p;
+
+	res = alloc(strlen(file) + strlen(ext) + 1);
+	if (res == NULL) {
+		abort();
+	}
+#ifdef WIN32
+	p = NULL;
+	for (i = 0; file[i] != '\0'; i++)
+		if (file[i] == '.')
+			p = &file[i];
+#else
+	p = rindex(file, '.');
+#endif
+	if (p == NULL) {
+		p = file + strlen(file);
+	}
+	(void) strcpy(res, file);
+	(void) strcpy(res + (p - file), ext);
+	return (res);
+}
+
+/*
+ * Open output file with given extension 
+ */
+void
+open_output(infile, outfile)
+	char *infile;
+	char *outfile;
+{
+	char *ptr;
+	char buff[1024];
+
+	// check that some file is specified
+	if (outfile == NULL) {
+		fout = stdout;
+		return;
+	}
+
+	// set the buffer with the specified output path
+	strcpy( buff, command_line.outfile );
+
+	// only copy the filename itself
+	ptr = strrchr( outfile, '\\' );
+	if( ptr == NULL ) {
+		ptr = strrchr( outfile, '/' );
+		if( ptr == NULL ) {
+			ptr = outfile - 1;
+		}
+	}
+	ptr++;
+	strcat( buff, ptr );
+
+	// check that we are not going to overwrite the input file
+	if (infile != NULL && streq(buff, infile)) {
+		f_print(stderr, "%s: output would overwrite %s\n", cmdname, infile);
+		crash();
+	}
+
+//	fprintf( stderr, "INFO: opening output file %s\n", buff );
+
+	// open the output file
+	fout = fopen(buff, "w");
+	if (fout == NULL) {
+		f_print(stderr, "%s: unable to open output file.", cmdname);
+		perror(buff);
+		crash();
+	}
+	record_open(buff);
+}
+
+/*
+ * Open input file with given define for C-preprocessor 
+ */
+void
+open_input(infile, define)
+	char *infile;
+	char *define;
+{
+#ifdef WIN32
+#ifdef __BORLANDC__
+#define _P_WAIT P_WAIT
+#define _spawnlp spawnlp
+#endif
+	int old;
+	int pd[2];
+
+	infilename = (infile == NULL) ? "<stdin>" : infile;
+	_pipe(pd, 0xffff, O_TEXT);
+
+		old = dup(1);
+		(void) dup2(pd[1], 1);
+
+		if (_spawnlp(_P_WAIT, CPP, CPP, CPPFLAGS, 
+					define, infile, NULL) < 0) {
+			f_print(stderr, "%s: unable to open ", cmdname);
+			perror(CPP);
+			crash();
+		}
+
+	(void) dup2(old, 1);
+
+	(void) close(pd[1]);
+	fin = fdopen(pd[0], "r");
+	if (fin == NULL) {
+		f_print(stderr, "%s: ", cmdname);
+		perror(infilename);
+		crash();
+	}
+#else
+	int pd[2];
+
+	infilename = (infile == NULL) ? "<stdin>" : infile;
+	(void) pipe(pd);
+	switch (fork()) {
+	case 0:
+		(void) close(1);
+		(void) dup2(pd[1], 1);
+		(void) close(pd[0]);
+		execl(CPP, CPP, CPPFLAGS, define, infile, NULL);
+		perror("execl");
+		exit(1);
+	case -1:
+		perror("fork");
+		exit(1);
+	}
+	(void) close(pd[1]);
+	fin = fdopen(pd[0], "r");
+	if (fin == NULL) {
+		f_print(stderr, "%s: ", cmdname);
+		perror(infilename);
+		crash();
+	}
+#endif
+}
+
+/*
+ * Compile into an XDR routine output file
+ */
+static void
+c_output(infile, define, extend, outfile)
+	char *infile;
+	char *define;
+	int extend;
+	char *outfile;
+{
+	definition *def;
+	char *include;
+	char *outfilename;
+	long tell;
+
+	open_input(infile, define);	
+	outfilename = extend ? extendfile(infile, outfile) : outfile;
+	open_output(infile, outfilename);
+	f_print(fout, "#include <rpc/rpc.h>\n");
+	if (infile && (include = extendfile(infile, ".h"))) {
+		f_print(fout, "#include \"%s\"\n", include);
+		free(include);
+	}
+	tell = ftell(fout);
+	while ((def = get_definition())) {
+		emit(def);
+	}
+	if (extend && tell == ftell(fout)) {
+		(void) unlink(outfilename);
+	}
+}
+
+/*
+ * Compile into an XDR header file
+ */
+static void
+h_output(infile, define, extend, outfile)
+	char *infile;
+	char *define;
+	int extend;
+	char *outfile;
+{
+	definition *def;
+	char *outfilename;
+	long tell;
+	char nbuff[256];
+
+	open_input(infile, define);
+	outfilename =  extend ? extendfile(infile, outfile) : outfile;
+	open_output(infile, outfilename);
+	tell = ftell(fout);
+
+	// AE -- do proper #ifdef
+	{
+		char *ptr;
+		int slen;
+		int i;
+
+		// get a pointer to the filename
+		ptr = strrchr( outfilename, '\\' );
+		ptr = ((ptr == NULL) ? outfilename : ptr+1);
+
+		// now copy the filename
+		slen = strlen(ptr);
+		assert( slen < 256 );
+		memcpy( nbuff, ptr, slen );
+		nbuff[slen] = 0;
+
+		// make everything upper case
+		for( i = 0; i < slen; i++ ) {
+			nbuff[i] = toupper( nbuff[i] );
+		}
+		assert( nbuff[slen-2] == '.' );
+		nbuff[slen-2] = '_';
+
+		// now print the ifdef
+		f_print( fout, "#ifndef __%s__\n", nbuff );
+		f_print( fout, "#define __%s__\n", nbuff );
+	}
+		
+
+	/*** The following line was added,  ***/
+	/*** 31.03.92, Detlef Schwellenbach ***/
+
+	f_print(fout, "#include <rpc/types.h>\n");
+
+	// AE -- include this for the CLIENT type
+	{
+		f_print(fout, "#include <rpc/rpc.h>\n\n");
+	}
+
+	while ((def = get_definition())) {
+		print_datadef(def);
+	}
+	if (extend && tell == ftell(fout)) {
+		(void) unlink(outfilename);
+	}
+
+	// AE -- end the #def
+	f_print(fout, "#endif /* __%s__ */\n", nbuff );
+}
+
+/*
+ * Compile into an RPC service
+ */
+static void
+s_output(argc, argv, infile, define, extend, outfile, nomain)
+	int argc;
+	char *argv[];
+	char *infile;
+	char *define;
+	int extend;
+	char *outfile;
+	int nomain;
+{
+	char *include;
+	definition *def;
+	int foundprogram;
+	char *outfilename;
+
+	open_input(infile, define);
+	outfilename = extend ? extendfile(infile, outfile) : outfile;
+	open_output(infile, outfilename);
+	f_print(fout, "#include <stdio.h>\n");
+	f_print(fout, "#include <rpc/rpc.h>\n");
+	f_print(fout, "#ifdef WIN32\n");
+	f_print(fout, "#include <rpc/PMAP_CLN.H>\n");
+	f_print(fout, "#else\n");
+	f_print(fout, "#include <rpc/pmap_clnt.h>\n");
+	f_print(fout, "#endif\n");
+	if (infile && (include = extendfile(infile, ".h"))) {
+		f_print(fout, "#include \"%s\"\n", include);
+		free(include);
+	}
+	foundprogram = 0;
+	while ((def = get_definition())) {
+		foundprogram |= (def->def_kind == DEF_PROGRAM);
+	}
+	if (extend && !foundprogram) {
+		(void) unlink(outfilename);
+		return;
+	}
+	if (nomain) {
+		write_programs((char *)NULL);
+	} else {
+		write_most();
+		do_registers(argc, argv);
+		write_rest();
+		write_programs("static");
+	}
+}
+
+static void
+l_output(infile, define, extend, outfile)
+	char *infile;
+	char *define;
+	int extend;
+	char *outfile;
+{
+	char *include;
+	definition *def;
+	int foundprogram;
+	char *outfilename;
+
+	open_input(infile, define);
+	outfilename = extend ? extendfile(infile, outfile) : outfile;
+	open_output(infile, outfilename);
+	f_print(fout, "#include <rpc/rpc.h>\n");
+	if (infile && (include = extendfile(infile, ".h"))) {
+		f_print(fout, "#include \"%s\"\n", include);
+		free(include);
+	}
+	foundprogram = 0;
+	while ((def = get_definition())) {
+		foundprogram |= (def->def_kind == DEF_PROGRAM);
+	}
+	if (extend && !foundprogram) {
+		(void) unlink(outfilename);
+		return;
+	}
+	write_stubs();
+}
+
+/*
+ * Perform registrations for service output 
+ */
+static void
+do_registers(argc, argv)
+	int argc;
+	char *argv[];
+{
+	int i;
+
+	for (i = 1; i < argc; i++) {
+		if (streq(argv[i], "-s")) {
+			write_register(argv[i + 1]);
+			i++;
+		}
+	}
+}
+
+/*
+ * Parse command line arguments 
+ */
+static int parseargs( int argc, char *argv[], struct commandline *cmd )
+{
+	int i, err;
+	char *opt;
+
+	// check params
+	assert( argv != NULL );
+	assert( cmd != NULL );
+
+	// clear the cmd struct
+	memset( cmd, 0, sizeof(*cmd) );
+
+	// if we don't have at least one extra param (the filename) then exit
+	if( argc < 2 ) {
+		return 0;
+	}
+
+	// now parse each token
+	for( i = 1; i < argc; i++ ) {
+
+		// if the first char is not '-' then this is the filename and we should break
+		if( argv[i][0] != '-' ) {
+			break;
+		}
+
+		// get a pointer to the option
+		opt = &(argv[i][1]);
+
+		// now look for a match
+		if( strcmp(opt,"client") == 0 ) {
+			cmd->client_flag = 1;
+		} else if( strcmp(opt,"server") == 0 ) {
+			cmd->server_flag = 1;
+		} else if( strcmp(opt,"component_base") == 0 ) {
+			cmd->component_base_flag = 1;
+		} else if( strcmp(opt,"component_mod_service_manager") == 0 ) {
+			cmd->component_mod_service_manager = 1;
+		} else if( strcmp(opt,"component_mod_component_impl") == 0 ) {
+			cmd->component_mod_component_impl = 1;
+		} else if( strcmp(opt,"wrapstring") == 0 ) {
+			cmd->wrapstring_flag = 1;
+		} else if( strcmp(opt,"header") == 0 ) {
+			cmd->header = 1;
+		} else if( opt[0] == 't' ) {
+			opt++;
+			ae_set_trace( atoi(opt) );
+		} else if( strncmp(opt,"o:",2) == 0 ) {
+			opt = &(argv[i][3]);
+			strcpy( cmd->outfile, opt );
+		} else if( strncmp(opt,"p:",2) == 0 ) {
+			opt = &(argv[i][3]);
+			err = chdir( opt );
+			if( err != 0 ) {
+				fprintf( stderr, "WARNING: couldn't change to the specified path.\n" );
+				return 0;
+			}
+//			fprintf( stderr, "INFO: changing directory to %s.\n", opt );
+		} else {
+			fprintf( stderr, "WARNING: unknown option '-%s'\n", opt );
+		}
+	}
+
+	// now read in the filename
+	if( i == argc ) {
+		fprintf( stderr, "WARNING: no filename specified.\n" );
+		return 0;
+	}
+	cmd->infile = argv[i];
+	
+	// done 
+	return 1;
+}
+
+
+int
+main(argc, argv)
+	int argc;
+	char *argv[];
+
+{
+	// parse the command line
+	if (!parseargs(argc, argv, &command_line)) {
+		fprintf( stderr, "usage: %s [-header | -client | -server | -component_base | -component_mod_service_manager | -component_mod_component_impl | -w | -t#] interface_file\n", argv[0] );
+		fprintf( stderr, "\tt0 - Component stubs.\n" );
+		fprintf( stderr, "\tt2 - Service manager.\n" );
+		fprintf( stderr, "\tt4 - Component instance.\n" );
+		fprintf( stderr, "\tt6 - Client stub.\n" );
+		exit(1);
+	}
+
+	// print the header if appropriate
+	if( command_line.client_flag || command_line.server_flag || command_line.header ) {
+		h_output(command_line.infile, "-DRPC_HDR", EXTEND, ".h");
+		reinitialize();
+	}
+
+	// output the xdr file if appropriate
+	if( command_line.client_flag || command_line.server_flag ) {
+		c_output(command_line.infile, "-DRPC_XDR", EXTEND, "_xdr.c");
+		reinitialize();
+	}
+
+	// output the client files
+	if( command_line.client_flag ) {
+		l_output(command_line.infile, "-DRPC_CLNT", EXTEND, "_clnt.c");
+		reinitialize();
+		if( command_line.component_base_flag ) {
+			ae_output_rpc_file( command_line.infile, ".h", TYPE_CLIENT_H );
+			reinitialize();
+			ae_output_rpc_file( command_line.infile, ".cpp", TYPE_CLIENT_C );
+			reinitialize();
+		}
+	}
+
+	// output the server files
+	if( command_line.server_flag ) {
+		s_output(allc, allv, command_line.infile, "-DRPC_SVC", EXTEND, "_svc.c", 0);
+		reinitialize();
+		if( command_line.component_base_flag ) {
+			ae_output_rpc_file( command_line.infile, "_svc_stub_impl.cpp", TYPE_SVC_STUB_IMPL );
+			reinitialize();
+		}
+		if( command_line.component_mod_service_manager ) {
+			ae_output_rpc_file( command_line.infile, ".cpp", TYPE_SVC_MGR_C );
+			reinitialize();
+			ae_output_rpc_file( command_line.infile, ".h", TYPE_SVC_MGR_H );
+			reinitialize();
+		}
+		if( command_line.component_mod_component_impl ) {
+			ae_output_rpc_file( command_line.infile, ".h", TYPE_INST_H );
+			reinitialize();
+			ae_output_rpc_file( command_line.infile, ".cpp", TYPE_INST_C );
+			reinitialize();
+		}
+	}
+
+	exit(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_pars.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,439 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_parse.c	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_parse.c 1.4 87/04/28 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_parse.c, Parser for the RPC protocol compiler
+ * Copyright (C) 1987 Sun Microsystems, Inc.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "rpc_util.h"
+#include "rpc_scan.h"
+#include "rpc_pars.h"
+
+/* prototypes */
+static void get_declaration( declaration *dec, defkind dkind );
+static void get_type( char **prefixp, char **typep, defkind dkind );
+static void unsigned_dec( char **typep );
+
+
+/* implementation */
+static void
+isdefined(defp)
+	definition *defp;
+{
+	STOREVAL(&defined, defp);
+}
+
+
+static void
+def_struct(defp)
+	definition *defp;
+{
+	token tok;
+	declaration dec;
+	decl_list *decls;
+	decl_list **tailp;
+
+	defp->def_kind = DEF_STRUCT;
+
+	scan(TOK_IDENT, &tok);
+	defp->def_name = tok.str;
+	scan(TOK_LBRACE, &tok);
+	tailp = &defp->def.st.decls;
+	do {
+		get_declaration(&dec, DEF_STRUCT);
+		decls = ALLOC(decl_list);
+		decls->decl = dec;
+		*tailp = decls;
+		tailp = &decls->next;
+		scan(TOK_SEMICOLON, &tok);
+		peek(&tok);
+	} while (tok.kind != TOK_RBRACE);
+	get_token(&tok);
+	*tailp = NULL;
+}
+
+static void
+def_program(defp)
+	definition *defp;
+{
+	token tok;
+	version_list *vlist;
+	version_list **vtailp;
+	proc_list *plist;
+	proc_list **ptailp;
+
+	defp->def_kind = DEF_PROGRAM;
+	scan(TOK_IDENT, &tok);
+	defp->def_name = tok.str;
+	scan(TOK_LBRACE, &tok);
+	vtailp = &defp->def.pr.versions;
+	scan(TOK_VERSION, &tok);
+	do {
+		scan(TOK_IDENT, &tok);
+		vlist = ALLOC(version_list);
+		vlist->vers_name = tok.str;
+		scan(TOK_LBRACE, &tok);
+		ptailp = &vlist->procs;
+		do {
+			plist = ALLOC(proc_list);
+			plist->next = NULL;
+			get_type(&plist->res_prefix, &plist->res_type, DEF_PROGRAM);
+			if (streq(plist->res_type, "opaque")) {
+				error("illegal result type");
+			}
+			scan(TOK_IDENT, &tok);
+			plist->proc_name = tok.str;
+			scan(TOK_LPAREN, &tok);
+			get_type(&plist->arg_prefix, &plist->arg_type, DEF_PROGRAM);
+			if (streq(plist->arg_type, "opaque")) {
+				error("illegal argument type");
+			}
+			scan(TOK_RPAREN, &tok);
+			scan(TOK_EQUAL, &tok);
+			scan_num(&tok);
+			scan(TOK_SEMICOLON, &tok);
+			plist->proc_num = tok.str;
+			*ptailp = plist;
+			ptailp = &plist->next;
+			peek(&tok);
+		} while (tok.kind != TOK_RBRACE);
+		*vtailp = vlist;
+		vtailp = &vlist->next;
+		scan(TOK_RBRACE, &tok);
+		scan(TOK_EQUAL, &tok);
+		scan_num(&tok);
+		vlist->vers_num = tok.str;
+		scan(TOK_SEMICOLON, &tok);
+		scan2(TOK_VERSION, TOK_RBRACE, &tok);
+	} while (tok.kind == TOK_VERSION);
+	scan(TOK_EQUAL, &tok);
+	scan_num(&tok);
+	defp->def.pr.prog_num = tok.str;
+	*vtailp = NULL;
+}
+
+static void
+def_enum(defp)
+	definition *defp;
+{
+	token tok;
+	enumval_list *elist;
+	enumval_list **tailp;
+
+	defp->def_kind = DEF_ENUM;
+	scan(TOK_IDENT, &tok);
+	defp->def_name = tok.str;
+	scan(TOK_LBRACE, &tok);
+	tailp = &defp->def.en.vals;
+	do {
+		scan(TOK_IDENT, &tok);
+		elist = ALLOC(enumval_list);
+		elist->name = tok.str;
+		elist->assignment = NULL;
+		scan3(TOK_COMMA, TOK_RBRACE, TOK_EQUAL, &tok);
+		if (tok.kind == TOK_EQUAL) {
+			scan_num(&tok);
+			elist->assignment = tok.str;
+			scan2(TOK_COMMA, TOK_RBRACE, &tok);
+		}
+		*tailp = elist;
+		tailp = &elist->next;
+	} while (tok.kind != TOK_RBRACE);
+	*tailp = NULL;
+}
+
+static void
+def_const(defp)
+	definition *defp;
+{
+	token tok;
+	defp->def_kind = DEF_CONST;
+	scan(TOK_IDENT, &tok);
+	defp->def_name = tok.str;
+	scan(TOK_EQUAL, &tok);
+	scan2(TOK_IDENT, TOK_STRCONST, &tok);
+	defp->def.co = tok.str;
+}
+
+static void
+def_union(defp)
+	definition *defp;
+{
+	token tok;
+	declaration dec;
+	case_list *cases;
+	case_list **tailp;
+
+	defp->def_kind = DEF_UNION;
+	scan(TOK_IDENT, &tok);
+	defp->def_name = tok.str;
+	scan(TOK_SWITCH, &tok);
+	scan(TOK_LPAREN, &tok);
+	get_declaration(&dec, DEF_UNION);
+	defp->def.un.enum_decl = dec;
+	tailp = &defp->def.un.cases;
+	scan(TOK_RPAREN, &tok);
+	scan(TOK_LBRACE, &tok);
+	scan(TOK_CASE, &tok);
+	while (tok.kind == TOK_CASE) {
+		scan(TOK_IDENT, &tok);
+		cases = ALLOC(case_list);
+		cases->case_name = tok.str;
+		scan(TOK_COLON, &tok);
+		get_declaration(&dec, DEF_UNION);
+		cases->case_decl = dec;
+		*tailp = cases;
+		tailp = &cases->next;
+		scan(TOK_SEMICOLON, &tok);
+		scan3(TOK_CASE, TOK_DEFAULT, TOK_RBRACE, &tok);
+	}
+	*tailp = NULL;
+	if (tok.kind == TOK_DEFAULT) {
+		scan(TOK_COLON, &tok);
+		get_declaration(&dec, DEF_UNION);
+		defp->def.un.default_decl = ALLOC(declaration);
+		*defp->def.un.default_decl = dec;
+		scan(TOK_SEMICOLON, &tok);
+		scan(TOK_RBRACE, &tok);
+	} else {
+		defp->def.un.default_decl = NULL;
+	}
+}
+
+
+static void
+def_typedef(defp)
+	definition *defp;
+{
+	declaration dec;
+
+	defp->def_kind = DEF_TYPEDEF;
+	get_declaration(&dec, DEF_TYPEDEF);
+	defp->def_name = dec.name;
+	defp->def.ty.old_prefix = dec.prefix;
+	defp->def.ty.old_type = dec.type;
+	defp->def.ty.rel = dec.rel;
+	defp->def.ty.array_max = dec.array_max;
+}
+
+
+static void
+get_declaration(dec, dkind)
+	declaration *dec;
+	defkind dkind;
+{
+	token tok;
+
+	get_type(&dec->prefix, &dec->type, dkind);
+	dec->rel = REL_ALIAS;
+	if (streq(dec->type, "void")) {
+		return;
+	}
+	scan2(TOK_STAR, TOK_IDENT, &tok);
+	if (tok.kind == TOK_STAR) {
+		dec->rel = REL_POINTER;
+		scan(TOK_IDENT, &tok);
+	}
+	dec->name = tok.str;
+	if (peekscan(TOK_LBRACKET, &tok)) {
+		if (dec->rel == REL_POINTER) {
+			error("no array-of-pointer declarations -- use typedef");
+		}
+		dec->rel = REL_VECTOR;
+		scan_num(&tok);
+		dec->array_max = tok.str;
+		scan(TOK_RBRACKET, &tok);
+	} else if (peekscan(TOK_LANGLE, &tok)) {
+		if (dec->rel == REL_POINTER) {
+			error("no array-of-pointer declarations -- use typedef");
+		}
+		dec->rel = REL_ARRAY;
+		if (peekscan(TOK_RANGLE, &tok)) {
+			dec->array_max = "~0";	/* unspecified size, use max */
+		} else {
+			scan_num(&tok);
+			dec->array_max = tok.str;
+			scan(TOK_RANGLE, &tok);
+		}
+	}
+	if (streq(dec->type, "opaque")) {
+		if (dec->rel != REL_ARRAY && dec->rel != REL_VECTOR) {
+			error("array declaration expected");
+		}
+	} else if (streq(dec->type, "string")) {
+		if (dec->rel != REL_ARRAY) {
+			error("variable-length array declaration expected");
+		}
+	}
+}
+
+
+static void
+get_type(prefixp, typep, dkind)
+	char **prefixp;
+	char **typep;
+	defkind dkind;
+{
+	token tok;
+
+	*prefixp = NULL;
+	get_token(&tok);
+	switch (tok.kind) {
+	case TOK_IDENT:
+		*typep = tok.str;
+		break;
+	case TOK_STRUCT:
+	case TOK_ENUM:
+	case TOK_UNION:
+		*prefixp = tok.str;
+		scan(TOK_IDENT, &tok);
+		*typep = tok.str;
+		break;
+	case TOK_UNSIGNED:
+		unsigned_dec(typep);
+		break;
+	case TOK_SHORT:
+		*typep = "short";
+		(void) peekscan(TOK_INT, &tok);
+		break;
+	case TOK_LONG:
+		*typep = "long";
+		(void) peekscan(TOK_INT, &tok);
+		break;
+	case TOK_VOID:
+		if (dkind != DEF_UNION && dkind != DEF_PROGRAM) {
+			error("voids allowed only inside union and program definitions");
+		}
+		*typep = tok.str;
+		break;
+	case TOK_STRING:
+	case TOK_OPAQUE:
+	case TOK_CHAR:
+	case TOK_INT:
+	case TOK_FLOAT:
+	case TOK_DOUBLE:
+	case TOK_BOOL:
+		*typep = tok.str;
+		break;
+	default:
+		error("expected type specifier");
+	}
+}
+
+
+static void
+unsigned_dec(typep)
+	char **typep;
+{
+	token tok;
+
+	peek(&tok);
+	switch (tok.kind) {
+	case TOK_CHAR:
+		get_token(&tok);
+		*typep = "u_char";
+		break;
+	case TOK_SHORT:
+		get_token(&tok);
+		*typep = "u_short";
+		(void) peekscan(TOK_INT, &tok);
+		break;
+	case TOK_LONG:
+		get_token(&tok);
+		*typep = "u_long";
+		(void) peekscan(TOK_INT, &tok);
+		break;
+	case TOK_INT:
+		get_token(&tok);
+		*typep = "u_int";
+		break;
+	default:
+		*typep = "u_int";
+		break;
+	}
+}
+
+
+/*
+ * return the next definition you see
+ */
+definition *
+get_definition()
+{
+	definition *defp;
+	token tok;
+
+	defp = ALLOC(definition);
+	get_token(&tok);
+	switch (tok.kind) {
+	case TOK_STRUCT:
+		def_struct(defp);
+		break;
+	case TOK_UNION:
+		def_union(defp);
+		break;
+	case TOK_TYPEDEF:
+		def_typedef(defp);
+		break;
+	case TOK_ENUM:
+		def_enum(defp);
+		break;
+	case TOK_PROGRAM:
+		def_program(defp);
+		break;
+	case TOK_CONST:
+		def_const(defp);
+		break;
+	case TOK_EOF:
+		return (NULL);
+		break;
+	default:
+		error("definition keyword expected");
+	}
+	scan(TOK_SEMICOLON, &tok);
+	isdefined(defp);
+	return (defp);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_pars.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,168 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/* @(#)rpc_parse.h 1.3 87/03/09 (C) 1987 SMI */
+
+/*
+ * rpc_parse.h, Definitions for the RPCL parser 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+
+enum defkind {
+	DEF_CONST,
+	DEF_STRUCT,
+	DEF_UNION,
+	DEF_ENUM,
+	DEF_TYPEDEF,
+	DEF_PROGRAM
+};
+typedef enum defkind defkind;
+
+typedef char *const_def;
+
+enum relation {
+	REL_VECTOR,		/* fixed length array */
+	REL_ARRAY,		/* variable length array */
+	REL_POINTER,	/* pointer */
+	REL_ALIAS,		/* simple */
+};
+typedef enum relation relation;
+
+struct typedef_def {
+	char *old_prefix;
+	char *old_type;
+	relation rel;
+	char *array_max;
+};
+typedef struct typedef_def typedef_def;
+
+
+struct enumval_list {
+	char *name;
+	char *assignment;
+	struct enumval_list *next;
+};
+typedef struct enumval_list enumval_list;
+
+struct enum_def {
+	enumval_list *vals;
+};
+typedef struct enum_def enum_def;
+
+
+struct declaration {
+	char *prefix;
+	char *type;
+	char *name;
+	relation rel;
+	char *array_max;
+};
+typedef struct declaration declaration;
+
+
+struct decl_list {
+	declaration decl;
+	struct decl_list *next;
+};
+typedef struct decl_list decl_list;
+
+struct struct_def {
+	decl_list *decls;
+};
+typedef struct struct_def struct_def;
+
+
+struct case_list {
+	char *case_name;
+	declaration case_decl;
+	struct case_list *next;
+};
+typedef struct case_list case_list;
+
+struct union_def {
+	declaration enum_decl;
+	case_list *cases;
+	declaration *default_decl;
+};
+typedef struct union_def union_def;
+
+
+
+struct proc_list {
+	char *proc_name;
+	char *proc_num;
+	char *arg_type;
+	char *arg_prefix;
+	char *res_type;
+	char *res_prefix;
+	struct proc_list *next;
+};
+typedef struct proc_list proc_list;
+
+
+struct version_list {
+	char *vers_name;
+	char *vers_num;
+	proc_list *procs;
+	struct version_list *next;
+};
+typedef struct version_list version_list;
+
+struct program_def {
+	char *prog_num;
+	version_list *versions;
+};
+typedef struct program_def program_def;
+
+struct definition {
+	char *def_name;
+	defkind def_kind;
+	union {
+		const_def co;
+		struct_def st;
+		union_def un;
+		enum_def en;
+		typedef_def ty;
+		program_def pr;
+	} def;
+};
+typedef struct definition definition;
+
+/* @(#)rpc_parse.h	2.1 88/08/01 4.0 RPCSRC */
+definition *get_definition();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_scan.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,491 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_scan.c	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_scan.c 1.6 87/06/24 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_scan.c, Scanner for the RPC protocol compiler 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include "rpc_scan.h"
+#include "rpc_util.h"
+
+#define startcomment(where) (where[0] == '/' && where[1] == '*')
+#define endcomment(where) (where[-1] == '*' && where[0] == '/')
+
+static int pushed = 0;	/* is a token pushed */
+static token lasttok;	/* last token, if pushed */
+
+
+
+
+static void
+unget_token(tokp)
+	token *tokp;
+{
+	lasttok = *tokp;
+	pushed = 1;
+}
+
+
+static void
+findstrconst(str, val)
+	char **str;
+	char **val;
+{
+	char *p;
+	int size;
+
+	p = *str;
+	do {
+		*p++;
+	} while (*p && *p != '"');
+	if (*p == 0) {
+		error("unterminated string constant");
+	}
+	p++;
+	size = p - *str;
+	*val = alloc(size + 1);
+	(void) strncpy(*val, *str, size);
+	(*val)[size] = 0;
+	*str = p;
+}
+
+static void
+findconst(str, val)
+	char **str;
+	char **val;
+{
+	char *p;
+	int size;
+
+	p = *str;
+	if (*p == '0' && *(p + 1) == 'x') {
+		p++;
+		do {
+			p++;
+		} while (isxdigit(*p));
+	} else {
+		do {
+			p++;
+		} while (isdigit(*p));
+	}
+	size = p - *str;
+	*val = alloc(size + 1);
+	(void) strncpy(*val, *str, size);
+	(*val)[size] = 0;
+	*str = p;
+}
+
+
+
+static token symbols[] = {
+			  {TOK_CONST, "const"},
+			  {TOK_UNION, "union"},
+			  {TOK_SWITCH, "switch"},
+			  {TOK_CASE, "case"},
+			  {TOK_DEFAULT, "default"},
+			  {TOK_STRUCT, "struct"},
+			  {TOK_TYPEDEF, "typedef"},
+			  {TOK_ENUM, "enum"},
+			  {TOK_OPAQUE, "opaque"},
+			  {TOK_BOOL, "bool"},
+			  {TOK_VOID, "void"},
+			  {TOK_CHAR, "char"},
+			  {TOK_INT, "int"},
+			  {TOK_UNSIGNED, "unsigned"},
+			  {TOK_SHORT, "short"},
+			  {TOK_LONG, "long"},
+			  {TOK_FLOAT, "float"},
+			  {TOK_DOUBLE, "double"},
+			  {TOK_STRING, "string"},
+			  {TOK_PROGRAM, "program"},
+			  {TOK_VERSION, "version"},
+			  {TOK_EOF, "??????"},
+};
+
+
+static void
+findkind(mark, tokp)
+	char **mark;
+	token *tokp;
+{
+
+	int len;
+	token *s;
+	char *str;
+
+	str = *mark;
+	for (s = symbols; s->kind != TOK_EOF; s++) {
+		len = strlen(s->str);
+		if (strncmp(str, s->str, len) == 0) {
+			if (!isalnum(str[len]) && str[len] != '_') {
+				tokp->kind = s->kind;
+				tokp->str = s->str;
+				*mark = str + len;
+				return;
+			}
+		}
+	}
+	tokp->kind = TOK_IDENT;
+	for (len = 0; isalnum(str[len]) || str[len] == '_'; len++);
+	tokp->str = alloc(len + 1);
+	(void) strncpy(tokp->str, str, len);
+	tokp->str[len] = 0;
+	*mark = str + len;
+}
+
+static int
+cppline(line)
+	char *line;
+{
+	return (line == curline && *line == '#');
+}
+
+static int
+directive(line)
+	char *line;
+{
+	return (line == curline && *line == '%');
+}
+
+static void
+printdirective(line)
+	char *line;
+{
+	f_print(fout, "%s", line + 1);
+}
+
+static void
+docppline(line, lineno, fname)
+	char *line;
+	int *lineno;
+	char **fname;
+{
+	char *file;
+	int num;
+	char *p;
+
+	line++;
+	while (isspace(*line)) {
+		line++;
+	}
+	num = atoi(line);
+	while (isdigit(*line)) {
+		line++;
+	}
+	while (isspace(*line)) {
+		line++;
+	}
+	if (*line != '"') {
+		error("preprocessor error");
+	}
+	line++;
+	p = file = alloc(strlen(line) + 1);
+	while (*line && *line != '"') {
+		*p++ = *line++;
+	}
+	if (*line == 0) {
+		error("preprocessor error");
+	}
+	*p = 0;
+	if (*file == 0) {
+		*fname = NULL;
+	} else {
+		*fname = file;
+	}
+	*lineno = num - 1;
+}
+
+
+/*
+ * scan expecting 1 given token 
+ */
+void
+scan(expect, tokp)
+	tok_kind expect;
+	token *tokp;
+{
+	get_token(tokp);
+	if (tokp->kind != expect) {
+		expected1(expect);
+	}
+}
+
+/*
+ * scan expecting 2 given tokens 
+ */
+void
+scan2(expect1, expect2, tokp)
+	tok_kind expect1;
+	tok_kind expect2;
+	token *tokp;
+{
+	get_token(tokp);
+	if (tokp->kind != expect1 && tokp->kind != expect2) {
+		expected2(expect1, expect2);
+	}
+}
+
+/*
+ * scan expecting 3 given token 
+ */
+void
+scan3(expect1, expect2, expect3, tokp)
+	tok_kind expect1;
+	tok_kind expect2;
+	tok_kind expect3;
+	token *tokp;
+{
+	get_token(tokp);
+	if (tokp->kind != expect1 && tokp->kind != expect2
+	    && tokp->kind != expect3) {
+		expected3(expect1, expect2, expect3);
+	}
+}
+
+
+/*
+ * scan expecting a constant, possibly symbolic 
+ */
+void
+scan_num(tokp)
+	token *tokp;
+{
+	get_token(tokp);
+	switch (tokp->kind) {
+	case TOK_IDENT:
+		break;
+	default:
+		error("constant or identifier expected");
+	}
+}
+
+
+/*
+ * Peek at the next token 
+ */
+void
+peek(tokp)
+	token *tokp;
+{
+	get_token(tokp);
+	unget_token(tokp);
+}
+
+
+/*
+ * Peek at the next token and scan it if it matches what you expect 
+ */
+int
+peekscan(expect, tokp)
+	tok_kind expect;
+	token *tokp;
+{
+	peek(tokp);
+	if (tokp->kind == expect) {
+		get_token(tokp);
+		return (1);
+	}
+	return (0);
+}
+
+
+
+/*
+ * Get the next token, printing out any directive that are encountered. 
+ */
+void
+get_token(tokp)
+	token *tokp;
+{
+	int commenting;
+
+	if (pushed) {
+		pushed = 0;
+		*tokp = lasttok;
+		return;
+	}
+
+	commenting = 0;
+	for (;;) {
+		if (*where == 0) {
+			for (;;) {
+				if (!fgets(curline, MAXLINESIZE, fin)) {
+					tokp->kind = TOK_EOF;
+					*where = 0;
+					return;
+				}
+				linenum++;
+				if (commenting) {
+					break;
+				} else if (cppline(curline)) {
+					docppline(curline, &linenum, 
+						  &infilename);
+				} else if (directive(curline)) {
+					printdirective(curline);
+				} else {
+					break;
+				}
+			}
+			where = curline;
+		} else if (isspace(*where)) {
+			while (isspace(*where)) {
+				where++;	/* eat */
+			}
+		} else if (commenting) {
+			where++;
+			if (endcomment(where)) {
+				where++;
+				commenting--;
+			}
+		} else if (startcomment(where)) {
+			where += 2;
+			commenting++;
+		} else {
+			break;
+		}
+	}
+
+
+	/*
+	 * 'where' is not whitespace, comment or directive Must be a token! 
+	 */
+	switch (*where) {
+	case ':':
+		tokp->kind = TOK_COLON;
+		where++;
+		break;
+	case ';':
+		tokp->kind = TOK_SEMICOLON;
+		where++;
+		break;
+	case ',':
+		tokp->kind = TOK_COMMA;
+		where++;
+		break;
+	case '=':
+		tokp->kind = TOK_EQUAL;
+		where++;
+		break;
+	case '*':
+		tokp->kind = TOK_STAR;
+		where++;
+		break;
+	case '[':
+		tokp->kind = TOK_LBRACKET;
+		where++;
+		break;
+	case ']':
+		tokp->kind = TOK_RBRACKET;
+		where++;
+		break;
+	case '{':
+		tokp->kind = TOK_LBRACE;
+		where++;
+		break;
+	case '}':
+		tokp->kind = TOK_RBRACE;
+		where++;
+		break;
+	case '(':
+		tokp->kind = TOK_LPAREN;
+		where++;
+		break;
+	case ')':
+		tokp->kind = TOK_RPAREN;
+		where++;
+		break;
+	case '<':
+		tokp->kind = TOK_LANGLE;
+		where++;
+		break;
+	case '>':
+		tokp->kind = TOK_RANGLE;
+		where++;
+		break;
+
+	case '"':
+		tokp->kind = TOK_STRCONST;
+		findstrconst(&where, &tokp->str);
+		break;
+
+	case '-':
+	case '0':
+	case '1':
+	case '2':
+	case '3':
+	case '4':
+	case '5':
+	case '6':
+	case '7':
+	case '8':
+	case '9':
+		tokp->kind = TOK_IDENT;
+		findconst(&where, &tokp->str);
+		break;
+
+
+	default:
+
+		if (!(isalpha(*where) || *where == '_')) {
+			char buf[100];
+			char *p;
+
+			s_print(buf, "illegal character in file: ");
+			p = buf + strlen(buf);
+
+			if (isprint(*where)) {
+				s_print(p, "%c", *where);
+			} else {
+				s_print(p, "%d", *where);
+			}
+			error(buf);
+		}
+		findkind(&where, tokp);
+		break;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_scan.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,112 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_scan.h	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/* @(#)rpc_scan.h 1.3 87/03/09 (C) 1987 SMI */
+
+/*
+ * rpc_scan.h, Definitions for the RPCL scanner 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+
+/*
+ * kinds of tokens 
+ */
+enum tok_kind {
+	TOK_IDENT,
+	TOK_STRCONST,
+	TOK_LPAREN,
+	TOK_RPAREN,
+	TOK_LBRACE,
+	TOK_RBRACE,
+	TOK_LBRACKET,
+	TOK_RBRACKET,
+	TOK_LANGLE,
+	TOK_RANGLE,
+	TOK_STAR,
+	TOK_COMMA,
+	TOK_EQUAL,
+	TOK_COLON,
+	TOK_SEMICOLON,
+	TOK_CONST,
+	TOK_STRUCT,
+	TOK_UNION,
+	TOK_SWITCH,
+	TOK_CASE,
+	TOK_DEFAULT,
+	TOK_ENUM,
+	TOK_TYPEDEF,
+	TOK_INT,
+	TOK_SHORT,
+	TOK_LONG,
+	TOK_UNSIGNED,
+	TOK_FLOAT,
+	TOK_DOUBLE,
+	TOK_OPAQUE,
+	TOK_CHAR,
+	TOK_STRING,
+	TOK_BOOL,
+	TOK_VOID,
+	TOK_PROGRAM,
+	TOK_VERSION,
+	TOK_EOF
+};
+typedef enum tok_kind tok_kind;
+
+/*
+ * a token 
+ */
+struct token {
+	tok_kind kind;
+	char *str;
+};
+typedef struct token token;
+
+
+/*
+ * routine interface 
+ */
+void scanprint();
+void scan();
+void scan2();
+void scan3();
+void scan_num();
+void peek();
+int peekscan();
+void get_token();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_svco.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,420 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_svcout.c	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_svcout.c 1.6 87/06/24 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_svcout.c, Server-skeleton outputter for the RPC protocol compiler
+ * Copyright (C) 1987, Sun Microsytsems, Inc. 
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "rpc_pars.h"
+#include "rpc_util.h"
+#include "ae_component_rpc.h"
+
+static char RQSTP[] = "rqstp";
+static char TRANSP[] = "transp";
+static char ARG[] = "argument";
+static char RESULT[] = "result";
+static char ROUTINE[] = "local";
+
+/* prototype */
+int nullproc( proc_list *proc );
+static void printerr( char *err, char *transp );
+static void printif( char *proc, char *transp, char *prefix, char *arg );
+
+/* implementation */
+static void
+write_program(def, storage)
+	definition *def;
+	char *storage;
+{
+	version_list *vp;
+	proc_list *proc;
+	int filled;
+
+#ifdef WIN32_TARGET
+	f_print(fout, "\n#ifdef MULTITHREAD\n");
+	f_print(fout, "\
+struct call_params {\n\
+	struct svc_req *rqstp;\n\
+	SVCXPRT *transp;\n\
+	void *arg;\n\
+	char *(*local)();\n\
+	bool_t (*xdr_argument)(), (*xdr_result)();\n\
+};\n\
+");
+
+	for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
+		if (storage != NULL) {
+			f_print(fout, "%s ", storage);
+		}
+		f_print(fout, "void ");
+		pvname(def->def_name, vp->vers_num);
+		f_print(fout, "_a ();\n");
+	}
+	f_print(fout, "#endif\n");
+		
+#endif
+
+	for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
+		f_print(fout, "\n");
+
+		if (storage != NULL) {
+			f_print(fout, "%s ", storage);
+		}
+		f_print(fout, "void\n");
+		pvname(def->def_name, vp->vers_num);
+		f_print(fout, "(%s, %s)\n", RQSTP, TRANSP);
+		f_print(fout, "	struct svc_req *%s;\n", RQSTP);
+		f_print(fout, "	SVCXPRT *%s;\n", TRANSP);
+		f_print(fout, "{\n");
+
+		filled = 0;
+		f_print(fout, "\tunion {\n");
+		for (proc = vp->procs; proc != NULL; proc = proc->next) {
+			if (streq(proc->arg_type, "void")) {
+				continue;
+			}
+			filled = 1;
+			f_print(fout, "\t\t");
+			ptype(proc->arg_prefix, proc->arg_type, 0);
+			pvname(proc->proc_name, vp->vers_num);
+			f_print(fout, "_arg;\n");
+		}
+		if (!filled) {
+			f_print(fout, "\t\tint fill;\n");
+		}
+		f_print(fout, "\t} %s;\n", ARG);
+		f_print(fout, "\tchar *%s;\n", RESULT);
+		f_print(fout, "\tbool_t (*xdr_%s)(), (*xdr_%s)();\n", ARG, RESULT);
+		f_print(fout, "\tchar *(*%s)();\n", ROUTINE);
+		f_print(fout, "\n");
+
+#ifdef WIN32_TARGET
+		f_print(fout, "\n#ifdef MULTITHREAD\n");
+		f_print(fout, "\
+	DWORD TID = 0;\n\
+	HANDLE threadHandle = NULL;\n\
+	struct call_params	*params;\n");
+		f_print(fout, "#endif\n");
+		
+#endif
+
+		f_print(fout, "\tswitch (%s->rq_proc) {\n", RQSTP);
+
+		if (!nullproc(vp->procs)) {
+			f_print(fout, "\tcase NULLPROC:\n");
+ 			f_print(fout, "\t\t(void)svc_sendreply(%s, (void*)xdr_void, (char *)NULL);\n", TRANSP);
+			f_print(fout, "\t\treturn;\n\n");
+		}
+		for (proc = vp->procs; proc != NULL; proc = proc->next) {
+			f_print(fout, "\tcase %s:\n", proc->proc_name);
+			f_print(fout, "\t\txdr_%s = xdr_%s;\n", ARG, 
+				ae_extend_custom_types(stringfix(proc->arg_type)));
+			f_print(fout, "\t\txdr_%s = xdr_%s;\n", RESULT, 
+				ae_extend_custom_types(stringfix(proc->res_type)));
+			f_print(fout, "\t\t%s = (char *(*)()) ", ROUTINE);
+			pvname(proc->proc_name, vp->vers_num);
+			f_print(fout, ";\n");
+			f_print(fout, "\t\tbreak;\n\n");
+		}
+		f_print(fout, "\tdefault:\n");
+		printerr("noproc", TRANSP);
+		f_print(fout, "\t\treturn;\n");
+		f_print(fout, "\t}\n");
+
+ 		f_print(fout, "\tbzero((char *)&%s, sizeof(%s));\n", ARG, ARG);
+		printif("getargs", TRANSP, "&", ARG);
+		printerr("decode", TRANSP);
+		f_print(fout, "\t\treturn;\n");
+		f_print(fout, "\t}\n");
+
+#ifdef WIN32_TARGET
+		f_print(fout, "\n#ifdef MULTITHREAD\n");
+		f_print(fout, "\
+	params = (struct call_params*) malloc (sizeof(struct call_params));\n\
+\n\
+	params->%s = (struct svc_req*) malloc (sizeof(struct svc_req));\n\
+	bcopy(%s, params->rqstp, sizeof(struct svc_req));\n\
+\n\
+	params->transp = %s;\n\
+\n\
+	params->arg = malloc (sizeof(%s));\n\
+	bcopy(&%s, params->arg, sizeof(%s));\n\
+\n\
+	params->local = %s;\n\
+\n\
+	params->xdr_argument = xdr_%s;\n\
+	params->xdr_result = xdr_%s;\n\
+\n", RQSTP, RQSTP, TRANSP, ARG, ARG, ARG, ROUTINE, ARG, RESULT);
+
+
+		//		f_print(fout, "\threadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)", RQSTP, TRANSP);
+		f_print(fout, "\tthreadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)");
+
+		pvname(def->def_name, vp->vers_num);
+	
+		f_print(fout, "_a, params, 0, &TID);\n\
+	if (!threadHandle)\n\t\t");
+
+		pvname(def->def_name, vp->vers_num);
+
+		f_print(fout, "_a(&params);\n\
+}\n\
+\n\
+static void\n");
+
+		pvname(def->def_name, vp->vers_num);
+
+		f_print(fout, "_a(params)\n\
+struct call_params *params;\n\
+{\n\
+	struct svc_req *%s;\n\
+	SVCXPRT *%s;\n\
+	void *%s;\n", RQSTP, TRANSP, ARG);
+
+		f_print(fout, "\tvoid (*destroy_proc)();\n\n");
+		f_print(fout, "\tchar *%s;\n", RESULT);
+		f_print(fout, "\tbool_t (*xdr_%s)(), (*xdr_%s)();\n", ARG, RESULT);
+		f_print(fout, "\tchar *(*%s)();\n", ROUTINE);
+		f_print(fout, "\n\n");
+
+		f_print(fout, "\t%s = params->arg;\n", ARG);
+		f_print(fout, "\t%s = params->rqstp;\n", RQSTP);
+		f_print(fout, "\t%s = params->transp;\n", TRANSP);
+		f_print(fout, "\txdr_%s = params->xdr_argument;\n", ARG);
+		f_print(fout, "\txdr_%s = params->xdr_result;\n", RESULT);
+		f_print(fout, "\t%s = params->local;\n", ROUTINE);
+
+		f_print(fout, "\tdestroy_proc = %s->xp_ops->xp_destroy;\n", TRANSP);
+		f_print(fout, "\t%s->xp_ops->xp_destroy = xprt_unregister;\n", TRANSP);
+
+		f_print(fout, "#endif\n\n");
+#endif
+		f_print(fout, "\t%s = (*%s)(&%s, %s);\n", RESULT, ROUTINE, ARG,
+			RQSTP);
+		f_print(fout, 
+			"\tif (%s != NULL && !svc_sendreply(%s, (void*)xdr_%s, %s)) {\n",
+			RESULT, TRANSP, RESULT, RESULT);
+		printerr("systemerr", TRANSP);
+		f_print(fout, "\t}\n");
+
+#ifdef WIN32_TARGET
+		f_print(fout, "#ifdef MULTITHREAD\n");
+		f_print(fout, "\tfree(params->rqstp);\n");
+		f_print(fout, "\tfree(params);\n");
+		f_print(fout, "#endif\n");
+#endif
+
+		printif("freeargs", TRANSP, "&", ARG);
+ 		f_print(fout, "\t\t(void)fprintf(stderr, \"unable to free arguments\\n\");\n");
+#ifdef WIN32_TARGET
+		f_print(fout, "#ifdef WIN32\n\t\trpc_nt_exit();\n#endif\n");
+#endif
+		f_print(fout, "\t\texit(1);\n");
+		f_print(fout, "\t}\n");
+
+#ifdef WIN32_TARGET
+		f_print(fout, "#ifdef MULTITHREAD\n");
+		f_print(fout, "\tfree(%s);\n", ARG);
+		f_print(fout, "\ttransp->xp_ops->xp_destroy = destroy_proc;\n");
+		f_print(fout, "#endif\n");
+#endif
+
+		f_print(fout, "}\n\n");
+	}
+}
+
+static void
+printerr(err, transp)
+	char *err;
+	char *transp;
+{
+	f_print(fout, "\t\tsvcerr_%s(%s);\n", err, transp);
+}
+
+static void
+printif(proc, transp, prefix, arg)
+	char *proc;
+	char *transp;
+	char *prefix;
+	char *arg;
+{
+	f_print(fout, "\tif (!svc_%s(%s, (void*)xdr_%s, (void*)%s%s)) {\n",
+		proc, transp, arg, prefix, arg);
+}
+
+int
+nullproc(proc)
+	proc_list *proc;
+{
+	for (; proc != NULL; proc = proc->next) {
+		if (streq(proc->proc_num, "0")) {
+			return (1);
+		}
+	}
+	return (0);
+}
+
+
+/*
+ * write most of the service, that is, everything but the registrations. 
+ */
+void
+write_most()
+{
+	list *l;
+	definition *def;
+	version_list *vp;
+
+	for (l = defined; l != NULL; l = l->next) {
+		def = (definition *) l->val;
+		if (def->def_kind == DEF_PROGRAM) {
+			for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
+				f_print(fout, "\nstatic void ");
+				pvname(def->def_name, vp->vers_num);
+				f_print(fout, "();");
+			}
+		}
+	}
+	f_print(fout, "\n\n");
+	f_print(fout, "int main( void )\n");
+	f_print(fout, "{\n");
+	f_print(fout, "\tSVCXPRT *%s;\n", TRANSP);
+	f_print(fout, "\n");
+#ifdef WIN32_TARGET
+	f_print(fout, "#ifdef WIN32\n\trpc_nt_init();\n#endif\n\n");
+#endif
+	for (l = defined; l != NULL; l = l->next) {
+		def = (definition *) l->val;
+		if (def->def_kind != DEF_PROGRAM) {
+			continue;
+		}
+		for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
+ 			f_print(fout, "\t(void)pmap_unset(%s, %s);\n", def->def_name, vp->vers_name);
+		}
+	}
+}
+
+
+/*
+ * write a registration for the given transport 
+ */
+void
+write_register(transp)
+	char *transp;
+{
+	list *l;
+	definition *def;
+	version_list *vp;
+
+	f_print(fout, "\n");
+	f_print(fout, "\t%s = svc%s_create(RPC_ANYSOCK", TRANSP, transp);
+	if (streq(transp, "tcp")) {
+		f_print(fout, ", 0, 0");
+	}
+	f_print(fout, ");\n");
+	f_print(fout, "\tif (%s == NULL) {\n", TRANSP);
+ 	f_print(fout, "\t\t(void)fprintf(stderr, \"cannot create %s service.\\n\");\n", transp);
+#ifdef WIN32_TARGET
+	f_print(fout, "#ifdef WIN32\n\t\trpc_nt_exit();\n#endif\n");
+#endif
+	f_print(fout, "\t\texit(1);\n");
+	f_print(fout, "\t}\n");
+
+	for (l = defined; l != NULL; l = l->next) {
+		def = (definition *) l->val;
+		if (def->def_kind != DEF_PROGRAM) {
+			continue;
+		}
+		for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
+			f_print(fout,
+				"\tif (!svc_register(%s, %s, %s, ",
+				TRANSP, def->def_name, vp->vers_name);
+			pvname(def->def_name, vp->vers_num);
+			f_print(fout, ", IPPROTO_%s)) {\n",
+				streq(transp, "udp") ? "UDP" : "TCP");
+			f_print(fout,
+ 				"\t\t(void)fprintf(stderr, \"unable to register (%s, %s, %s).\\n\");\n",
+				def->def_name, vp->vers_name, transp);
+#ifdef WIN32_TARGET
+			f_print(fout, "#ifdef WIN32\n\t\trpc_nt_exit();\n#endif\n");
+#endif
+			f_print(fout, "\t\texit(1);\n");
+			f_print(fout, "\t}\n");
+		}
+	}
+}
+
+
+/*
+ * write the rest of the service 
+ */
+void
+write_rest()
+{
+	f_print(fout, "\tsvc_run();\n");
+ 	f_print(fout, "\t(void)fprintf(stderr, \"svc_run returned\\n\");\n");
+#ifdef WIN32_TARGET
+	f_print(fout, "#ifdef WIN32\n\trpc_nt_exit();\n#endif\n");
+#endif
+	f_print(fout, "\texit(1);\n");
+	f_print(fout, "}\n");
+}
+
+void
+write_programs(storage)
+	char *storage;
+{
+	list *l;
+	definition *def;
+
+	for (l = defined; l != NULL; l = l->next) {
+		def = (definition *) l->val;
+		if (def->def_kind == DEF_PROGRAM) {
+			write_program(def, storage);
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_util.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,463 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_util.c	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+//#ifndef lint
+//static char sccsid[] = "@(#)rpc_util.c 1.5 87/06/24 (C) 1987 SMI";
+//#endif
+
+/*
+ * rpc_util.c, Utility routines for the RPC protocol compiler 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <string.h>
+#include "rpc_scan.h"
+#include "rpc_pars.h"
+#include "rpc_util.h"
+#ifndef WIN32
+#include "unistd.h"
+#endif
+
+char curline[MAXLINESIZE];	/* current read line */
+char *where = curline;	/* current point in line */
+int linenum = 0;	/* current line number */
+
+char *infilename;	/* input filename */
+
+#define NFILES 16
+char *outfiles[NFILES];	/* output file names */
+int nfiles;
+
+FILE *fout;	/* file pointer of current output */
+FILE *fin;	/* file pointer of current input */
+
+list *defined;	/* list of defined things */
+
+/* prototypes */
+static void printwhere();
+void crash();
+
+/* implementation */
+static int
+findit(def, type)
+	definition *def;
+	char *type;
+{
+	return (streq(def->def_name, type));
+}
+
+
+static char *
+fixit(type, orig)
+	char *type;
+	char *orig;
+{
+	definition *def;
+
+	def = (definition *) FINDVAL(defined, type, findit);
+	if (def == NULL || def->def_kind != DEF_TYPEDEF) {
+		return (orig);
+	}
+	switch (def->def.ty.rel) {
+	case REL_VECTOR:
+		return (def->def.ty.old_type);
+	case REL_ALIAS:
+		return (fixit(def->def.ty.old_type, orig));
+	default:
+		return (orig);
+	}
+}
+
+char *
+fixtype(type)
+	char *type;
+{
+	return (fixit(type, type));
+}
+
+char *
+stringfix(type)
+	char *type;
+{
+	if (streq(type, "string")) {
+		return ("wrapstring");
+	} else {
+		return (type);
+	}
+}
+
+void
+ptype(prefix, type, follow)
+	char *prefix;
+	char *type;
+	int follow;
+{
+	if (prefix != NULL) {
+		if (streq(prefix, "enum")) {
+			f_print(fout, "enum ");
+		} else {
+			f_print(fout, "struct ");
+		}
+	}
+	if (streq(type, "bool")) {
+		f_print(fout, "bool_t ");
+	} else if (streq(type, "string")) {
+		f_print(fout, "char *");
+	} else {
+		f_print(fout, "%s ", follow ? fixtype(type) : type);
+	}
+}
+
+
+static int
+typedefed(def, type)
+	definition *def;
+	char *type;
+{
+	if (def->def_kind != DEF_TYPEDEF || def->def.ty.old_prefix != NULL) {
+		return (0);
+	} else {
+		return (streq(def->def_name, type));
+	}
+}
+
+int
+isvectordef(type, rel)
+	char *type;
+	relation rel;
+{
+	definition *def;
+
+	for (;;) {
+		switch (rel) {
+		case REL_VECTOR:
+			return (!streq(type, "string"));
+		case REL_ARRAY:
+			return (0);
+		case REL_POINTER:
+			return (0);
+		case REL_ALIAS:
+			def = (definition *) FINDVAL(defined, type, typedefed);
+			if (def == NULL) {
+				return (0);
+			}
+			type = def->def.ty.old_type;
+			rel = def->def.ty.rel;
+		}
+	}
+}
+
+
+char *
+locase(str)
+	char *str;
+{
+	char c;
+	static char buf[100];
+	char *p = buf;
+
+	while ((c = *str++)) {
+		*p++ = (c >= 'A' && c <= 'Z') ? (c - 'A' + 'a') : c;
+	}
+	*p = 0;
+	return (buf);
+}
+
+
+void
+pvname(pname, vnum)
+	char *pname;
+	char *vnum;
+{
+	f_print(fout, "%s_%s", locase(pname), vnum);
+}
+
+
+/*
+ * print a useful (?) error message, and then die 
+ */
+void
+error(msg)
+	char *msg;
+{
+	printwhere();
+	f_print(stderr, "%s, line %d: ", infilename, linenum);
+	f_print(stderr, "%s\n", msg);
+	crash();
+}
+
+/*
+ * Something went wrong, unlink any files that we may have created and then
+ * die. 
+ */
+void 
+crash()
+{
+	int i;
+
+	for (i = 0; i < nfiles; i++) {
+		(void) unlink(outfiles[i]);
+	}
+	exit(1);
+}
+
+
+void
+record_open(file)
+	char *file;
+{
+	if (nfiles < NFILES) {
+		outfiles[nfiles++] = file;
+	} else {
+		f_print(stderr, "too many files!\n");
+		crash();
+	}
+}
+
+static char expectbuf[100];
+static char *toktostr();
+
+/*
+ * error, token encountered was not the expected one 
+ */
+void
+expected1(exp1)
+	tok_kind exp1;
+{
+	s_print(expectbuf, "expected '%s'",
+		toktostr(exp1));
+	error(expectbuf);
+}
+
+/*
+ * error, token encountered was not one of two expected ones 
+ */
+void
+expected2(exp1, exp2)
+	tok_kind exp1, exp2;
+{
+	s_print(expectbuf, "expected '%s' or '%s'",
+		toktostr(exp1),
+		toktostr(exp2));
+	error(expectbuf);
+}
+
+/*
+ * error, token encountered was not one of 3 expected ones 
+ */
+void
+expected3(exp1, exp2, exp3)
+	tok_kind exp1, exp2, exp3;
+{
+	s_print(expectbuf, "expected '%s', '%s' or '%s'",
+		toktostr(exp1),
+		toktostr(exp2),
+		toktostr(exp3));
+	error(expectbuf);
+}
+
+void
+tabify(f, tab)
+	FILE *f;
+	int tab;
+{
+	while (tab--) {
+		(void) fputc('\t', f);
+	}
+}
+
+
+
+static token tokstrings[] = {
+			     {TOK_IDENT, "identifier"},
+			     {TOK_CONST, "const"},
+			     {TOK_RPAREN, ")"},
+			     {TOK_LPAREN, "("},
+			     {TOK_RBRACE, "}"},
+			     {TOK_LBRACE, "{"},
+			     {TOK_LBRACKET, "["},
+			     {TOK_RBRACKET, "]"},
+			     {TOK_STAR, "*"},
+			     {TOK_COMMA, ","},
+			     {TOK_EQUAL, "="},
+			     {TOK_COLON, ":"},
+			     {TOK_SEMICOLON, ";"},
+			     {TOK_UNION, "union"},
+			     {TOK_STRUCT, "struct"},
+			     {TOK_SWITCH, "switch"},
+			     {TOK_CASE, "case"},
+			     {TOK_DEFAULT, "default"},
+			     {TOK_ENUM, "enum"},
+			     {TOK_TYPEDEF, "typedef"},
+			     {TOK_INT, "int"},
+			     {TOK_SHORT, "short"},
+			     {TOK_LONG, "long"},
+			     {TOK_UNSIGNED, "unsigned"},
+			     {TOK_DOUBLE, "double"},
+			     {TOK_FLOAT, "float"},
+			     {TOK_CHAR, "char"},
+			     {TOK_STRING, "string"},
+			     {TOK_OPAQUE, "opaque"},
+			     {TOK_BOOL, "bool"},
+			     {TOK_VOID, "void"},
+			     {TOK_PROGRAM, "program"},
+			     {TOK_VERSION, "version"},
+			     {TOK_EOF, "??????"}
+};
+
+static char *
+toktostr(kind)
+	tok_kind kind;
+{
+	token *sp;
+
+	for (sp = tokstrings; sp->kind != TOK_EOF && sp->kind != kind; sp++);
+	return (sp->str);
+}
+
+
+
+static void
+printbuf()
+{
+	char c;
+	int i;
+	int cnt;
+
+#	define TABSIZE 4
+
+	for (i = 0; (c = curline[i]); i++) {
+		if (c == '\t') {
+			cnt = 8 - (i % TABSIZE);
+			c = ' ';
+		} else {
+			cnt = 1;
+		}
+		while (cnt--) {
+			(void) fputc(c, stderr);
+		}
+	}
+}
+
+
+static void
+printwhere()
+{
+	int i;
+	char c;
+	int cnt;
+
+	printbuf();
+	for (i = 0; i < where - curline; i++) {
+		c = curline[i];
+		if (c == '\t') {
+			cnt = 8 - (i % TABSIZE);
+		} else {
+			cnt = 1;
+		}
+		while (cnt--) {
+			(void) fputc('^', stderr);
+		}
+	}
+	(void) fputc('\n', stderr);
+}
+
+
+/*
+ * Reinitialize the world 
+ */
+void
+reinitialize()
+{
+//AE	bzero(curline, MAXLINESIZE);
+	memset( curline, 0, MAXLINESIZE );
+	where = curline;
+	linenum = 0;
+	defined = NULL;
+}
+
+/*
+ * string equality 
+ */
+int
+streq(a, b)
+	char *a;
+	char *b;
+{
+	return (strcmp(a, b) == 0);
+}
+
+/*
+ * find a value in a list 
+ */
+char *
+findval(lst, val, cmp)
+	list *lst;
+	char *val;
+	int (*cmp) ();
+
+{
+	for (; lst != NULL; lst = lst->next) {
+		if ((*cmp) (lst->val, val)) {
+			return (lst->val);
+		}
+	}
+	return (NULL);
+}
+
+/*
+ * store a value in a list 
+ */
+void
+storeval(lstp, val)
+	list **lstp;
+	char *val;
+{
+	list **l;
+	list *lst;
+
+	for (l = lstp; *l != NULL; l = (list **) & (*l)->next);
+	lst = ALLOC(list);
+	lst->val = val;
+	lst->next = NULL;
+	*l = lst;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpc_util.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,140 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_util.h	2.1 88/08/01 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/* @(#)rpc_util.h 1.6 87/06/24 (C) 1987 SMI */
+
+/*
+ * rpc_util.h, Useful definitions for the RPC protocol compiler 
+ * Copyright (C) 1987, Sun Microsystems, Inc. 
+ */
+#ifndef WIN32
+extern char *malloc();
+#endif
+
+#define alloc(size)		malloc((unsigned)(size))
+#define ALLOC(object)   (object *) malloc(sizeof(object))
+
+#define s_print	(void) sprintf
+#define f_print (void) fprintf
+
+struct list {
+	char *val;
+	struct list *next;
+};
+typedef struct list list;
+
+/*
+ * Global variables 
+ */
+#define MAXLINESIZE 1024
+extern char curline[MAXLINESIZE];
+extern char *where;
+extern int linenum;
+
+extern char *infilename;
+extern FILE *fout;
+extern FILE *fin;
+
+extern list *defined;
+
+/*
+ * rpc_util routines 
+ */
+void storeval();
+
+#define STOREVAL(list,item)	\
+	storeval(list,(char *)item)
+
+char *findval();
+
+#define FINDVAL(list,item,finder) \
+	findval(list, (char *) item, finder)
+
+char *fixtype();
+char *stringfix();
+void pvname();
+void ptype();
+int isvectordef();
+int streq();
+void error();
+void expected1();
+void expected2();
+void expected3();
+void tabify();
+void record_open();
+
+/*
+ * rpc_cout routines 
+ */
+void cprint();
+void emit();
+
+/*
+ * rpc_hout routines 
+ */
+void print_datadef();
+
+/*
+ * rpc_svcout routines 
+ */
+void write_most();
+void write_register();
+void write_rest();
+void write_programs();
+
+/*
+ * rpc_clntout routines
+ */
+void write_stubs();
+
+// AE: flag that turns on my modifications
+struct commandline {
+	int header;
+	int client_flag;
+	int server_flag;
+	int component_base_flag;
+	int component_mod_service_manager;
+	int component_mod_component_impl;
+	int wrapstring_flag;
+	char *infile;
+	char outfile[256];
+};
+void reinitialize();
+extern struct commandline command_line;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpcgen.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,150 @@
+# Microsoft Developer Studio Project File - Name="rpcgen" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=rpcgen - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "rpcgen.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "rpcgen.mak" CFG="rpcgen - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "rpcgen - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "rpcgen - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "rpcgen"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "rpcgen - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\External\source_for_build\oncrpc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\rpcgen.exe"
+
+!ELSEIF  "$(CFG)" == "rpcgen - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\External\source_for_build\oncrpc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\rpcgen.exe" /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "rpcgen - Win32 Release"
+# Name "rpcgen - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\ae_component_rpc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_cout.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_hout.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_main.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_pars.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_scan.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_svco.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_util.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\ae_component_rpc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_pars.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_scan.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rpc_util.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BinInternal/rpcgen/rpcgen.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "rpcgen"=.\rpcgen.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/BWINS/NETWORKEMULATORCONTROL.DEF	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,20 @@
+EXPORTS
+	??0CSetUpCommDb@@QAE@XZ @ 1 NONAME ; CSetUpCommDb::CSetUpCommDb(void)
+	??1CSetUpCommDb@@UAE@XZ @ 2 NONAME ; CSetUpCommDb::~CSetUpCommDb(void)
+	??1CUCCSDeviceControl@@UAE@XZ @ 3 NONAME ; CUCCSDeviceControl::~CUCCSDeviceControl(void)
+	?New@CUCCSDeviceControl@@SAPAV1@XZ @ 4 NONAME ; class CUCCSDeviceControl * CUCCSDeviceControl::New(void)
+	?connectL@CUCCSDeviceControl@@QAEIPAVTDesC16@@W4TDPTransport@@@Z @ 5 NONAME ; unsigned int CUCCSDeviceControl::connectL(class TDesC16 *, enum TDPTransport)
+	?endUseCase@CUCCSDeviceControl@@QAEIIIPAH@Z @ 6 NONAME ; unsigned int CUCCSDeviceControl::endUseCase(unsigned int, unsigned int, int *)
+	?getAsciiEntry@CSetUpCommDb@@QAE?AW4TCommDBError@@VTPtrC16@@K0AAVTDes8@@PAH@Z @ 7 NONAME ; enum TCommDBError CSetUpCommDb::getAsciiEntry(class TPtrC16, unsigned long, class TPtrC16, class TDes8 &, int *)
+	?getBoolEntry@CSetUpCommDb@@QAE?AW4TCommDBError@@VTPtrC16@@K0AAHPAH@Z @ 8 NONAME ; enum TCommDBError CSetUpCommDb::getBoolEntry(class TPtrC16, unsigned long, class TPtrC16, int &, int *)
+	?getIntEntry@CSetUpCommDb@@QAE?AW4TCommDBError@@VTPtrC16@@K0AAKPAH@Z @ 9 NONAME ; enum TCommDBError CSetUpCommDb::getIntEntry(class TPtrC16, unsigned long, class TPtrC16, unsigned long &, int *)
+	?getUnicodeEntry@CSetUpCommDb@@QAE?AW4TCommDBError@@VTPtrC16@@K0AAVTDes16@@PAH@Z @ 10 NONAME ; enum TCommDBError CSetUpCommDb::getUnicodeEntry(class TPtrC16, unsigned long, class TPtrC16, class TDes16 &, int *)
+	?getVariableName@CUCCSDeviceControl@@QAEIPAD0HPAH@Z @ 11 NONAME ; unsigned int CUCCSDeviceControl::getVariableName(char *, char *, int, int *)
+	?initialise@CSetUpCommDb@@QAE?AW4TCommDBError@@XZ @ 12 NONAME ; enum TCommDBError CSetUpCommDb::initialise(void)
+	?rendezvous@CUCCSDeviceControl@@QAEIIPAH@Z @ 13 NONAME ; unsigned int CUCCSDeviceControl::rendezvous(unsigned int, int *)
+	?runCommandL@CUCCSDeviceControl@@QAEIPADPAH@Z @ 14 NONAME ; unsigned int CUCCSDeviceControl::runCommandL(char *, int *)
+	?signal@CUCCSDeviceControl@@QAEIIPAH@Z @ 15 NONAME ; unsigned int CUCCSDeviceControl::signal(unsigned int, int *)
+	?startUseCase@CUCCSDeviceControl@@QAEIIPAH@Z @ 16 NONAME ; unsigned int CUCCSDeviceControl::startUseCase(unsigned int, int *)
+	?updateEntry@CSetUpCommDb@@QAE?AW4TCommDBError@@VTPtrC16@@K0PADPAH@Z @ 17 NONAME ; enum TCommDBError CSetUpCommDb::updateEntry(class TPtrC16, unsigned long, class TPtrC16, char *, int *)
+	?waitfor@CUCCSDeviceControl@@QAEIIPAH@Z @ 18 NONAME ; unsigned int CUCCSDeviceControl::waitfor(unsigned int, int *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/BWINS/UCCCONTROLTEU.DEF	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/EABI/NetworkEmulatorControl.def	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+EXPORTS
+	_ZN12CSetUpCommDb10initialiseEv @ 1 NONAME
+	_ZN12CSetUpCommDb11getIntEntryE7TPtrC16mS0_RmPi @ 2 NONAME
+	_ZN12CSetUpCommDb11updateEntryE7TPtrC16mS0_PcPi @ 3 NONAME
+	_ZN12CSetUpCommDb12getBoolEntryE7TPtrC16mS0_RiPi @ 4 NONAME
+	_ZN12CSetUpCommDb13getAsciiEntryE7TPtrC16mS0_R5TDes8Pi @ 5 NONAME
+	_ZN12CSetUpCommDb15getUnicodeEntryE7TPtrC16mS0_R6TDes16Pi @ 6 NONAME
+	_ZN12CSetUpCommDbC1Ev @ 7 NONAME
+	_ZN12CSetUpCommDbC2Ev @ 8 NONAME
+	_ZN12CSetUpCommDbD0Ev @ 9 NONAME
+	_ZN12CSetUpCommDbD1Ev @ 10 NONAME
+	_ZN12CSetUpCommDbD2Ev @ 11 NONAME
+	_ZN18CUCCSDeviceControl10endUseCaseEjjPi @ 12 NONAME
+	_ZN18CUCCSDeviceControl10rendezvousEjPi @ 13 NONAME
+	_ZN18CUCCSDeviceControl11runCommandLEPcPi @ 14 NONAME
+	_ZN18CUCCSDeviceControl12startUseCaseEjPi @ 15 NONAME
+	_ZN18CUCCSDeviceControl15getVariableNameEPcS0_iPi @ 16 NONAME
+	_ZN18CUCCSDeviceControl3NewEv @ 17 NONAME
+	_ZN18CUCCSDeviceControl6signalEjPi @ 18 NONAME
+	_ZN18CUCCSDeviceControl7waitforEjPi @ 19 NONAME
+	_ZN18CUCCSDeviceControl8connectLEP7TDesC1612TDPTransport @ 20 NONAME
+	_ZN18CUCCSDeviceControlD0Ev @ 21 NONAME
+	_ZN18CUCCSDeviceControlD1Ev @ 22 NONAME
+	_ZN18CUCCSDeviceControlD2Ev @ 23 NONAME
+	_ZTI12CSetUpCommDb @ 24 NONAME ; #<TI>#
+	_ZTI13CTCPTransport @ 25 NONAME ; #<TI>#
+	_ZTI16CSerialTransport @ 26 NONAME ; #<TI>#
+	_ZTI18CUCCSDeviceControl @ 27 NONAME ; #<TI>#
+	_ZTI19CUCCSDeviceProtocol @ 28 NONAME ; #<TI>#
+	_ZTV12CSetUpCommDb @ 29 NONAME ; #<VT>#
+	_ZTV13CTCPTransport @ 30 NONAME ; #<VT>#
+	_ZTV16CSerialTransport @ 31 NONAME ; #<VT>#
+	_ZTV18CUCCSDeviceControl @ 32 NONAME ; #<VT>#
+	_ZTV19CUCCSDeviceProtocol @ 33 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/NetworkEmulatorControl.mmp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+TARGET        networkemulatorcontrol.dll
+CAPABILITY All -Tcb
+TARGETTYPE    dll
+UID           0x1000009d 0x10009B05
+VENDORID 0x70000001
+
+SOURCEPATH		..\..\Source\UCCSDeviceControl
+SOURCE        CSerialTransport.cpp
+SOURCE        CTCPTransport.cpp
+SOURCE        CUCCSDeviceControl.cpp
+SOURCE        CUCCSDeviceProtocol.cpp
+SOURCE        CNetworkEmulatorSetupCommdb.cpp
+
+USERINCLUDE		..\..\Source\UCCSDeviceControl
+USERINCLUDE		..\..\Source\Uccs.v2\DeviceControlChannel
+USERINCLUDE		..\..\Source\Uccs.v2\Core
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+MW_LAYER_SYSTEMINCLUDE_SYMBIAN
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+SYSTEMINCLUDE	\epoc32\include\libc
+SYSTEMINCLUDE	\epoc32\include\libc\arpa
+SYSTEMINCLUDE   \epoc32\include\networkemulator
+
+LIBRARY     euser.lib 
+LIBRARY		c32.lib
+LIBRARY     estlib.lib 
+LIBRARY		commdb.lib
+LIBRARY     charconv.lib 
+LIBRARY		efsrv.lib
+LIBRARY		esock.lib
+LIBRARY		insock.lib
+
+#ifdef WINSCW
+DEFFILE NETWORKEMULATORCONTROL.DEF
+#endif
+
+#ifdef ARMV5
+DEFFILE NetworkEmulatorControl.def
+#endif
+
+
+nostrictdef
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/UCCControlTE.mmp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Using relative paths for sourcepath and user includes
+*
+*/
+
+
+
+TARGET			ucccontrolte.exe
+CAPABILITY All -Tcb
+TARGETTYPE		exe
+UID				0x1000007A 0x101F777C
+VENDORID		0x70000001
+
+SOURCEPATH		..\..\Source\TestExecuteUCCPlugin
+SOURCE			CUCCServer.cpp
+SOURCE			CUCCTest.cpp
+SOURCE			CUCCTestStep.cpp
+
+USERINCLUDE		..\..\Source\TestExecuteUCCPlugin
+USERINCLUDE		..\..\Source\UCCSDeviceControl
+USERINCLUDE		..\..\Source\Uccs.v2\DeviceControlChannel
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+MW_LAYER_SYSTEMINCLUDE_SYMBIAN
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+SYSTEMINCLUDE	\epoc32\include\test
+SYSTEMINCLUDE	\epoc32\include\libc
+SYSTEMINCLUDE	\epoc32\include\networkemulator
+
+LIBRARY			estlib.lib 
+LIBRARY			euser.lib
+LIBRARY			testexecuteutils.lib
+LIBRARY			networkemulatorcontrol.lib 
+LIBRARY			testexecutelogclient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/bld.exports.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,76 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+// Component description file
+// Exports
+//
+PRJ_EXPORTS
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Productised UCC Export
+//
+///////////////////////////////////////////////////////////////////////////
+
+// UCC IBY file
+..\group\ucc.iby   									\epoc32\rom\include\ucc.iby
+
+// UCC binary and example ini file
+..\..\bin\ucc.exe									\epoc32\engineeringtools\ucc\bin\ucc.exe
+..\..\bin\ucc.ini									\epoc32\engineeringtools\ucc\bin\ucc.ini
+
+// UCC NSIS config
+..\group\ucc.configure.nsh							\epoc32\engineeringtools\ucc\ucc.configure.nsh
+
+// Generic service library and header files
+..\..\GenericService\bin\Release\GenericService.lib					\epoc32\engineeringtools\ucc\genericservice\lib\genericservice.lib
+..\..\GenericService\inc\CCall.h							\epoc32\engineeringtools\ucc\genericservice\inc\ccall.h
+..\..\GenericService\inc\CService.h							\epoc32\engineeringtools\ucc\genericservice\inc\cservice.h
+..\..\GenericService\inc\GenericStub.h							\epoc32\engineeringtools\ucc\genericservice\inc\genericstub.h
+
+
+// Sync service binary, configuration ini, interface ini and test script files
+..\..\GenericService\SyncService\bin\Release\SyncService.exe				\epoc32\engineeringtools\ucc\syncservice\bin\syncservice.exe
+..\..\GenericService\SyncService\Configuration\SyncService.ini				\epoc32\engineeringtools\ucc\syncservice\bin\syncservice.ini
+..\..\GenericService\SyncService\Interface\Device\SyncService.ini			\epoc32\engineeringtools\ucc\syncservice\interface\device\syncservice.ini
+..\..\GenericService\SyncService\Interface\Host\SyncServiceInterface.ini		\epoc32\engineeringtools\ucc\syncservice\interface\host\syncserviceinterface.ini
+..\..\GenericService\TestScripts\Synchronisation\Master\master.script			\epoc32\engineeringtools\ucc\syncservice\testscripts\master\master.script
+..\..\GenericService\TestScripts\Synchronisation\Master\SyncService.ini			\epoc32\engineeringtools\ucc\syncservice\testscripts\master\syncservice.ini
+
+// TestDriver service binary and interface ini files
+..\..\GenericService\TestDriverService\bin\Release\TestDriverService.exe		\epoc32\engineeringtools\ucc\testdriverservice\bin\testdriverservice.exe
+..\..\GenericService\TestDriverService\Configuration\TestDriverService.ini		\epoc32\engineeringtools\ucc\testdriverservice\bin\testdriverservice.ini
+..\..\GenericService\TestDriverService\Interface\Device\TestDriverService.ini		\epoc32\engineeringtools\ucc\testdriverservice\interface\device\testdriverservice.ini
+..\..\GenericService\TestDriverService\Interface\Host\TestDriverServiceInterface.ini	\epoc32\engineeringtools\ucc\testdriverservice\interface\host\testdriverserviceinterface.ini
+..\..\GenericService\TestScripts\Synchronisation\Slave\slave.script			\epoc32\engineeringtools\ucc\syncservice\testscripts\slave\slave.script
+..\..\GenericService\TestScripts\Synchronisation\Slave\sampletest.ini			\epoc32\engineeringtools\ucc\syncservice\testscripts\slave\sampletest.ini
+
+// Remote interface library and header files
+..\..\RemoteInterface\bin\Release\RemoteInterface.lib					\epoc32\engineeringtools\ucc\remoteinterface\lib\remoteinterface.lib
+..\..\RemoteInterface\inc\CRemoteInterface.h						\epoc32\engineeringtools\ucc\remoteinterface\inc\cremoteinterface.h
+..\..\RemoteInterface\inc\MUCCTransport.h						\epoc32\engineeringtools\ucc\remoteinterface\inc\mucctransport.h
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Headers For Symbian platform Libraries
+//
+//////////////////////////////////////////////////////////////////////////
+..\..\Source\UCCSDeviceControl\CNetworkEmulatorSetupCommdb.h		\epoc32\include\networkemulator\cnetworkemulatorsetupcommdb.h
+..\..\Source\UCCSDeviceControl\CUCCSDeviceControl.h			\epoc32\include\networkemulator\cuccsdevicecontrol.h
+..\..\Source\UCCSDeviceControl\NetworkEmulatorControl.h			\epoc32\include\networkemulator\networkemulatorcontrol.h
+..\..\Source\Uccs.v2\Core\UCCS_ErrorCodes.h				\epoc32\include\networkemulator\uccs_errorcodes.h
+..\..\Source\UCCSDeviceControl\CUCCSDeviceProtocol.h			\epoc32\include\networkemulator\cuccsdeviceprotocol.h
+..\..\Source\Uccs.v2\DeviceControlChannel\CProtocolTypes.h		\epoc32\include\networkemulator\cprotocoltypes.h
+..\..\Source\UCCSDeviceControl\MUCCTransport.h			\epoc32\include\networkemulator\mucctransport.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,25 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+// Component description file
+// Exports
+//
+
+#include "bld.exports.inf"
+
+PRJ_MMPFILES
+
+NetworkEmulatorControl.mmp
+UCCControlTE.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/release.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,5 @@
+NOTESRC_RELEASER
+Symbian Software Ltd. 
+
+NOTESRC_RELEASE_REASON
+UCC release.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/ucc.configure.nsh	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+;overwrite ucc.ini file with new locations
+FileOpen $R3 "$INSTDIR\UCC\bin\ucc.ini" w
+FileWrite $R3 "[SyncService]$\r$\n"
+FileWrite $R3 "ini = $INSTDIR\UCC\SyncService\Interface\Host\SyncServiceInterface.ini$\r$\n"
+FileWrite $R3 "host = 127.0.0.1$\r$\n$\r$\n"
+FileWrite $R3 "[TestDriverService]$\r$\n"
+FileWrite $R3 "ini = $INSTDIR\UCC\TestDriverService\Interface\Host\TestDriverServiceInterface.ini$\r$\n"
+FileWrite $R3 "host = 127.0.0.1$\r$\n$\r$\n"
+FileClose $R3 ; and close the file
+
+FileOpen $R3 "$INSTDIR\UCC\bin\SyncService.ini" w
+FileWrite $R3 "[SyncService]$\r$\n"
+FileWrite $R3 "Connection = tcp$\r$\n"
+FileWrite $R3 "SerialPort = $\r$\n"
+FileWrite $R3 "IPAddress = 192.168.0.3:3000$\r$\n"
+FileWrite $R3 "Timeout = 60$\r$\n"
+FileWrite $R3 "Poll = 5$\r$\n"
+FileWrite $R3 "STAT = $INSTDIR\stat\bin\stat.dll$\r$\n"
+FileClose $R3 ; and close the file
+
+FileOpen $R3 "$INSTDIR\UCC\bin\TestDriverService.ini" w
+FileWrite $R3 "[TestDriverService]$\r$\n"
+FileWrite $R3 "Exe = $INSTDIR\testdriver\testdriver.cmd$\r$\n"
+FileWrite $R3 "Port = 3002$\r$\n"
+FileWrite $R3 "Poll = 5$\r$\n"
+FileClose $R3 ; and close the file
+
+nsExec::ExecToLog "$INSTDIR\UCC\oncrpc\oncrpc.exe"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/ucc.iby	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+#ifndef __UCC_IBY__
+#define __UCC_IBY__
+
+file=ABI_DIR\DEBUG_DIR\NetworkEmulatorControl.dll	Sys\Bin\NetworkEmulatorControl.dll
+file=ABI_DIR\DEBUG_DIR\UCCControlTE.exe			Sys\Bin\UCCControlTE.exe
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/ucc.mrp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+component	ana_testexec_testexecmgmt_ucc
+
+source		/src/tools/ana/testexec/testexecmgmt/ucc
+binary		/src/tools/ana/testexec/testexecmgmt/ucc/BuildScripts/group all
+exports		/src/tools/ana/testexec/testexecmgmt/ucc/BuildScripts/group
+
+notes_source	/src/tools/ana/testexec/testexecmgmt/ucc/BuildScripts/group/release.txt
+#notes_source	./release.txt
+
+
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr T 
+
+# == end auto-inserted section ==
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildScripts/group/ucc.tdf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tool name="UCC" 
+	description="Use Case Controller"  
+	version="2.1.2001" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="TDF_v1.1.xsd">
+  <properties>
+    <property name="toolType" type="toolLogic" value="console"></property>
+    <property name="Path" type="toolLogic" value="$INSTDIR\ucc\bin"></property>
+    <property name="dirRemove" type="uninstall" value="$INSTDIR\ucc"/>
+  </properties>
+  <templates>
+    <template type="nsis" operation="configure" name="\epoc32\engineeringtools\ucc\ucc.configure.nsh">
+    </template>
+  </templates>
+  <files>
+    <file source="\epoc32\engineeringtools\ucc\docs\sgl.gt0248.135_ucc_user_guide.doc" target="$INSTDIR\ucc\docs"/>
+    <file source="\epoc32\rom\include\ucc.iby" target="$EPOCROOT\epoc32\rom\include"/>
+    <file source="\epoc32\engineeringtools\ucc\bin\ucc.exe" target="$INSTDIR\ucc\bin"/>
+    <file source="\epoc32\engineeringtools\ucc\bin\ucc.ini" target="$INSTDIR\ucc\bin"/>
+    <file source="\epoc32\engineeringtools\ucc\genericservice\lib\genericservice.lib" target="$INSTDIR\ucc\genericservice\lib"/>
+    <file source="\epoc32\engineeringtools\ucc\genericservice\inc\ccall.h" target="$INSTDIR\ucc\genericservice\inc"/>
+    <file source="\epoc32\engineeringtools\ucc\genericservice\inc\cservice.h" target="$INSTDIR\ucc\genericservice\inc"/>
+    <file source="\epoc32\engineeringtools\ucc\genericservice\inc\genericstub.h" target="$INSTDIR\ucc\genericservice\inc"/>    
+    <file source="\epoc32\engineeringtools\ucc\syncservice\bin\syncservice.exe" target="$INSTDIR\ucc\bin"/>
+    <file source="\epoc32\engineeringtools\ucc\syncservice\bin\syncservice.ini" target="$INSTDIR\ucc\bin"/>
+    <file source="\epoc32\engineeringtools\ucc\syncservice\interface\device\syncservice.ini" target="$INSTDIR\ucc\syncservice\interface\device"/>
+    <file source="\epoc32\engineeringtools\ucc\syncservice\interface\host\syncserviceinterface.ini" target="$INSTDIR\ucc\syncservice\interface\host"/>
+    <file source="\epoc32\engineeringtools\ucc\syncservice\testscripts\master\master.script" target="$INSTDIR\ucc\syncservice\testscripts\master"/>
+    <file source="\epoc32\engineeringtools\ucc\syncservice\testscripts\master\syncservice.ini" target="$INSTDIR\ucc\syncservice\testscripts\master"/>
+    <file source="\epoc32\engineeringtools\ucc\testdriverservice\bin\testdriverservice.exe" target="$INSTDIR\ucc\bin"/>
+    <file source="\epoc32\engineeringtools\ucc\testdriverservice\bin\testdriverservice.ini" target="$INSTDIR\ucc\bin"/>
+    <file source="\epoc32\engineeringtools\ucc\testdriverservice\interface\device\testdriverservice.ini" target="$INSTDIR\ucc\testdriverservice\interface\device"/>
+    <file source="\epoc32\engineeringtools\ucc\testdriverservice\interface\host\testdriverserviceinterface.ini" target="$INSTDIR\ucc\testdriverservice\interface\host"/>
+    <file source="\epoc32\engineeringtools\ucc\syncservice\testscripts\slave\slave.script" target="$INSTDIR\ucc\syncservice\testscripts\slave"/>
+    <file source="\epoc32\engineeringtools\ucc\syncservice\testscripts\slave\sampletest.ini" target="$INSTDIR\ucc\syncservice\testscripts\slave"/>
+    <file source="\epoc32\engineeringtools\ucc\remoteinterface\lib\remoteinterface.lib" target="$INSTDIR\ucc\remoteinterface\lib"/>
+    <file source="\epoc32\engineeringtools\ucc\remoteinterface\inc\cremoteinterface.h" target="$INSTDIR\ucc\remoteinterface\inc"/>
+    <file source="\epoc32\engineeringtools\ucc\remoteinterface\inc\mucctransport.h" target="$INSTDIR\ucc\remoteinterface\inc"/>
+    <file source="\epoc32\include\networkemulator\cnetworkemulatorsetupcommdb.h" target="$EPOCROOT\epoc32\include\networkemulator"/>
+    <file source="\epoc32\include\networkemulator\cuccsdevicecontrol.h" target="$EPOCROOT\epoc32\include\networkemulator"/>
+    <file source="\epoc32\include\networkemulator\networkemulatorcontrol.h" target="$EPOCROOT\epoc32\include\networkemulator"/>
+    <file source="\epoc32\include\networkemulator\uccs_errorcodes.h" target="$EPOCROOT\epoc32\include\networkemulator"/>
+    <file source="\epoc32\release\winscw\udeb\networkemulatorcontrol.lib" target="$EPOCROOT\epoc32\release\winscw\udeb"/>
+    <file source="\epoc32\release\winscw\udeb\networkemulatorcontrol.dll" target="$EPOCROOT\epoc32\release\winscw\udeb"/>
+    <file source="\epoc32\release\winscw\udeb\ucccontrolte.exe" target="$EPOCROOT\epoc32\release\winscw\udeb"/>
+    <file source="\epoc32\release\winscw\urel\networkemulatorcontrol.dll" target="$EPOCROOT\epoc32\release\winscw\urel"/>
+    <file source="\epoc32\release\winscw\urel\networkemulatorcontrol.dll.map" target="$EPOCROOT\epoc32\release\winscw\urel"/>
+    <file source="\epoc32\release\winscw\urel\ucccontrolte.exe" target="$EPOCROOT\epoc32\release\winscw\urel"/>
+    <file source="\epoc32\release\winscw\urel\ucccontrolte.exe.map" target="$EPOCROOT\epoc32\release\winscw\urel"/>
+    <file source="\epoc32\release\armv5\lib\networkemulatorcontrol.dso" target="$EPOCROOT\epoc32\release\armv5\lib"/>
+    <file source="\epoc32\release\armv5\lib\networkemulatorcontrol.lib" target="$EPOCROOT\epoc32\release\armv5\lib"/>
+    <file source="\epoc32\release\armv5\lib\networkemulatorcontrol{000a0000}.dso" target="$EPOCROOT\epoc32\release\armv5\lib"/>
+    <file source="\epoc32\release\armv5\lib\networkemulatorcontrol{000a0000}.lib" target="$EPOCROOT\epoc32\release\armv5\lib"/>
+    <file source="\epoc32\release\armv5\udeb\networkemulatorcontrol.dll" target="$EPOCROOT\epoc32\release\armv5\udeb"/>
+    <file source="\epoc32\release\armv5\udeb\networkemulatorcontrol.dll.map" target="$EPOCROOT\epoc32\release\armv5\udeb"/>
+    <file source="\epoc32\release\armv5\udeb\ucccontrolte.exe" target="$EPOCROOT\epoc32\release\armv5\udeb"/>
+    <file source="\epoc32\release\armv5\udeb\ucccontrolte.exe.map" target="$EPOCROOT\epoc32\release\armv5\udeb"/>
+    <file source="\epoc32\release\armv5\urel\networkemulatorcontrol.dll" target="$EPOCROOT\epoc32\release\armv5\urel"/>
+    <file source="\epoc32\release\armv5\urel\networkemulatorcontrol.dll.map" target="$EPOCROOT\epoc32\release\armv5\urel"/>
+    <file source="\epoc32\release\armv5\urel\ucccontrolte.exe" target="$EPOCROOT\epoc32\release\armv5\urel"/>
+    <file source="\epoc32\release\armv5\urel\ucccontrolte.exe.map" target="$EPOCROOT\epoc32\release\armv5\urel"/>
+  </files>
+  <dependencies>
+    <dependency name="ONCRPC"/>
+    <dependency name="STATDesktop"/>
+  </dependencies>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildTools/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,30 @@
+###############################################################################
+#
+# Makefile for 3GNE/BuildTools directory.
+#
+###############################################################################
+
+###############################################################################
+#
+# Definitions
+#
+###############################################################################
+include /home/penuser/3GNetworkEmulator/Makefile.conf
+TOOLS=	
+
+###############################################################################
+#
+# Rules
+#
+###############################################################################
+build:
+	for dir in ${TOOLS}; do \
+		(cd $$dir; ${MAKE} build); \
+	done
+
+clean:
+	for dir in ${TOOLS}; do \
+		(cd $$dir; ${MAKE} clean); \
+	done
+	rm -r -f *~
+
Binary file testexecmgmt/ucc/BuildTools/cleantree.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildTools/cleantree/cleantree.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,254 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Include
+*
+*/
+
+
+
+#include <stdio.h>
+#include <windows.h>
+#include <direct.h>
+#include <assert.h>
+
+/*******************************************************************************
+ *
+ * Local Include
+ *
+ ******************************************************************************/
+#include "cleantree.h"
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXPATHLEN	1024
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef void	(*TProcessFunction)(char*,int); 
+
+/*******************************************************************************
+ *
+ * Prototypes
+ *
+ ******************************************************************************/
+int ProcessDirectoryTree( char *path, int depth, TProcessFunction func );
+int UpdateWorkingDirectory( char *previous, char *next, char *path, int op );
+void PrintPath( char *str, int depth );
+void ProcessFile( char *filename, int depth );
+
+/*******************************************************************************
+ *
+ * Filescope statics
+ *
+ ******************************************************************************/
+static int debug_flag = 0;
+static char *dirname = NULL;
+static int deleted_file_count;
+static int deleted_directory_count;
+
+/*******************************************************************************
+ *
+ * Main
+ *
+ ******************************************************************************/
+int main( int argc, char *argv[] )
+{
+	char fname[1024];
+	int slen;
+
+	// check params
+	if( argc < 3 ) {
+		fprintf( stderr, "usage: cleantree path dirname\n" );
+		return -1;
+	}
+	dirname = argv[2];
+
+	// get the name into the correct format
+	strcpy( fname, argv[1] );
+	slen = strlen(fname);
+	if( (fname[slen-1] != '*') || (fname[slen-2] != '\\') ) {
+		fprintf( stderr, "ERROR: pathname must end in '\\*'.\n" );
+		return -1;
+	}
+
+	// process the directory tree 
+	ProcessDirectoryTree( argv[1], 0, ProcessFile );
+
+	// print stats
+	printf( "%d files deleted from %d directories\n", deleted_file_count, deleted_directory_count );
+
+	// done
+	fflush( stdout );
+	return 0;
+}
+
+/*******************************************************************************
+ *
+ * ProcessFile
+ *
+ ******************************************************************************/
+void ProcessFile( char *filename, int depth )
+{
+	if( debug_flag > 0 ) {
+		unlink( filename );
+		deleted_file_count++;
+	}
+}
+
+/*******************************************************************************
+ *
+ * ProcessDirectoryTree
+ *
+ ******************************************************************************/
+int ProcessDirectoryTree( char *path, int depth, TProcessFunction func )
+{
+	WIN32_FIND_DATA finfo;
+	HANDLE list;
+	int plen;
+	int err = 1;
+	int match;
+	char previous_working_directory[MAXPATHLEN];
+	char new_working_directory[MAXPATHLEN];
+	char fullname[MAXPATHLEN];
+
+	// ignore . and ..
+	if( path[0] == '.' ) {
+		return 0;
+	}
+
+	// ignore any dir beginning with _
+	if( path[0] == '_' ) {
+		return 0;
+	}
+
+	// print the path
+//	PrintPath( path, (depth - 1));
+
+	// check if we are in a debug directory
+	plen = strlen( path );
+	assert( path[plen-1] == '*' );
+	assert( path[plen-2] == '\\' );
+	path[plen-2] = 0;
+	match = strcmp( path, dirname );
+	if( match == 0 ) {
+		debug_flag++;
+	}
+	path[plen-2] = '\\';
+	
+	// get the first file in the directory
+	list = FindFirstFile( path, &finfo );
+	if( list == INVALID_HANDLE_VALUE ) {
+		return 0;
+	}
+
+	// update the current working directory
+	UpdateWorkingDirectory( previous_working_directory, new_working_directory, path, ((depth == 0) ? 1 : 0) );
+
+	// loop through the rest of the files
+	for( err = 1; err != 0; err ) {
+
+		// process the file
+		if( finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) {
+			strcat( finfo.cFileName, "\\*" );
+			ProcessDirectoryTree( finfo.cFileName, depth + 1, func );
+		} else {
+			strcpy( fullname, new_working_directory );
+			strcat( fullname, "\\" );
+			strcat( fullname, finfo.cFileName );
+			func( fullname, depth );
+		}
+
+		// get the info for the next file
+		err = FindNextFile( list, &finfo );
+	}
+
+	// update the working directory and close the directory
+	UpdateWorkingDirectory( previous_working_directory, new_working_directory, path, 2 );
+	FindClose( list );
+
+	// now delete the directory
+	if( match == 0 ) {
+		err = RemoveDirectory( new_working_directory );
+		if( err == 0 ) {
+			fprintf( stderr, "ERROR: failed to remove directory (%d)\n", GetLastError() );
+		}
+		deleted_directory_count++;
+		debug_flag--;
+	}
+
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * UpdateWorkingDirectory
+ *
+ ******************************************************************************/
+int UpdateWorkingDirectory( char *previous, char *next, char *path, int op )
+{
+	int len;
+
+	// op zero means normal PUSH of the working directory
+	if( op == 0 ) {
+		getcwd( previous, MAXPATHLEN );
+		getcwd( next, MAXPATHLEN );
+		len = strlen( next );
+		next[len] = '\\';
+		next[len+1] = 0;
+		strcat( next, path );
+		len = strlen(next);
+		next[len-2] = 0;
+		chdir( next );
+	} 
+
+	// op one is initial set of the dirs
+	if( op == 1 ) {
+		getcwd( previous, MAXPATHLEN );
+		strcpy( next, path );
+		len = strlen(next);
+		next[len-1] = 0;
+		chdir( next );
+	}
+
+	// op two is pop
+	if( op == 2 ) {
+		chdir( previous );
+	}
+
+	// done
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * Print Path
+ *
+ ******************************************************************************/
+void PrintPath( char *str, int depth )
+{
+	for( int i = 0; i < (depth - 1); i++ )
+		printf( "\t" );
+	printf( "%s\n", str );
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildTools/cleantree/cleantree.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,106 @@
+# Microsoft Developer Studio Project File - Name="cleantree" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=cleantree - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "cleantree.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "cleantree.mak" CFG="cleantree - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "cleantree - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "cleantree - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "cleantree"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "cleantree - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\..\BinInternal\cleantree.exe"
+
+!ELSEIF  "$(CFG)" == "cleantree - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\..\BinInternal\cleantreed.exe" /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "cleantree - Win32 Release"
+# Name "cleantree - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\cleantree.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\cleantree.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildTools/cleantree/cleantree.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "cleantree"=.\cleantree.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildTools/cleantree/cleantree.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __SYNCTREE_H__
+#define __SYNCTREE_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <time.h>
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define ERR_OPENFILEFAILED		-100
+#define ERR_RECVFAILED			-101
+#define ERR_SENDHEADERFAILED	-102
+#define ERR_SENDFILENAMEFAILED	-103
+#define ERR_FILEREJECTED		-104
+#define ERR_CREATESOCKETFAILED	-105
+#define ERR_STATFAILED			-106
+#define ERR_RECEIVEHEADERFAILED	-107
+#define ERR_SENDFAILED			-108
+#define ERR_OPENPORTFAILED		-109
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef enum {
+	FTC_REQUESTSEND = 1,
+	FTC_ALLOWSEND = 2,
+	FTC_REJECTSEND = 3,
+	FTC_EXECUTESCRIPT = 4
+} TFileTransferCommand;
+
+typedef struct {
+	TFileTransferCommand iCommand;
+	int iFileLength;
+	time_t iTimeLastModified;
+	int iFilenameLength;
+} TFileTransferHeader;
+
+
+/*******************************************************************************
+ *
+ * SyncFile
+ *
+ ******************************************************************************/
+int SyncFile( char *portname, char *filename, int *errcode );
+int RecvSyncFile( char *portname, int *errcode );
+int RunScript( char *portname, char *filename, int *errcode );
+
+#endif //__SYNCTREE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/BuildTools/readme.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1 @@
+All custom tools used by the build process should have their source here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/Common/inc/CUCCIniFile.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CUCCININFILE_H__
+#define __CUCCININFILE_H__
+
+#include <vector>
+#include <string>
+
+using std::string;
+using std::vector;
+
+class CUCCIniFile  
+{
+	public:
+		CUCCIniFile();
+		CUCCIniFile(const string& strName);
+		~CUCCIniFile();
+
+		void SetIniFileName(const string& strName);
+		bool KeyValue(const string& strKey, const string& strSection, string& value) const;
+		bool KeyValue(const string& strKey, const string& strSection, int& value) const;
+		
+		vector<string> SectionNames() const;
+		vector<string> SectionParameters(const string& strSection) const;
+
+	private:
+		string iIniFileName;
+};
+
+#endif //__CUCCININFILE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/Common/src/CUCCIniFile.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CUCCIniFile.h
+*
+*/
+
+
+
+#include <afxcoll.h>
+#include <assert.h>
+
+#include "CUCCIniFile.h"
+
+#define MAX_BUFFER_SIZE 1024
+
+CUCCIniFile::CUCCIniFile()
+{
+}
+
+CUCCIniFile::CUCCIniFile(const string& strName)
+{
+	SetIniFileName( strName );
+}
+
+CUCCIniFile::~CUCCIniFile()
+{
+}
+
+void CUCCIniFile::SetIniFileName(const string& strName)
+{
+	assert( strName.size() != 0 );
+	iIniFileName = strName;
+}
+
+bool CUCCIniFile::KeyValue(const string& strKey,const string& strSection, string& value ) const
+{
+	TCHAR result[MAX_BUFFER_SIZE];
+	int ret = GetPrivateProfileString(	(LPCTSTR)strSection.c_str(),
+										(LPCTSTR)strKey.c_str(),
+										_T(""),
+										result,
+										MAX_BUFFER_SIZE,
+										(LPCTSTR)iIniFileName.c_str());
+
+	if( ret>0 )
+	{
+		value = result;
+	}
+	return ret>0?true:false;
+}
+
+bool CUCCIniFile::KeyValue(const string& strKey, const string& strSection, int& value) const
+{
+	char* stopstring = NULL;
+	string tmpKeyValue;
+
+	bool ret = KeyValue( strKey, strSection, tmpKeyValue );
+	if( ret )
+	{
+		// Check to see if the input value is in hex
+		if( tmpKeyValue[0] == '0' && tmpKeyValue[1] == 'x' )
+		{
+			value = strtol(tmpKeyValue.c_str()+2, &stopstring, 16 );
+		}
+		else
+		{
+			value = strtol(tmpKeyValue.c_str(), &stopstring, 10 );
+		}
+	}
+	return ret;
+}
+
+vector<string> CUCCIniFile::SectionNames() const
+{
+	TCHAR result[MAX_BUFFER_SIZE];
+	long lRetValue = GetPrivateProfileSectionNames(	result,
+													MAX_BUFFER_SIZE,
+													(LPCTSTR)iIniFileName.c_str());
+
+	// Return a vector of all the section names
+	vector<string> sections;
+
+	int pos = 0;
+	while( pos <= MAX_BUFFER_SIZE )
+	{
+		string section = (char*)(result+pos);
+		if( section.size() > 0 )
+		{
+			sections.push_back( section );
+			pos +=section.size()+1;
+		}
+		else
+		{
+			break;
+		}
+	}
+
+	return sections;
+}
+
+vector<string> CUCCIniFile::SectionParameters(const string& strSection) const
+{
+	TCHAR result[MAX_BUFFER_SIZE];
+	long lRetValue = GetPrivateProfileString(	(LPCTSTR)strSection.c_str(),
+												NULL,
+												_T(""),
+												result,
+												MAX_BUFFER_SIZE,
+												(LPCTSTR)iIniFileName.c_str());
+
+	// Return a vector of parameters
+	vector<string> params;
+
+	int pos = 0;
+	while( pos <= MAX_BUFFER_SIZE )
+	{
+		string param = (char*)(result+pos);
+		if( param.size() > 0 )
+		{
+			params.push_back( param );
+			pos +=param.size()+1;
+		}
+		else
+		{
+			break;
+		}
+	}
+
+	return params;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/GenericService.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,148 @@
+# Microsoft Developer Studio Project File - Name="GenericService" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=GenericService - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "GenericService.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "GenericService.mak" CFG="GenericService - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "GenericService - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "GenericService - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "GenericService - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "./bin/Release"
+# PROP Intermediate_Dir "./bin/Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../../inc" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "GenericService - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "./bin/Debug"
+# PROP Intermediate_Dir "./bin/Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../../inc" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "GenericService - Win32 Release"
+# Name "GenericService - Win32 Debug"
+# Begin Group "src"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\CCall.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\CSGenericstub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\CSvcGenericstub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\GenericStub_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\GenericStub_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\GenericStub_xdr.c
+# End Source File
+# End Group
+# Begin Group "inc"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\CCall.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\CComponentManager.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\CService.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\CSGenericstub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\CSvcGenericstub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\GenericStub.h
+# End Source File
+# End Group
+# Begin Group "libs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\testtoolsconn\oncrpc\binaries_for_build\oncrpcms.lib
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/GenericService.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,74 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "GenericService"=.\GenericService.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "SyncService"=.\SyncService\SyncService.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name GenericService
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "TestDriverService"=.\TestDriverService\TestDriverService.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name GenericService
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "TestService"=.\TestService\TestService.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name GenericService
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/Configuration/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,8 @@
+[SyncService]
+Connection=serial
+SerialPort=COM1
+IPAddress=169.254.159.234:3000
+Timeout=60
+Poll=2
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/Interface/Device/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+CommPortIndex=3
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=SharedData
+param_name_2=VALUE
+param_value_2=HelloWorld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/Interface/Host/SyncServiceInterface.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,17 @@
+[SyncService]
+ServiceIID=0x34630888
+Version=1
+
+[StartSyncTestCase]
+CallID=1
+
+[RetrieveSyncTestCaseResult]
+CallID=2
+
+[SetSharedData]
+CallID=3
+NAME=1
+VALUE=1
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/Interface/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/SyncService.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,134 @@
+# Microsoft Developer Studio Project File - Name="SyncService" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SyncService - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SyncService.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SyncService.mak" CFG="SyncService - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SyncService - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "SyncService - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "SyncService - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "./bin/Release"
+# PROP Intermediate_Dir "./bin/Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../inc" /I "..\..\..\..\testtoolsconn\stat\desktop\source\lib\inc" /I "../Common/inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /machine:I386 /nodefaultlib:"libcd.lib"
+
+!ELSEIF  "$(CFG)" == "SyncService - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "./bin/Debug"
+# PROP Intermediate_Dir "./bin/Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../inc" /I "..\..\..\..\testtoolsconn\stat\desktop\source\lib\inc" /I "../Common/inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "SyncService - Win32 Release"
+# Name "SyncService - Win32 Debug"
+# Begin Group "src"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\CSyncService.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\Common\src\CUCCIniFile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\SyncService.c
+# End Source File
+# End Group
+# Begin Group "inc"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\CSyncService.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\Common\inc\CUCCIniFile.h
+# End Source File
+# End Group
+# Begin Group "libs"
+
+# PROP Default_Filter ""
+# Begin Group "debug"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Debug\GenericService.lib
+# End Source File
+# End Group
+# Begin Group "release"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Release\GenericService.lib
+# End Source File
+# End Group
+# End Group
+# End Target
+# End Project
Binary file testexecmgmt/ucc/GenericService/SyncService/bin/Debug/SyncService.exe has changed
Binary file testexecmgmt/ucc/GenericService/SyncService/bin/Release/SyncService.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/inc/CSyncService.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CSYNCSERVICE_H__
+#define __CSYNCSERVICE_H__
+
+// Define _WINSOCK2API_ so windows.h doesn't include it.
+// This fixes compilations errors due to winsock.h being
+//  included by the ONC RPC static library.
+#define _WINSOCK2API_
+#include <windows.h>
+#include <STATExp.h>
+#include <string>
+
+#include "CService.h"
+
+// Define some error codes specific to this service
+#define ERR_STAT							-100
+#define ERR_STAT_START_SYNC_TEST_CASE		-101
+#define ERR_STAT_RETRIEVE_SYNC_TEST_RESULT	-102
+#define ERR_STAT_RETRIEVE_SYNC_TEST_STATUS	-103
+#define ERR_STAT_SET_SHARED_DATA			-104
+
+class CSyncService : public CService
+	{
+public:
+	CSyncService();
+	~CSyncService();
+
+	virtual bool Setup();
+
+	// Handle the parsing/running of particular commands
+	virtual int RunCommand( const CCall& aCall );
+
+private:
+	HMODULE					ihLib;
+	PROC_SENDRAWCOMMAND		iptrSendRawCommand;
+	PROC_GETTEFSHAREDDATA	iptrGetTEFSharedData;
+	PROC_CONNECT			iptrConnect;
+	PROC_DISCONNECT			iptrDisconnect;
+
+	int						iConnection;
+	STATConnectType			iConnectionType;
+	string					iComPort;
+	string					iIPAddress;
+	string					iSTATDLLLocation;
+
+	int						iTimeout;
+	int						iPollInterval;
+
+	bool	RetrieveCommsInfo();
+	int		StartSyncTestCase( const CCall& aCall );
+	int		RetrieveSyncTestCaseResult( const CCall& aCall );
+	int		SetSharedData( const CCall& aCall );
+	};
+
+#endif // __CSYNCSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/src/CSyncService.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,591 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSyncService.h
+*
+*/
+
+
+
+#include <stdio.h>
+#include <crtdbg.h>
+#include <time.h>
+
+#include "CSyncService.h"
+#include "CUCCIniFile.h"
+
+// Parameters names
+const char	KSharedDataName[]				= { "NAME" };
+const char	KSharedDataValue[]				= { "VALUE" };
+
+
+// Sync Service ini file
+const char	KSyncServiceIni[]				= { ".\\SyncService.ini" };
+const char	KIniSectionName[]				= { "SyncService" };
+const char	KIniConnection[]				= { "Connection" };
+const char	KIniSerialPort[]				= { "SerialPort" };
+const char	KIniIPAddress[]					= { "IPAddress" };
+const char	KSerial[]						= { "serial" };
+const char	KInfrared[]						= { "ir" };
+const char	KBluetooth[]					= { "bt" };
+const char	KSocket[]						= { "tcp" };
+const char	KTimeout[]						= { "Timeout" };
+const char	KPoll[]							= { "Poll" };
+const char	KSTATLocation[]					= { "STAT" };
+
+// Timeout defaults (in seconds)
+const int	KDefaultTimeout					= 120;
+const int	KDefaultPollInterval			= 10;
+
+// STAT DLL Location
+#ifdef _DEBUG
+const char	KDefaultSTATDLLLocation[]		= { "\\epoc32\\tools\\stat\\statd.dll" };
+#else
+const char	KDefaultSTATDLLLocation[]		= { "\\epoc32\\tools\\stat\\stat.dll" };
+#endif
+
+// STAT Sync calls
+const char	KStartSyncTestCase[]			= { "<B><OTEFStatus,4><E>" };
+const char	KStartSyncComplete[]			= { "<B><OTEFStatus,2><E>" };
+const char	KRetrieveSyncTestCaseResult[]	= { "<B><NTEFResult><E>" };
+const char	KRetrieveSyncTestCaseStatus[]	= { "<B><NTEFStatus><E>" };
+const char	KSetSharedData[]				= { "<B><O" };
+const char	KCommandTerminate[]				= { "><E>" };
+const char	KComma[]						= { "," };
+
+const int	KMaxSharedDataLength			= 2048;
+
+// Possible TEF synchronised test case error codes
+const int	EPass							= 0;		
+const int	EFail							= 106;
+const int	EInconclusive					= 107;
+const int	ETestSuiteError					= 108;
+const int	EAbort							= 109;
+const int	EIgnore							= 110;
+
+// TEF Sync Status codes
+enum TSyncStatus
+	{
+	ETEFSyncUnknown		= 0,
+	ETEFSyncRunning		= 1,
+	ETEFSyncComplete	= 2,
+	ETEFSyncWaiting		= 3,
+	ETEFSyncContinue	= 4,
+	ETEFRetrieveResult	= 5
+	};
+
+CService* Service() { return new CSyncService(); }
+
+CSyncService::CSyncService()
+	: ihLib(NULL), iptrConnect(NULL), iptrDisconnect(NULL), iptrSendRawCommand(NULL),
+		iptrGetTEFSharedData(NULL), iConnection(0), iTimeout(KDefaultTimeout),
+		iPollInterval(KDefaultPollInterval), iSTATDLLLocation(KDefaultSTATDLLLocation)
+	{
+	}
+
+CSyncService::~CSyncService()
+	{
+	// Free the STAT DLL library
+	if( ihLib != NULL )
+		{
+		::FreeLibrary( ihLib );
+		ihLib =	NULL;
+		}
+	}
+
+bool CSyncService::Setup()
+	{
+	bool ret = true;
+
+	ret = RetrieveCommsInfo();
+	if(!ret)
+		return ret;
+
+	// Load the STAT DLL library.
+	ihLib					= ::LoadLibrary( iSTATDLLLocation.c_str() );
+	iptrConnect				= reinterpret_cast<PROC_CONNECT>(::GetProcAddress( ihLib, ProcConnect ));
+	iptrDisconnect			= reinterpret_cast<PROC_DISCONNECT>(::GetProcAddress( ihLib, ProcDisconnect ));
+	iptrSendRawCommand		= reinterpret_cast<PROC_SENDRAWCOMMAND>(::GetProcAddress( ihLib, ProcSendRawCommand ));
+	iptrGetTEFSharedData	= reinterpret_cast<PROC_GETTEFSHAREDDATA>(::GetProcAddress( ihLib, ProcGetTEFSharedData ));
+
+	if( ihLib == NULL ||
+		iptrConnect == NULL || 
+		iptrDisconnect == NULL ||
+		iptrSendRawCommand == NULL ||
+		iptrGetTEFSharedData == NULL )
+		{
+		ret = false;
+		}
+	return ret;
+	}
+
+int CSyncService::RunCommand( const CCall& aCall )
+	{
+	int ret = ERR_NONE;
+
+	// Connect to the device via STAT
+	if( !iConnection )
+		{
+		if( iConnectionType == SymbianSerial ||
+			iConnectionType == SymbianInfrared ||
+			iConnectionType == SymbianBluetooth )
+			{
+			iConnection = (iptrConnect)(iConnectionType,iComPort.c_str(),NULL,NULL);
+			}
+		else if( iConnectionType == SymbianSocket )
+			{
+			iConnection = (iptrConnect)(iConnectionType,iIPAddress.c_str(),NULL,NULL);
+			}
+		}
+
+	if( !iConnection )
+		{
+		ret = ERR_STAT;
+		}
+
+	int callID = -1;
+	if( aCall.CallID( callID ) && ret == ERR_NONE )
+		{
+		switch( callID )
+			{
+			case 1: // StartSyncTestCase
+				{
+				ret = StartSyncTestCase( aCall );
+				}
+				break;
+			case 2: // RetrieveSyncTestCaseResult
+				{
+				ret = RetrieveSyncTestCaseResult( aCall );
+				}
+				break;
+			case 3: // SetSharedData
+				{
+				ret = SetSharedData( aCall );
+				}
+				break;
+			default:
+				{
+				#ifdef _DEBUG
+				printf( "Unknown CallID\n" );
+				#endif
+				ret = ERR_INVALID_CALL;
+				}
+			}
+		}
+	else
+		{
+		ret = ERR_GENERAL;
+		}
+
+	// Disconnect the device via STAT
+	if( iConnection )
+		{
+		int disconnectOK;
+		disconnectOK = (iptrDisconnect)(iConnection);
+		if( !disconnectOK )
+			{
+			ret = ERR_STAT;
+			}
+		else
+			{
+			iConnection = 0;
+			}
+		}
+
+	return ret;
+}
+
+bool CSyncService::RetrieveCommsInfo()
+	{
+	bool ret = false;
+
+	// Load the configuration information file
+	CUCCIniFile iniFile( KSyncServiceIni );
+
+	// Retrieve the connection type
+	string connectionType;
+	if( iniFile.KeyValue(KIniConnection, KIniSectionName, connectionType) )
+		{
+			if( connectionType == KSerial )
+				{
+				iConnectionType = SymbianSerial;
+				ret = true;
+				}
+			else if( connectionType == KInfrared )
+				{
+				iConnectionType = SymbianInfrared;
+				ret = true;
+				}
+			else if( connectionType == KBluetooth )
+				{
+				iConnectionType = SymbianBluetooth;
+				ret = true;
+				}
+			else if( connectionType == KSocket )
+				{
+				iConnectionType = SymbianSocket;
+				ret = true;
+				}
+			else
+				{
+				iConnectionType = SymbianInvalid;
+				}
+		}
+	else
+		{
+		ret = false;
+		}
+
+	// Retrieve either the com port or the ip address
+	if( ret )
+		{
+		if( iConnectionType == SymbianSerial ||
+			iConnectionType == SymbianInfrared ||
+			iConnectionType == SymbianBluetooth )
+			{
+			if( !iniFile.KeyValue(KIniSerialPort, KIniSectionName, iComPort) )
+				{
+				ret = false;
+				}
+			}
+		else if( iConnectionType == SymbianSocket )
+			{
+			if( !iniFile.KeyValue(KIniIPAddress, KIniSectionName, iIPAddress) )
+				{
+				ret = false;
+				}
+			}
+		}
+
+	// Finally retrieve the timeout, poll interval and STAT DLL location values (all optional)
+	if( ret )
+		{
+		// Timeout
+		int timeout = 0;
+		if( iniFile.KeyValue(KTimeout, KIniSectionName, timeout) )
+			{
+			if( timeout > 0 )
+				{
+				iTimeout = timeout;
+				}
+			}
+
+		// Poll Interval
+		int pollInterval = 0;
+		if( iniFile.KeyValue(KPoll, KIniSectionName, pollInterval) )
+			{
+			if( pollInterval > 0 )
+				{
+				iPollInterval = pollInterval;
+				}
+			}
+
+		// STAT DLL Location
+		string statDLLLocation;
+		if( iniFile.KeyValue(KSTATLocation, KIniSectionName, statDLLLocation) )
+			{
+			if( statDLLLocation.length() > 0 )
+				{
+				iSTATDLLLocation.erase();
+				iSTATDLLLocation = statDLLLocation;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+int	CSyncService::StartSyncTestCase( const CCall& aCall )
+	{
+	int ret = ERR_NONE;
+
+	printf( "StartSyncTestCase call\n" );
+
+	// Wait until the status is set to WAITING
+	// ie. The next test case is waiting
+	// Make the RetrieveSyncTestCaseStatus call
+
+	// Poll for the TEF Sync Status
+	bool tefContinue = false;
+	int sendRawOK =	(iptrSendRawCommand)(	iConnection,
+											KRetrieveSyncTestCaseStatus,
+											NULL);
+
+	TSyncStatus TEFstatus = ETEFSyncUnknown;
+	if( sendRawOK == ITS_OK )
+		{
+		const char* result = (iptrGetTEFSharedData)( iConnection );
+		if( result != NULL )
+			{
+			TEFstatus = (TSyncStatus)atoi( result );
+			if( TEFstatus == ETEFSyncWaiting )
+				{
+				tefContinue = true;
+				}
+			}
+		}
+
+	// Poll for the test case status
+	time_t end_time, cur_time;
+	time(&cur_time);
+	end_time = cur_time + iTimeout;
+	while(	!tefContinue &&	end_time-cur_time > 0 )
+		{
+		// Delay before next attempt
+		Sleep( iPollInterval * 1000 );
+
+		// Make the RetrieveSyncTestCaseStatus call (poll)
+		sendRawOK =	(iptrSendRawCommand)(	iConnection,
+											KRetrieveSyncTestCaseStatus,
+											NULL);
+		if( sendRawOK == ITS_OK )
+			{
+			const char* result = (iptrGetTEFSharedData)( iConnection );
+			if( result != NULL )
+				{
+				TEFstatus = (TSyncStatus)atoi( result );
+				if( TEFstatus == ETEFSyncWaiting )
+					{
+					tefContinue = true;
+					}
+				}
+			}
+
+		// Update the current time
+		time(&cur_time);
+		}
+	
+	if( sendRawOK == ITS_OK && TEFstatus == ETEFSyncWaiting )
+		{
+		// Make the StartSyncTestCase call
+		int sendRawOK = (iptrSendRawCommand)(	iConnection,
+												KStartSyncTestCase,
+												NULL);
+		if( sendRawOK != ITS_OK )
+			{
+			ret = ERR_STAT_START_SYNC_TEST_CASE;
+			}
+		}
+	else
+		{
+			ret = ERR_STAT_RETRIEVE_SYNC_TEST_STATUS;
+		}
+
+	return ret;
+	}
+
+int	CSyncService::RetrieveSyncTestCaseResult( const CCall& aCall )
+	{
+	int ret = ERR_NONE;
+
+	printf( "RetrieveSyncTestCaseResult call\n" );
+
+	// Wait until the status is set to either COMPLETE or WAITING
+	// ie. The sync test case has completed or the next one is waiting
+	// Make the RetrieveSyncTestCaseStatus call
+
+	// Poll for the TEF Sync Status
+	bool tefContinue = false;
+	int sendRawOK =	(iptrSendRawCommand)(	iConnection,
+											KRetrieveSyncTestCaseStatus,
+											NULL);
+
+	TSyncStatus TEFstatus = ETEFSyncUnknown;
+	if( sendRawOK == ITS_OK )
+		{
+		const char* result = (iptrGetTEFSharedData)( iConnection );
+		if( result != NULL )
+			{
+			TEFstatus = (TSyncStatus)atoi( result );
+			if( TEFstatus == ETEFRetrieveResult )
+				{
+				tefContinue = true;
+				}
+			}
+		}
+
+	// Poll for the test case status
+	time_t end_time, cur_time;
+	time(&cur_time);
+	end_time = cur_time + iTimeout;
+	while(	!tefContinue &&	(end_time-cur_time > 0) )
+		{
+		// Delay before next attempt
+		Sleep( iPollInterval * 1000 );
+
+		// Make the RetrieveSyncTestCaseStatus call (poll)
+		sendRawOK =	(iptrSendRawCommand)(	iConnection,
+											KRetrieveSyncTestCaseStatus,
+											NULL);
+		if( sendRawOK == ITS_OK )
+			{
+			const char* result = (iptrGetTEFSharedData)( iConnection );
+			if( result != NULL )
+				{
+				TEFstatus = (TSyncStatus)atoi( result );
+				if( TEFstatus == ETEFRetrieveResult )
+					{
+					tefContinue = true;
+					}
+				}
+			}
+
+		// Update the current time
+		time(&cur_time);
+		}
+
+	if( sendRawOK == ITS_OK && TEFstatus == ETEFRetrieveResult )
+		{
+		// Make the RetrieveSyncTestCaseResult call
+		int sendRawOK =	(iptrSendRawCommand)(	iConnection,
+												KRetrieveSyncTestCaseResult,
+												NULL);
+
+		// Check what was returned from TEF
+		if( sendRawOK == ITS_OK )
+			{
+			// Now retrieve the TEF Shared data from STAT
+			// In the is case the shared data stores the synchronised
+			//  test case result as an integer.
+			// Set the ret value to equal to this.
+			const char* result = (iptrGetTEFSharedData)( iConnection );
+			int TEFret = EInconclusive;
+			if( result != NULL )
+				{
+				TEFret = atoi( result );
+				}
+
+			// Map the code onto the return value
+			switch( TEFret )
+				{
+				case EPass:
+				case EFail:
+				case EInconclusive:
+				case ETestSuiteError:
+				case EAbort:
+				case EIgnore:
+					{
+					ret = TEFret;
+					}
+					break;
+				default:
+					{
+					ret = EFail;
+					}
+					break;
+				}
+			
+			// Update the status so TEF can continue
+			int sendRawOK = (iptrSendRawCommand)(	iConnection,
+													KStartSyncComplete,
+													NULL);
+			if( sendRawOK != ITS_OK )
+				{
+				ret = ERR_STAT_START_SYNC_TEST_CASE;
+				}
+			}
+		else
+			{
+			ret = ERR_STAT_RETRIEVE_SYNC_TEST_RESULT;			
+			}
+		}
+	else
+		{
+		ret = ERR_STAT_RETRIEVE_SYNC_TEST_STATUS;			
+		}
+
+	return ret;
+	}
+
+int	CSyncService::SetSharedData( const CCall& aCall )
+	{
+	int ret = ERR_NONE;
+
+	#ifdef _DEBUG
+	printf( "SetSharedData call\n" );
+	#endif
+
+	int numParams = 0;
+	bool callRet = aCall.Params( numParams );
+	if( numParams == 2 )
+		{
+		string paramName;
+		string sharedDataName;
+		string paramValue;
+		string sharedDataValue;
+
+		// Retrieve the shared data name
+		if( aCall.Name(0, paramName) && aCall.Value(0, sharedDataName) )
+			{
+			if( paramName != KSharedDataName )
+				{
+				ret = ERR_INVALIDARG;
+				}
+			}
+		else
+			{
+			ret = ERR_INVALIDARG;
+			}
+
+		// Retrieve the shared data value
+		if( ret == 0 )
+			{
+			if( aCall.Name(1, paramValue) && aCall.Value(1, sharedDataValue) )
+				{
+				if( paramValue != KSharedDataValue )
+					{
+					ret = ERR_INVALIDARG;
+					}
+				}
+			else
+				{
+				ret = ERR_INVALIDARG;
+				}
+			}
+
+		// Send the shared data (name and value) via STAT
+		if( ret == 0 )
+			{
+			if( sharedDataValue.size() > 0 )
+				{
+				// Construct the call
+				string sharedDataCall;
+				sharedDataCall += KSetSharedData;
+				sharedDataCall += sharedDataName;
+				sharedDataCall += KComma;
+				sharedDataCall += sharedDataValue;
+				sharedDataCall += KCommandTerminate;
+
+				// Make the SetSharedData call
+				int sendRawOK = (iptrSendRawCommand)(	iConnection,
+														sharedDataCall.c_str(),
+														NULL);
+				if( sendRawOK != ITS_OK )
+					{
+					ret = ERR_STAT_SET_SHARED_DATA;
+					}
+				}
+			else
+				{
+				ret = ERR_INVALIDARG;
+				}
+			}
+		}
+	else
+		{
+		ret = ERR_INVALIDARG;
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/SyncService/src/SyncService.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#define TEST_SERVICE_IID		0x34630888
+#define TEST_SERVICE_VERSION	1
+
+#include "GenericStub.h"
+
+int main()
+{
+	return StartUCCService( TEST_SERVICE_IID, TEST_SERVICE_VERSION );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/Configuration/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,6 @@
+[TestDriverService]
+Port=3002
+Exe=C:\apps\engtools\testdriver2\testdriver
+Poll=5
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/Interface/Device/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,45 @@
+[UCCControl]
+CommPortIndex=3
+
+[StartService]
+svcname=TestdriverService
+methodid=1
+
+[StopService]
+svcname=TestDriverService
+methodid=2
+
+[BuildRun]
+svcname=TestDriverService
+call=BuildRun
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=5
+// param_name_1=PLATFORM
+// param_value_1=
+// param_name_2=BUILD
+// param_value_2=
+// param_name_3=SUITE
+// param_value_3=
+// param_name_4=TRANSPORT
+// param_value_4=
+// param_name_5=LOGGING
+// param_value_5=
+
+[RetrieveExecutionResult]
+svcname=TestDriverService
+call=RetrieveExecutionResult
+num_params=5
+// param_name_1=PLATFORM
+// param_value_1=
+// param_name_2=BUILD
+// param_value_2=
+// param_name_3=SUITE
+// param_value_3=
+// param_name_4=TRANSPORT
+// param_value_4=
+// param_name_5=LOGGING
+// param_value_5=
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/Interface/Host/TestDriverServiceInterface.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,22 @@
+[TestDriverService]
+ServiceIID=0x34630777
+Version=1
+
+[BuildRun]
+CallID=1
+PLATFORM=1
+BUILD=1
+SUITE=1
+TRANSPORT=0
+LOGGING=0
+
+[RetrieveExecutionResult]
+CallID=2
+PLATFORM=1
+BUILD=1
+SUITE=1
+TRANSPORT=0
+LOGGING=0
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/TestDriverService.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,150 @@
+# Microsoft Developer Studio Project File - Name="TestDriverService" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=TestDriverService - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "TestDriverService.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "TestDriverService.mak" CFG="TestDriverService - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "TestDriverService - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "TestDriverService - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "TestDriverService - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "./bin/Release"
+# PROP Intermediate_Dir "./bin/Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../inc" /I "../Common/inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /machine:I386 /nodefaultlib:"libcd"
+
+!ELSEIF  "$(CFG)" == "TestDriverService - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "./bin/Debug"
+# PROP Intermediate_Dir "./bin/Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../inc" /I "../Common/inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "TestDriverService - Win32 Release"
+# Name "TestDriverService - Win32 Debug"
+# Begin Group "src"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\CAThread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\CListeningServer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\CTestDriverService.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\Common\src\CUCCIniFile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\TestDriverService.c
+# End Source File
+# End Group
+# Begin Group "inc"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\CAThread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\CListeningServer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\CTestDriverService.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Group "libs"
+
+# PROP Default_Filter ""
+# Begin Group "debug"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Debug\GenericService.lib
+# End Source File
+# End Group
+# Begin Group "release"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Release\GenericService.lib
+# End Source File
+# End Group
+# End Group
+# End Target
+# End Project
Binary file testexecmgmt/ucc/GenericService/TestDriverService/bin/Debug/TestDriverService.exe has changed
Binary file testexecmgmt/ucc/GenericService/TestDriverService/bin/Release/TestDriverService.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/inc/CAThread.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CAThread
+*
+*/
+
+
+
+#ifndef __CATHREAD_H__
+#define __CATHREAD_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#define _WINSOCK2API_
+#include <windows.h>
+#include <stdio.h>
+#include <string>
+using namespace std;
+
+/*******************************************************************************
+ *
+ * Type
+ *
+ ******************************************************************************/
+typedef enum {
+	TS_INIT,
+	TS_ACTIVE,
+	TS_DONE
+} TThreadState;
+
+typedef enum {
+	TE_NONE,
+	TE_ERROR,
+	TE_TIMEOUT,
+	TE_INVALIDSTATE,
+} TThreadError;
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CAThread
+{
+public:
+	CAThread();
+	CAThread( string aThreadName );
+	~CAThread();
+
+	TThreadError StartThread( void *aStartProc, void *aArg, int *aSystemSpecificError );
+	TThreadError WaitForThread( int aTimeout );
+	TThreadState GetThreadState();
+
+private:
+	TThreadState iThreadState;
+	HANDLE iThreadHandle;
+	void *iProc;
+	string iThreadName;
+};
+
+#endif // __CATHREAD_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/inc/CListeningServer.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CLISTENINGSERVER_H__
+#define __CLISTENINGSERVER_H__
+
+#include <windows.h>
+
+class CListeningServer
+	{
+public:
+	CListeningServer();
+	~CListeningServer();
+
+	int		Open( const int aPort );
+	void	Close();
+	int		Send( const int aValue );
+	int		Recieve( int& aValue );
+
+private:
+	SOCKET			iLocalSock;
+	SOCKADDR_IN		iLocalAddr;
+	SOCKET			iRemoteSock;
+	SOCKADDR_IN		iRemoteAddr;
+	int				iPort;
+	};
+
+#endif // __CLISTENINGSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/inc/CTestDriverService.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CTESTDRIVERSERVICE_H__
+#define __CTESTDRIVERSERVICE_H__
+
+#include <string>
+#include "CService.h"
+
+// Define some error codes specific to this service
+#define ERR_TEST_DRIVER_BUILD			-110
+#define ERR_TEST_DRIVER_RUN				-111
+#define ERR_TEST_DRIVER_RUN_COMPLETE	-112
+#define ERR_TEST_DRIVER_ALREADY_RUNNING	-113
+
+class CTestDriverService : public CService
+	{
+public:
+	CTestDriverService();
+	~CTestDriverService();
+
+	virtual bool Setup();
+
+	// Handle the parsing/running of particular commands
+	virtual int RunCommand( const CCall& aCall );
+
+private:
+	int			BuildAndRunTestDriver( const CCall& aCall );
+	int			RetrieveTestDriverRunResult();
+	void		RetrieveConfig();
+	int			AppendCmdLineParams( const CCall& aCall, string &aCmdLine );
+	
+	static void ListeningServer( void );
+	static void TestDriverRun( void );
+	static void	Wait( HANDLE aMutexHandle );
+	static void	Release( HANDLE aMutexHandle );
+	};
+
+#endif // __CTESTDRIVERSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/src/CAThread.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CAThread.windows.cpp 
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CAThread.h" 
+
+/*******************************************************************************
+ *
+ * Implementation
+ *
+ ******************************************************************************/
+CAThread::CAThread()
+{
+	iThreadHandle = NULL;
+	iThreadState = TS_INIT;
+	iProc = NULL;
+}
+
+
+CAThread::CAThread( string aThreadName )
+{
+	iThreadHandle = NULL;
+	iThreadState = TS_INIT;
+	iProc = NULL;
+	iThreadName = aThreadName;
+}
+
+
+CAThread::~CAThread()
+{
+	assert( iThreadHandle == NULL );
+	assert( iThreadState != TS_ACTIVE );
+}
+
+
+TThreadError CAThread::StartThread( void *aStartProc, void *aArg, int *aSystemSpecificError )
+{
+	// check params
+	assert( aSystemSpecificError != NULL );
+	*aSystemSpecificError = 0;
+
+	// create the thread
+	iThreadHandle = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)aStartProc, aArg, 0, NULL );
+	iProc = aStartProc;
+
+	// handle errors
+	if( iThreadHandle == NULL ) {
+		*aSystemSpecificError = GetLastError();
+		return TE_ERROR;
+	}
+
+	// done
+	iThreadState = TS_ACTIVE;
+	return TE_NONE;
+}
+
+
+TThreadError CAThread::WaitForThread( int aTimeout )
+{
+	int err;
+
+	// wait for the object
+	err = WaitForSingleObject( iThreadHandle, aTimeout );
+
+	// handle the case that we got it
+	if( err == WAIT_OBJECT_0 ) {
+		iThreadState = TS_DONE;
+		CloseHandle( iThreadHandle );
+		iThreadHandle = NULL;
+		return TE_NONE;
+	}
+
+	// handle a timeout
+	if( err == WAIT_TIMEOUT ) {
+		return TE_TIMEOUT;
+	}
+
+	// handle all other responses
+	assert( !"INVALID CODE PATH" );
+	return TE_NONE;
+}
+
+
+TThreadState CAThread::GetThreadState()
+{
+	return iThreadState;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/src/CListeningServer.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CListeningServer.h
+*
+*/
+
+
+
+#include <stdio.h>
+
+#include "CListeningServer.h"
+
+const int KTimeOut		= 120000; // 2 minute timeout for recieve calls
+
+CListeningServer::CListeningServer()
+	{
+	}
+
+CListeningServer::~CListeningServer()
+	{
+	}
+
+int CListeningServer::Open( const int aPort )
+	{
+	WORD version;
+	WSADATA wsaData;
+
+	version = MAKEWORD( 2, 2 );
+	if( WSAStartup( version, &wsaData ) )
+		{
+		return WSAGetLastError();
+		}
+
+	// Create a socket
+	iLocalSock = socket( AF_INET, SOCK_STREAM, 0 ) ;
+	if( iLocalSock == INVALID_SOCKET )
+		{
+		return WSAGetLastError();
+		}
+
+	iPort = aPort;
+
+	// Set the socket
+	iLocalAddr.sin_family = AF_INET;		
+	iLocalAddr.sin_port = htons( iPort );
+	iLocalAddr.sin_addr.S_un.S_addr = inet_addr( "0.0.0.0" );
+
+	// Bind
+	if( bind(iLocalSock,(struct sockaddr*)&iLocalAddr, sizeof(SOCKADDR_IN)) != 0 )
+		{
+		return WSAGetLastError();
+		}
+
+	// Listen to the socket
+	if( listen( iLocalSock, 1 ) == SOCKET_ERROR ) 
+		{
+		return WSAGetLastError();
+		}
+	
+	// Wait for the next connection
+	int remote_addr_len = sizeof(iRemoteAddr);
+	iRemoteSock = accept( iLocalSock, (struct sockaddr*)&iRemoteAddr, &remote_addr_len );
+	if( iRemoteSock == INVALID_SOCKET )
+		{
+		return WSAGetLastError();
+		}
+
+	// Finally set the socket timeout for recieve calls (2 mins)
+	return setsockopt( iRemoteSock, SOL_SOCKET, SO_RCVTIMEO, (char *)&KTimeOut, sizeof(KTimeOut) );
+	}
+
+void CListeningServer::Close()
+{
+	closesocket(iRemoteSock);
+	closesocket(iLocalSock);
+	WSACleanup();
+}
+
+int CListeningServer::Send( const int aValue )
+	{
+	int ret = 0;
+	int bytes_sent_this_round;
+	int total_bytes_to_send = sizeof(int);
+	int total_bytes_sent = 0;
+
+	int pre_send_data = htonl(aValue);
+	char* buf = (char*)&pre_send_data;
+
+	while( (total_bytes_sent < total_bytes_to_send) && !ret )
+		{
+		bytes_sent_this_round = send( iRemoteSock, &(buf[total_bytes_sent]), total_bytes_to_send - total_bytes_sent, 0 );
+		if( bytes_sent_this_round == SOCKET_ERROR )
+			{
+			ret = WSAGetLastError();
+			}
+		total_bytes_sent += bytes_sent_this_round;
+		}
+	return ret;
+	}
+
+int CListeningServer::Recieve( int& aValue )
+	{
+	int ret = 0;
+	int received_byte_count = 0;
+	int bytes_to_receive = sizeof(int);
+	int bytes_received_this_round = 1;
+	char buf[sizeof(int)];
+	memset( buf, 0, sizeof(int) );
+
+	while( (received_byte_count < bytes_to_receive) && !ret )
+		{
+		bytes_received_this_round = recv( iRemoteSock, &(buf[received_byte_count]), bytes_to_receive - received_byte_count, 0 );
+		if( bytes_received_this_round == SOCKET_ERROR )
+			{
+			ret = WSAGetLastError();
+			}
+		else if( bytes_received_this_round == 0 )
+			{
+			// The socket has been killed
+			// Now close it at this end
+			closesocket(iRemoteSock);
+			closesocket(iLocalSock);
+			WSACleanup();
+			ret = INVALID_SOCKET;
+			}
+
+		received_byte_count += bytes_received_this_round;
+		}
+
+	if( received_byte_count == bytes_to_receive )
+		{
+		aValue = *((int*)buf);
+		aValue = ntohl(aValue);
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/src/CTestDriverService.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,597 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CTestDriverService.h
+*
+*/
+
+
+
+#include <stdlib.h>
+
+#include "CAThread.h"
+#include "CListeningServer.h"
+#include "CTestDriverService.h"
+#include "CUCCIniFile.h"
+
+// Parameters names
+const char	KPlatform[]				= { "PLATFORM" };
+const char	KBuild[]				= { "BUILD" };
+const char	KSuite[]				= { "SUITE" };
+const char	KTransport[]			= { "TRANSPORT" };
+const char	KLogging[]				= { "LOGGING" };
+
+// Ini file names
+const char	KTDServiceIni[]			= { ".\\TestDriverService.ini" };
+const char	KIniSectionName[]		= { "TestDriverService" };
+const char	KIniPort[]				= { "Port" };
+const char	KIniExeLocation[]		= { "Exe" };
+const char	KIniPollInterval[]		= { "Poll" };
+
+// TestDriver parameters and flags
+const char	KTDConnection[]			= { "localhost" };
+const char	KDefaultExe[]			= { "C:\\apps\\engtools\\testdriver2\\testdriver" };
+const char	KTDBuild[]				= { " build " };
+const char	KTDRun[]				= { " run " };
+const char	KPlatformFlag[]			= { " -p " };
+const char	KBuildFlag[]			= { " -b " };
+const char	KSuiteFlag[]			= { " -s " };
+const char	KTransportFlag[]		= { " -t " };
+const char	KLoggingFlag[]			= { " -l " };
+const char	KSocketFlag[]			= { " -f " };
+
+// TCP Port for TestDriver to use to contact the TestDriverService listening socket
+const int	KDefaultPort			= 3002;
+const int	KContinuePollingValue	= 1;
+
+// Default polling timeout for the Listening Server
+const int	KDefaultPoll			= 5; // 5 seconds
+
+// Static values to control the thread(s) execution
+static bool			iServerRunning;
+static bool			iTestDriverRunning;
+static int			iTDStartResult;
+static int			iTDCompleteResult;
+static bool			iTDContinuePolling;
+static bool			iTDRunSetupComplete;
+static char*		iRunCommandLine;
+static CAThread*	iServer;
+static CAThread*	iTestDriverRun;
+static HANDLE		iServerMutex;
+static HANDLE		iTDRunMutex;
+
+static string		iExe;
+static int			iPort;
+static int			iPollInterval;
+
+CService* Service() { return new CTestDriverService(); }
+
+/*
+ *	Constructor
+ */
+CTestDriverService::CTestDriverService()
+	{
+	iServerRunning = false;
+	iTestDriverRunning = false;
+	iTDStartResult = 0;
+	iTDCompleteResult = 0;
+	iTDContinuePolling = false;
+	iTDRunSetupComplete = false;
+	iServer = NULL;
+	iRunCommandLine = NULL;
+	iServerMutex = NULL;
+	iTDRunMutex = NULL;
+	iExe = KDefaultExe;
+	iPort = KDefaultPort;
+	iPollInterval = KDefaultPoll;
+	}
+
+/*
+ *	Destructor
+ */
+CTestDriverService::~CTestDriverService()
+	{
+	// Let the Listening Server clean itself up
+	Wait( iServerMutex );
+	if( iServerRunning )
+		{
+		iServerRunning = false;
+		}
+	iServer->WaitForThread( -1 );
+	if( iServer != NULL )
+		{
+		delete iServer;
+		iServer = NULL;
+		}
+	Release( iServerMutex );
+	ReleaseMutex( iServerMutex );
+	CloseHandle( iServerMutex );
+
+	// Clean up the TestDriver thread
+	Wait( iTDRunMutex );
+	if( iTestDriverRunning )
+		{
+		iTestDriverRunning = false;
+		}
+	iTestDriverRun->WaitForThread( -1 );
+	if( iTestDriverRun != NULL )
+		{
+		delete iTestDriverRun;
+		iTestDriverRun = NULL;
+		}
+
+	// Cleanup the shared command line
+	if( iRunCommandLine != NULL )
+		{
+		delete [] iRunCommandLine;
+		iRunCommandLine = NULL;
+		}
+	Release( iTDRunMutex );
+	ReleaseMutex( iTDRunMutex );
+	CloseHandle( iTDRunMutex );
+	}
+
+
+/*
+ *	Setup
+ *
+ *   Creates the mutex's requires by this service
+ */
+bool CTestDriverService::Setup()
+	{
+	bool ret = false;
+
+	// Read the ini file configuration if available, otherwise default
+	RetrieveConfig();
+
+	// Create the Listening Server and TestDrive run mutex
+	iServerMutex = CreateMutex( NULL, false, NULL );
+	iTDRunMutex = CreateMutex( NULL, false, NULL );
+
+	if( iServerMutex != NULL && iTDRunMutex != NULL )
+		{
+		ret = true;
+		}
+
+	return ret;
+	}
+
+/*
+ *	RunCommand
+ *
+ *   Extracts the call id and delegates to the required functionality
+ */
+int CTestDriverService::RunCommand( const CCall& aCall )
+	{
+	int		ret		= ERR_INVALID_CALL;
+	bool	callRet	= false;
+
+	// Retrieve the call id
+	int callID = -1;
+	callRet = aCall.CallID( callID );
+	if( callRet )
+		{
+		switch( callID )
+			{
+			case 1: // Build and initiate TestDriver (TestExecute) execution
+				{
+				ret = BuildAndRunTestDriver( aCall );
+				}
+				break;
+			case 2: // Retrieve the TestDriver run execution result
+				{
+				ret = RetrieveTestDriverRunResult();
+				}
+				break;
+			default:
+				{
+				ret = ERR_INVALID_CALL;
+				}
+				break;
+			}
+		}
+
+	return ret;
+	}
+
+/*
+ *	BuildAndRunTestDriver
+ *
+ *   Builds all of the dependancies and starts the execution via TestDriver
+ */
+int	CTestDriverService::BuildAndRunTestDriver( const CCall& aCall )
+	{
+	int ret = ERR_NONE;
+
+	// Test to see if the Listening Server is already running
+	// If running, we wait for it exit.
+	Wait( iServerMutex );
+	if( iServerRunning )
+		{
+		Release( iServerMutex );
+		RetrieveTestDriverRunResult();
+		//ret = ERR_TEST_DRIVER_ALREADY_RUNNING;
+		}
+	else 
+		{
+		Release( iServerMutex );
+		}
+
+	// Retrieve all the parameters
+	
+	// The build command line
+	string buildCommandLine;
+	buildCommandLine += iExe;
+	buildCommandLine += KTDBuild;
+	if( !ret )
+		{
+		ret = AppendCmdLineParams( aCall, buildCommandLine );
+		}
+
+	// The run command line
+	string runCommandLine;
+	runCommandLine += iExe;
+	runCommandLine += KTDRun;
+	if( !ret )
+		{
+		ret = AppendCmdLineParams( aCall, runCommandLine );
+		}
+
+	// Make the TestDriver build call
+	if( !ret )
+		{
+		int tdRet = system( buildCommandLine.c_str() );
+		if( tdRet )
+			{
+			ret = ERR_TEST_DRIVER_BUILD;
+			}
+		}
+
+	if( !ret )
+		{
+		// Append the details for the listening socket 
+		runCommandLine += KSocketFlag;
+		runCommandLine += KTDConnection;
+		runCommandLine += ":";
+		char	portBuf[20];
+		sprintf( portBuf, "%d", iPort );
+		runCommandLine += portBuf;
+
+		if( iRunCommandLine != NULL )
+			{
+			delete [] iRunCommandLine;
+			iRunCommandLine = NULL;
+			}
+
+		// Setup the command line for the execution thread
+		iRunCommandLine = new char[runCommandLine.length()+1];
+		strcpy( iRunCommandLine, runCommandLine.c_str() );
+		}
+
+	// Start the listening server in its own thread
+	if( !ret )
+		{
+		// Set the server running flag to true
+		iServerRunning = true;
+		// Kick off the Listening Server in its own thread
+		iServer = new CAThread( "CTestDriverService::ListeningServer" );
+		int err = 1;
+		TThreadError terr = iServer->StartThread( (void*)CTestDriverService::ListeningServer, NULL, &err ); 
+		if( terr != TE_NONE )
+			{
+			delete iServer;
+			iServer = NULL;
+			ret = ERR_TEST_DRIVER_RUN;
+			}
+		}
+
+	// Launch TestDriver in run mode in its own thread
+	if( !ret )
+		{
+		// Set the TestDriver running flag to true
+		iTestDriverRunning = true;
+		// Kick off TestDriver in its own thread
+		iTestDriverRun = new CAThread( "CTestDriverService::TestDriverRun" );
+		int err = 1;
+		TThreadError terr = iTestDriverRun->StartThread( (void*)CTestDriverService::TestDriverRun, NULL, &err ); 
+		if( terr != TE_NONE )
+			{
+			delete iTestDriverRun;
+			iTestDriverRun = NULL;
+			ret = ERR_TEST_DRIVER_RUN;
+			}
+		}
+
+	// Retrieve the TestDriver run startup result
+	if( !ret )
+		{
+		bool cont = false;
+		while( !cont && iTestDriverRunning )
+			{
+			Sleep( iPollInterval * 1000 );
+			Wait( iServerMutex );
+			iTDRunSetupComplete?cont=true:cont=false;
+			Release( iServerMutex );
+			}
+		Wait( iServerMutex );
+		iTDStartResult>0?ret=0:ret=ERR_TEST_DRIVER_RUN;
+		iTDRunSetupComplete = false;
+		Release( iServerMutex );
+		}
+
+	return ret;
+	}
+
+/*
+ *	RetrieveTestDriverRunResult
+ *
+ *   Retrieves the result upon the TestDriver run completion 
+ */
+int CTestDriverService::RetrieveTestDriverRunResult()
+	{
+	int ret = ERR_NONE;
+	
+	Wait( iServerMutex );
+	// Set the continue polling flag
+	iTDContinuePolling = true;
+	Release( iServerMutex );
+
+	// The ListeningServer thread will now issue TestDriver with the command
+	// to complete and cleanup and the return code will be set from the TestDriverRun
+	// thread when the executable completes.
+
+	// Wait for the TestDriverRun thread to complete
+	bool cont = false;
+	while( !cont )
+		{
+		Sleep( iPollInterval * 1000 );
+		Wait( iTDRunMutex );
+		iTestDriverRunning?cont=false:cont=true;
+		Release( iTDRunMutex );
+		}
+
+	// Cleanup the threads as they have now completed
+	Wait( iServerMutex );
+	iServerRunning = false;
+	Release( iServerMutex );
+
+	Wait( iTDRunMutex );
+	iTestDriverRunning = false;
+	Release( iTDRunMutex );
+
+	// Now the TestDriver executable has complete return the 
+	// appropriate error code
+	if( iTDCompleteResult < 0 )
+		{
+		ret = ERR_TEST_DRIVER_RUN_COMPLETE;
+		}
+
+	return ret;
+	}
+
+/*
+ *	ListeningServer
+ *
+ *    Runs the Listening Server
+ *      Controlled via the main/TestDriver run thread
+ */
+void CTestDriverService::ListeningServer( void )
+	{
+	// Create a new CListeningServer
+	CListeningServer* server = new CListeningServer();
+	if( server != NULL )
+		{
+		// Open it an wait until TestDriver has connected
+		int err = server->Open( iPort );
+
+		// Continue if TestDriver connected successfully and the server is set to running
+		// Retrieve the TestDriver execution startup result
+		// Loop until told to stop
+		if( !err )
+			{
+			int recvInt = 0;
+			iTDStartResult = 0;
+			bool cont = true;
+			while( cont )
+				{
+				Wait( iServerMutex );
+
+				// Attempt to recieve the TestDriver startup code
+				// This recieve call can timeout and we continue retrying
+				err = server->Recieve( recvInt );
+				if( !err )
+					{
+					// Set the TestDriver run startup result
+					iTDStartResult = recvInt;
+					iTDRunSetupComplete = true;
+					Release( iServerMutex );
+					break;
+					}
+				iServerRunning?cont=true:false;
+				Release( iServerMutex );
+				}
+			}
+
+		// Check to see that TestDriver has returned a run number.
+		// If it hasn't then the startup has failed.
+		if( iTDStartResult > 0 )
+			{
+			// Wait until the continue polling flag has been set
+			bool cont = true;
+			while( !err && cont )
+				{
+				Wait( iServerMutex );
+				if( iTDContinuePolling )
+					{
+					err = server->Send( KContinuePollingValue );
+					// Reset the polling flag
+					iTDContinuePolling = false;
+					Release( iServerMutex );
+					break;
+					}
+				Release( iServerMutex );
+				Sleep( iPollInterval * 1000 );
+				Wait( iServerMutex );
+				iServerRunning?cont=true:cont=false;
+				Release( iServerMutex );
+				}
+			}
+		server->Close();
+		}
+
+	delete server;
+	server = NULL;
+	Wait( iServerMutex );
+	iServerRunning = false;
+	Release( iServerMutex );
+	}
+
+/*
+ *	TestDriverRun
+ *
+ *    Executes the run command for TestDriver
+ */
+void CTestDriverService::TestDriverRun( void )
+	{
+	Wait( iTDRunMutex );
+	// Launch TestDriver
+	if( iRunCommandLine != NULL )
+		{
+		iTDCompleteResult = system( iRunCommandLine );
+		}
+	else
+		{
+		iTDCompleteResult = -1;
+		}
+
+	// Reset the status to not running
+	iTestDriverRunning = false;
+	Release( iTDRunMutex );
+	}
+
+/*
+ *	Wait
+ *
+ *    For synchronisation
+ */
+void CTestDriverService::Wait( HANDLE aMutexHandle )
+	{
+	WaitForSingleObject( aMutexHandle, INFINITE );
+	}
+
+/*
+ *	Release
+ *
+ *    For synchronisation
+ */
+void CTestDriverService::Release( HANDLE aMutexHandle )
+	{
+	ReleaseMutex( aMutexHandle );
+	}
+
+
+void CTestDriverService::RetrieveConfig()
+	{
+	bool ret = false;
+
+	// Load the configuration information file
+	CUCCIniFile iniFile( KTDServiceIni );
+
+	// Retrieve the port to be used
+	int port;
+	if( iniFile.KeyValue(KIniPort, KIniSectionName, port) )
+		{
+		iPort = port;
+		}
+
+	// Retrieve the exe location/filename
+	string exe;
+	if( iniFile.KeyValue(KIniExeLocation, KIniSectionName, exe) )
+		{
+		iExe = exe;
+		}
+
+	// Retrieve the poll interval
+	int pollInterval;
+	if( iniFile.KeyValue(KIniPollInterval, KIniSectionName, pollInterval) )
+		{
+		iPollInterval = pollInterval;
+		}
+	}
+
+
+int CTestDriverService::AppendCmdLineParams( const CCall& aCall, string &aCmdLine )
+	{
+	int ret = ERR_NONE;
+
+	int numParams = 0;
+	bool callRet = aCall.Params( numParams );
+	if( !ret && callRet && numParams >= 3 )
+		{
+		for( int index=0 ; index<numParams && callRet && !ret ; index++ )
+			{
+			// Retrieve the PLATFORM parameters
+			string name;
+			string value;
+			callRet = aCall.Name( index, name );
+			if( callRet )
+				{
+				callRet = aCall.Value( index, value );
+				}
+			
+			if( callRet )
+				{
+				if( name == KPlatform )
+					{
+					aCmdLine += KPlatformFlag;
+					aCmdLine += value;
+					}
+				else if( name == KBuild )
+					{
+					aCmdLine += KBuildFlag;
+					aCmdLine += value;
+					}
+				else if( name == KSuite )
+					{
+					aCmdLine += KSuiteFlag;
+					aCmdLine += value;
+					}
+				else if( name == KTransport )
+					{
+					aCmdLine += KTransportFlag;
+					aCmdLine += value;
+					}
+				else if( name == KLogging )
+					{
+					aCmdLine += KLoggingFlag;
+					aCmdLine += value;
+					}
+				else
+					{
+					ret = ERR_INVALIDARG;
+					}
+				}
+			else
+				{
+					ret = ERR_INVALIDARG;
+				}
+			}
+		}
+	else
+		{
+			ret = ERR_INVALIDARG;
+		}
+	
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestDriverService/src/TestDriverService.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* TestDrivercService.c
+*
+*/
+
+
+
+#define TEST_SERVICE_IID		0x34630777
+#define TEST_SERVICE_VERSION	1
+
+#include <stdlib.h>
+#include "GenericStub.h"
+
+int main()
+	{
+	return StartUCCService( TEST_SERVICE_IID, TEST_SERVICE_VERSION );
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Master/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+CommPortIndex=3
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=SharedData
+param_name_2=VALUE
+param_value_2=HelloWorld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Master/master.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT UCC Tests
+
+LOAD_SUITE UCCControlTE
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Slave/sampletest.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,11 @@
+[SectionOne]
+
+TheString =StringOne
+TheInt    =1
+TheBool   =true
+
+[SectionTwo]
+
+TheString =PanicMe
+TheInt    =2
+TheBool   =false
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Slave/slave.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,44 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT Synchronised test cases
+
+LOAD_SUITE SampleServer
+
+START_SYNCHRONISED_TESTCASE TestOne
+PRINT TestOne Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestOne
+
+START_SYNCHRONISED_TESTCASE TestTwo
+PRINT TestTwo Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestTwo
+
+START_SYNCHRONISED_TESTCASE TestThree
+PRINT TestThree Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestThree
+
+START_SYNCHRONISED_TESTCASE TestFour
+PRINT TestFour Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestFour
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestService/Interface/TestService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[TestService]
+ServiceIID=0x34630999
+Version=1
+
+[TestCallOne]
+CallID=1
+PARAM1=0
+PARAM2=1
+
+[TestCallTwo]
+CallID=2
+PARAM1=1
+PARAM2=1
+PARAM3=1
+
+[TestCallThree]
+CallID=3
+PARAM1=1
+PARAM2=1
+PARAM3=1
+PARAM4=1
+PARAM5=1
+PARAM6=1
+PARAM7=1
+PARAM8=1
+PARAM9=1
+PARAM10=1
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestService/TestService.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,131 @@
+# Microsoft Developer Studio Project File - Name="TestService" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=TestService - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "TestService.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "TestService.mak" CFG="TestService - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "TestService - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "TestService - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "TestService - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "./bin/Release"
+# PROP Intermediate_Dir "./bin/Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /machine:I386 /nodefaultlib:"libcd.lib"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ELSEIF  "$(CFG)" == "TestService - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "./bin/Debug"
+# PROP Intermediate_Dir "./bin/Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /I "./inc" /I "../inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "TestService - Win32 Release"
+# Name "TestService - Win32 Debug"
+# Begin Group "src"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\CTestService.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\TestService.c
+# End Source File
+# End Group
+# Begin Group "inc"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\CTestService.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Group "libs"
+
+# PROP Default_Filter ""
+# Begin Group "debug"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Debug\GenericService.lib
+# End Source File
+# End Group
+# Begin Group "release"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Release\GenericService.lib
+# End Source File
+# End Group
+# End Group
+# End Target
+# End Project
Binary file testexecmgmt/ucc/GenericService/TestService/bin/Debug/TestService.exe has changed
Binary file testexecmgmt/ucc/GenericService/TestService/bin/Release/TestService.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestService/inc/CTestService.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CTESTSERVICE_H__
+#define __CTESTSERVICE_H__
+
+#include "CService.h"
+
+class CTestService : public CService
+	{
+	public:
+		CTestService() {}
+		~CTestService() {}
+
+		// Handle the parsing/running of particular commands
+		virtual int RunCommand( const CCall& aCall );
+	};
+
+#endif // __CTESTSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestService/src/CTestService.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CTestService.h
+*
+*/
+
+
+
+#include <stdio.h>
+
+#include "CTestService.h"
+
+CService* Service() { return new CTestService(); }
+
+int CTestService::RunCommand( const CCall& aCall )
+{
+	int callID = -1;
+	if( aCall.CallID( callID ) )
+	{
+		switch( callID )
+		{
+			case 1:
+				{
+					printf( "CallID One has been made\n" );
+					// Parse the parameters here and make the relevant call
+				}
+				break;
+			case 2:
+				{
+					printf( "CallID Two has been made\n" );
+					// Parse the parameters here and make the relevant call
+				}
+				break;
+			case 3:
+				{
+					printf( "CallID Three has been made\n" );
+					// Parse the parameters here and make the relevant call
+				}
+				break;
+			default:
+				{
+					printf( "Unknown CallID\n" );
+					return ERR_INVALID_CALL;
+				}
+		}
+
+		// *** Testing ***
+		// Echo the number of parameters
+		int numParams = 0;
+		if( aCall.Params( numParams ) )
+		{
+			printf( "Number of parameters: %d\n", numParams );
+
+			for( int index=0 ; index<numParams ; index++ )
+			{
+				string name;
+				if( aCall.Name(index, name) )
+				{
+					// Echo the Parameter Name
+					printf( "Parameter Name: %s\n", name.c_str() );
+
+					string value;
+					if( aCall.Value(index, value) )
+					{
+						// Echo the Parameter Value
+						printf( "Parameter Value: %s\n", value.c_str() );
+					}
+				}
+			}
+			printf("\n");
+			// *** Testing ***
+		}
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/TestService/src/TestService.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#define TEST_SERVICE_IID		0x34630999
+#define TEST_SERVICE_VERSION	1
+
+#include "GenericStub.h"
+
+int main()
+{
+	return StartUCCService( TEST_SERVICE_IID, TEST_SERVICE_VERSION );
+}
Binary file testexecmgmt/ucc/GenericService/bin/Debug/GenericService.lib has changed
Binary file testexecmgmt/ucc/GenericService/bin/Release/GenericService.lib has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/inc/CCall.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CCALL_H__
+#define __CCALL_H__
+
+#include <string>
+#include "GenericStub.h"
+
+using std::string;
+
+class CCall
+	{
+	public:
+		CCall( const TCall& aCall );
+		~CCall();
+
+		// Return the Call ID
+		bool CallID( int& aCallID ) const;
+
+		// Return the number of parameters
+		bool Params( int& aNumParams ) const;
+
+		// Return the name of a parameter within the call
+		bool Name( int anIndex, string& aName ) const;
+
+		// Return the value of the parameter within the call
+		bool Value( int anIndex, string& aValue ) const;
+
+		// Get the index into the TCall array with a matching specified parameter name
+		int	 GetIndex(const string &aName) const;
+
+		// Retrieve the value of the specified parameter
+		bool Get(const string &aName, string &aValue) const;
+		bool Get(const string &aName, int &aValue) const;
+		bool Get(const string &aName, bool &aValue) const;
+
+		// Dump the contents to stdout (useful debugging aid)
+		void Dump() const;
+
+	private:
+		TCall	iCall;
+
+		bool Check( const string& aValue, const unsigned int aMaxLength ) const;
+	};
+
+#endif // __CCALL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/inc/CComponentManager.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CCOMPONENTMANAGER_H__
+#define __CCOMPONENTMANAGER_H__
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <stdio.h>
+#include <assert.h>
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+
+/****************************************************************************************
+ * 
+ * Class CComponentManager
+ * 
+ ***************************************************************************************/
+template <class T>
+class CComponentManager
+{
+public:
+	CComponentManager( int aMaxComponents )
+	{
+		// check params
+		assert( aMaxComponents > 0 );
+
+		// set the state
+		iComponentCount = 0;
+		iMaxComponents = aMaxComponents;
+		iComponentList = (T**)calloc( iMaxComponents, sizeof(T*) );
+		assert( iComponentList != NULL );
+	}
+
+	~CComponentManager()
+	{
+		assert( iComponentCount == 0 );
+		free( iComponentList );
+	}
+
+	int CreateInstance() 
+	{
+		int i;
+
+		// make sure there is room
+		if( iComponentCount == iMaxComponents ) {
+			return ERR_CANNOT_CREATE_NEW_INSTANCE;
+		}
+
+		// find a free index
+		for( i = 0; i < iMaxComponents; i++ ) {
+			if( iComponentList[i] == NULL )
+				break;
+		}
+		assert( i < iMaxComponents );
+
+		// create the new instance
+		iComponentList[i] = new T();
+		assert( iComponentList[i] != NULL );
+
+		// set the key
+		(iComponentList[i])->SetKey( i );
+
+		// update the count
+		iComponentCount++;
+
+		// done - return the key
+		return i;
+	}
+
+	int DeleteInstance( int aInstanceKey )
+	{
+		int is_key_valid;
+
+		// check that the key is valid
+		is_key_valid = IsValidKey( aInstanceKey );
+		assert( is_key_valid != 0 );
+
+		// verify the key
+		assert( (iComponentList[aInstanceKey])->GetKey() == aInstanceKey );
+
+		// delete the instace
+		delete (iComponentList[aInstanceKey]);
+		iComponentList[aInstanceKey] = NULL;
+		iComponentCount--;
+
+		// done
+		return ERR_NONE;
+	}
+
+	int IsValidKey( int aInstanceKey )
+	{
+		return ((aInstanceKey >= 0) && (aInstanceKey < iMaxComponents) && (iComponentList[aInstanceKey] != NULL) );
+	}
+
+	T *GetInstance( int aInstanceKey )
+	{
+		// validate the param
+		if( (aInstanceKey < 0) || (aInstanceKey >= iMaxComponents) ) {
+			return NULL;
+		}
+		return iComponentList[aInstanceKey];
+	}
+
+	int GetInstanceCount()
+	{
+		return iComponentCount;
+	}
+
+	int DeleteAllInstances()
+	{
+		int i, err;
+		for( i = 0; i < iMaxComponents; i++ ) {
+			if( iComponentList[i] != NULL ) {
+				err = DeleteInstance( i );
+				assert( err == ERR_NONE );
+			}
+		}
+		assert( iComponentCount == 0 );
+		return ERR_NONE;
+	}
+
+
+private:
+	int iComponentCount;
+	int iMaxComponents;
+	T **iComponentList;
+};
+
+#endif //__CCOMPONENTMANAGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/inc/CSGenericstub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Nov 16 15:19:57 2004
+*
+*/
+
+
+
+#ifndef __CSGENERICSTUB_H__
+#define __CSGENERICSTUB_H__
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "GenericStub.h"
+#include "CService.h"
+
+/****************************************************************************************
+ * 
+ * Definition: CSGenericstub
+ * 
+ ***************************************************************************************/
+class CSGenericstub
+{
+public:
+	// Standard Methods
+	CSGenericstub();
+	~CSGenericstub();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+	int cstr_startprocess( char *aArgs );
+	int dstr_removeprocess( int aArgs, int *aDeleteInstance );
+	int run_command( TCall aArgs );
+
+	// Setup the service (if required)
+	bool Setup();
+
+private:
+	int			iKey;
+	CService*	iService;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/inc/CService.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CSERVICE_H__
+#define __CSERVICE_H__
+
+#include "CCall.h"
+
+class CService
+	{
+	public:
+		CService() {}
+		virtual ~CService() {}
+
+		// Virtual function can be implemented in the derived class
+		//  if any setup is required for the service.
+		virtual bool Setup() { return true; }
+
+		// Pure virtual function needs to be implemented
+		// Handle the parsing/running of particular commands
+		virtual int RunCommand( const CCall& aCall ) = 0;
+	};
+
+// This also need to be implemented to return an instance
+// of your derived CService class
+extern CService* Service();
+
+#endif // __CSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/inc/CSvcGenericstub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Nov 16 15:19:57 2004
+*
+*/
+
+
+
+#ifndef __CSVCGENERICSTUB_H__
+#define __CSVCGENERICSTUB_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "GenericStub.h"
+#include "CSGenericstub.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcGenericstub
+ * 
+ ***************************************************************************************/
+class CSvcGenericstub
+{
+public:
+	/* standard methods */
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSGenericstub> *aComponentManager, TStartupInfo *aArg );
+	static int StopRPCService();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/inc/CTestService.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CTESTSERVICE_H__
+#define __CTESTSERVICE_H__
+
+#include "CService.h"
+
+class CTestService : public CService
+	{
+	public:
+		CTestService();
+		~CTestService();
+
+		// Handle the parsing/running of particular commands
+		virtual int RunCommand( const CCall& aCall );
+
+	private:
+
+	};
+
+CService* Service() { return new CTestService(); }
+
+#endif // __CTESTSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/inc/GenericStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __GENERICSTUB_H__
+#define __GENERICSTUB_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE                                 0
+
+// errors
+#define ERR_SERVICE_ALREADY_STARTED             -1
+#define ERR_SERVICE_NOT_RUNNING                 -2
+#define ERR_ACTIVE_USER_SESSIONS                -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS    -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER  -5
+#define ERR_FAILED_TO_RETRIEVE_KEY              -6
+#define ERR_INSTANCE_DOES_NOT_EXIST             -7
+#define ERR_INVALID_METHOD                      -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE          -9
+#define ERR_STUB_ALREADY_CONNECTED              -10
+#define ERR_FAILED_TO_CONNECT                   -11
+#define ERR_STUB_NOT_CONNECTED                  -12
+#define ERR_INVALID_RV_POINTER                  -13
+#define ERR_RPC_ERROR                           -14
+#define ERR_INVALID_SERVICE                     -15
+#define ERR_INVALID_ERROR_CODE                  -16
+#define ERR_MISSING_PARAMETER                   -17
+#define ERR_INVALID_CALL                        -18
+
+#define ERR_INVALIDARG                          -50
+#define ERR_INVALIDSTATE                        -51
+#define ERR_GENERAL                             -52
+
+
+#define INFO_MAXIMUM_OBJECTS 256
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int StartUCCService( int anIID, int aVersion );
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TComponentList(...);
+}
+#else
+bool_t xdr_GenericStub_TComponentList();
+#endif
+
+#define MAXPARAMNAMELENGTH 128
+#define MAXPARAMVALUELENGTH 1024
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TStartupInfo(...);
+}
+#else
+bool_t xdr_GenericStub_TStartupInfo();
+#endif
+
+
+struct TParam {
+	char iName[MAXPARAMNAMELENGTH];
+	char iValue[MAXPARAMVALUELENGTH];
+};
+typedef struct TParam TParam;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TParam(...);
+}
+#else
+bool_t xdr_GenericStub_TParam();
+#endif
+
+
+struct TCall {
+	int iCallID;
+	struct {
+		u_int iParams_len;
+		TParam *iParams_val;
+	} iParams;
+};
+typedef struct TCall TCall;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TCall(...);
+}
+#else
+bool_t xdr_GenericStub_TCall();
+#endif
+
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_1( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_1();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_1();
+#endif /* __cplusplus */
+#define LIST_CONNECTIONS ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_connections_1( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_connections_1();
+#endif /* __cplusplus */
+#define CSTR_STARTPROCESS ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern int *cstr_startprocess_1( char ** arg, CLIENT *cl );
+}
+#else
+extern int *cstr_startprocess_1();
+#endif /* __cplusplus */
+#define DSTR_REMOVEPROCESS ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removeprocess_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removeprocess_1();
+#endif /* __cplusplus */
+#define RUN_COMMAND ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern int *run_command_1( TCall * arg, CLIENT *cl );
+}
+#else
+extern int *run_command_1();
+#endif /* __cplusplus */
+
+#endif /* __GENERICSTUB_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/CCall.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "CCall.h"
+#include <stdio.h>
+
+/*
+ *	Constructor
+ *
+ *    Takes in a TCall structure passed in via the RPC framework
+ */
+CCall::CCall( const TCall& aCall )
+	: iCall(aCall)
+{
+}
+
+/*
+ *	Destructor
+ */
+CCall::~CCall()
+{
+}
+
+/*
+ *	CallID
+ *
+ *    Retrieve the call id
+ */
+bool CCall::CallID( int& aCallID ) const
+{
+	bool ret = false;
+	if( iCall.iCallID >= 0 )
+	{
+		aCallID = iCall.iCallID;
+		ret = true;
+	}
+	return ret;
+}
+
+/*
+ *	Params
+ *
+ *    Retrieve the number of parameters in the call
+ */
+bool CCall::Params( int& aNumParams) const
+{
+	bool ret = false;
+	if( iCall.iParams.iParams_len >= 0 )
+	{
+		aNumParams = iCall.iParams.iParams_len;
+		ret = true;
+	}
+	return ret;
+}
+
+/*
+ *	Name
+ *
+ *    Retrieve the name of a parameter at a specific index
+ */
+bool CCall::Name( int anIndex, string& aName ) const
+{
+	bool ret = false;
+	if( anIndex >= 0 && anIndex < iCall.iParams.iParams_len )
+	{
+		if( Check(iCall.iParams.iParams_val[anIndex].iName, MAXPARAMNAMELENGTH) )
+		{
+			aName.assign( iCall.iParams.iParams_val[anIndex].iName );
+			ret = true;
+		}
+	}
+	return ret;
+}
+
+/*
+ *	Value
+ *
+ *    Retrieve the value of a parameter at a specific index
+ */
+bool CCall::Value( int anIndex, string& aValue ) const
+{
+	bool ret = false;
+	if( anIndex >= 0 && anIndex < iCall.iParams.iParams_len )
+	{
+		if( Check(iCall.iParams.iParams_val[anIndex].iValue, MAXPARAMVALUELENGTH) )
+		{
+			aValue.assign( iCall.iParams.iParams_val[anIndex].iValue );
+			ret = true;
+		}
+	}
+	return ret;
+}
+
+/*
+ *	Check
+ *
+ *    Check a string value is within the defined boundaries
+ */
+bool CCall::Check( const string& aValue, const unsigned int aMaxLength ) const
+{
+	bool ret = false;
+	if( aValue.size() > 0 && aValue.size() <= aMaxLength )
+	{
+		ret = true;
+	}
+	return ret;
+}
+
+/*
+ *	Get
+ *
+ *    Find the index into the array matching the specified parameter name
+ */
+int	CCall::GetIndex(const string &aName) const
+{
+	// search through each param to find a matching (case insensitive) name & return the index
+	for (unsigned int i =0; i < iCall.iParams.iParams_len; i++)
+	{
+		if (!_stricmp(aName.c_str(), iCall.iParams.iParams_val[i].iName))
+			return i;
+	}
+	return -1;
+}
+
+/*
+ *	Get
+ *
+ *    Retrieve the value of the specified parameter
+ */
+bool CCall::Get(const string &aName, string &aValue) const
+{
+	// find a matching index & copy value
+	int index = GetIndex(aName);
+	if (index < 0)
+		return false;
+
+	aValue.assign(iCall.iParams.iParams_val[index].iValue);
+	return true;
+}
+
+bool CCall::Get(const string &aName, int &aValue) const
+{
+	// get value as string
+	string value;
+	if (!Get(aName, value))
+		return false;
+
+	// convert value to int
+	if (sscanf(value.c_str(), "0x%x", &aValue) != 1 &&
+		sscanf(value.c_str(), "%d", &aValue) != 1)
+	{
+		return false;
+	}
+
+	return true;
+}
+
+bool CCall::Get(const string &aName, bool &aValue) const
+{
+	// get value as string
+	string value;
+	if (!Get(aName, value))
+		return false;
+
+	// convert value to bool
+	if (!_stricmp(value.c_str(), "true"))
+		return true;
+	else if (!_stricmp(value.c_str(), "false"))
+		return false;
+
+	aValue = false;
+	return false;
+}
+
+/*
+ *	Dump
+ *
+ *    Dump the contents to stdout (useful debugging aid)
+ *    - Deliberately uses the public APIs
+ */
+void CCall::Dump() const
+{
+	// call id
+	int callId = 0;
+	if (CallID(callId))
+		printf("callId = %d\n", callId);
+	else
+	{
+		printf("Error! callId is indeterminate\n");
+		return;
+	}
+
+	// num params
+	int numParams = 0;
+	if (Params(numParams))
+		printf("numParams = %d\n", numParams);
+	else
+	{
+		printf("Error! numParams is indeterminate\n");
+		return;
+	}
+
+	// params
+	for (int i=0 ; i < numParams ; i++)
+	{
+		// param name
+		string paramName;
+		if (Name(i, paramName))
+			printf("  arg; \"%s\" = ", paramName.c_str());
+		else
+			printf("Error! paramName is indeterminate\n");
+
+		// param value
+		string paramValue;
+		if (Value(i, paramValue))
+			printf("\"%s\"\n", paramValue.c_str());
+		else
+			printf("\nError! paramValue is indeterminate\n");
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/CSGenericstub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Nov 16 15:19:57 2004
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcGenericstub.h"
+#include "CSGenericstub.h"
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSGenericstub::CSGenericstub()
+	: iKey(0), iService(NULL)
+{
+	iService = Service();
+	assert( iService != NULL );
+}
+
+CSGenericstub::~CSGenericstub()
+{
+	if( iService != NULL )
+	{
+		delete iService;
+		iService = NULL;
+	}
+}
+
+int CSGenericstub::GetKey()
+{
+	return iKey;
+}
+
+void CSGenericstub::SetKey( int aKey )
+{
+	iKey = aKey;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startprocess
+ * 
+ ***************************************************************************************/
+int CSGenericstub::cstr_startprocess(char * /*aArgs*/)
+{
+	int rv;
+	rv = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeprocess
+ * 
+ ***************************************************************************************/
+int CSGenericstub::dstr_removeprocess( int /*aArgs*/, int * /*aDeleteInstance*/)
+{
+	int rv;
+	rv = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: run_command
+ * 
+ ***************************************************************************************/
+int CSGenericstub::run_command( TCall aArgs )
+{
+	CCall call( aArgs );
+	if( iService != NULL )
+		return iService->RunCommand( call );
+	else
+		return ERR_SERVICE_NOT_RUNNING;
+}
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: Setup
+ *                   Delegate to the user derived service
+ * 
+ ***************************************************************************************/
+bool CSGenericstub::Setup()
+{
+	bool ret = false;
+	if( iService != NULL )
+		ret = iService->Setup();
+	return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/CSvcGenericstub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Nov 16 15:19:57 2004
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcGenericstub.h"
+#include "GenericStub.h"
+
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSGenericstub> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcGenericstub::GetInstanceKeyFromArgs( int aMethod, void * /*aArgs*/ )
+{
+	int rv;
+	switch( aMethod ) {
+	case DSTR_REMOVEPROCESS:
+	case RUN_COMMAND:
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcGenericstub::SetError( int aMethod, void * /*aArgs*/, int /*aError*/)
+{
+	int rv;
+	switch( aMethod ) {
+	case LIST_CONNECTIONS:
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError
+ * 
+ ***************************************************************************************/
+int CSvcGenericstub::GetError( int aMethod, void * /*aArgs*/)
+{
+	int rv = ERR_NONE;
+	switch( aMethod ) {
+	case LIST_CONNECTIONS:
+	default:
+		assert( "!INVALID CALL" );
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcGenericstub::StartRPCService( CComponentManager<CSGenericstub> *aComponentManager, TStartupInfo * /*aArg*/ )
+{
+	assert( iComponentManager == NULL );
+	iComponentManager = aComponentManager;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcGenericstub::StopRPCService()
+{
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/CTestService.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CTestService.h
+*
+*/
+
+
+
+#include <stdio.h>
+
+#include "CTestService.h"
+
+CTestService::CTestService()
+{
+}
+
+CTestService::~CTestService()
+{
+}
+
+int CTestService::RunCommand( const CCall& aCall )
+{
+	printf( "TEST SERVICE CALL WORKS! :-)" );
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/GenericStub_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "GenericStub.h"
+
+static void genericstub_1();
+
+int StartUCCService( int anIID, int aVersion )
+{
+	SVCXPRT *transp;
+
+#ifdef WIN32
+	rpc_nt_init();
+#endif
+
+	(void)pmap_unset(anIID, aVersion);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+	if (!svc_register(transp, anIID, aVersion, genericstub_1, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (GENERICSTUB, GENERICSTUB_VERSION, udp).\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+	if (!svc_register(transp, anIID, aVersion, genericstub_1, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (GENERICSTUB, GENERICSTUB_VERSION, tcp).\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+#ifdef WIN32
+	rpc_nt_exit();
+#endif
+	exit(1);
+}
+
+#ifdef MULTITHREAD
+struct call_params {
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+	void *arg;
+	char *(*local)();
+	bool_t (*xdr_argument)(), (*xdr_result)();
+};
+static void genericstub_1_a ();
+#endif
+
+static void
+genericstub_1(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		TStartupInfo ss_startuprpcservice_1_arg;
+		int sc_shutdownrpcservice_1_arg;
+		char *cstr_startprocess_1_arg;
+		int dstr_removeprocess_1_arg;
+		TCall run_command_1_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+
+#ifdef MULTITHREAD
+	DWORD TID = 0;
+	HANDLE threadHandle = NULL;
+	struct call_params	*params;
+#endif
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_GenericStub_TStartupInfo;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_1;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_1;
+		break;
+
+	case LIST_CONNECTIONS:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_GenericStub_TComponentList;
+		local = (char *(*)()) list_connections_1;
+		break;
+
+	case CSTR_STARTPROCESS:
+		xdr_argument = xdr_wrapstring;
+		xdr_result = xdr_int;
+		local = (char *(*)()) cstr_startprocess_1;
+		break;
+
+	case DSTR_REMOVEPROCESS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) dstr_removeprocess_1;
+		break;
+
+	case RUN_COMMAND:
+		xdr_argument = xdr_GenericStub_TCall;
+		xdr_result = xdr_int;
+		local = (char *(*)()) run_command_1;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+
+#ifdef MULTITHREAD
+	params = (struct call_params*) malloc (sizeof(struct call_params));
+
+	params->rqstp = (struct svc_req*) malloc (sizeof(struct svc_req));
+	bcopy(rqstp, params->rqstp, sizeof(struct svc_req));
+
+	params->transp = transp;
+
+	params->arg = malloc (sizeof(argument));
+	bcopy(&argument, params->arg, sizeof(argument));
+
+	params->local = local;
+
+	params->xdr_argument = xdr_argument;
+	params->xdr_result = xdr_result;
+
+	threadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)genericstub_1_a, params, 0, &TID);
+	if (!threadHandle)
+		genericstub_1_a(&params);
+}
+
+static void
+genericstub_1_a(params)
+struct call_params *params;
+{
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+	void *argument;
+	void (*destroy_proc)();
+
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+
+	argument = params->arg;
+	rqstp = params->rqstp;
+	transp = params->transp;
+	xdr_argument = params->xdr_argument;
+	xdr_result = params->xdr_result;
+	local = params->local;
+	destroy_proc = transp->xp_ops->xp_destroy;
+	transp->xp_ops->xp_destroy = xprt_unregister;
+#endif
+
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+#ifdef MULTITHREAD
+	free(params->rqstp);
+	free(params);
+#endif
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+#ifdef MULTITHREAD
+	free(argument);
+	transp->xp_ops->xp_destroy = destroy_proc;
+#endif
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/GenericStub_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,318 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Tue Nov 16 15:19:57 2004
+* System Includes
+*
+*/
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcGenericstub.h"
+#include "CSGenericstub.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSGenericstub> *iComponentManager;
+static CSGenericstub *iGenericStub;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_1( TStartupInfo *aArgs, CLIENT * /*aDutout*/ )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSGenericstub>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+	
+	iGenericStub = new CSGenericstub();
+	if( iGenericStub != NULL )
+	{
+		if( !iGenericStub->Setup() )
+		{
+			rv = ERR_FAILED_TO_CONNECT;
+			return &rv;
+		}
+	}
+	else
+	{
+		rv = ERR_FAILED_TO_CONNECT;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcGenericstub::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_1( int *aArgs, CLIENT * /*aDutout*/ )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcGenericstub::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	delete iGenericStub;
+	iGenericStub = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_connections
+ * 
+ ***************************************************************************************/
+TComponentList *list_connections_1( void * /*aArgs*/, CLIENT * /*aDutout*/ )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcGenericstub::SetError( LIST_CONNECTIONS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcGenericstub::SetError( LIST_CONNECTIONS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startprocess
+ * 
+ ***************************************************************************************/
+int *cstr_startprocess_1( char **aArgs, CLIENT * /*aDutout*/ )
+{
+	static int rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	CSGenericstub *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// create a new component instance
+	instance_key = iComponentManager->CreateInstance();
+	if( instance_key < 0 ) {
+		rv = instance_key;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->cstr_startprocess( *aArgs );
+	result = rv;
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	if( result != ERR_NONE ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == 0 );
+	} else { 
+		rv = instance_key;
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeprocess
+ * 
+ ***************************************************************************************/
+int *dstr_removeprocess_1( int *aArgs, CLIENT * /*aDutout*/ )
+{
+	static int rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	int should_delete = 1;
+	CSGenericstub *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// get the key for the instance from the args
+	instance_key = CSvcGenericstub::GetInstanceKeyFromArgs( DSTR_REMOVEPROCESS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		rv = instance_key;
+		return &rv;
+	}
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->dstr_removeprocess( *aArgs, &should_delete );
+
+	result = rv;
+
+	// it is illegal for the method to succeed but not delete the instance
+	assert( (result != ERR_NONE) || (should_delete == 1) );
+
+	// delete the instance if requested
+	if( should_delete != 0 ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == ERR_NONE );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: run_command
+ * 
+ ***************************************************************************************/
+int *run_command_1( TCall *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+	// call the corresponding method on the instance
+	rv = iGenericStub->run_command(*aArgs);
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/GenericStub_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <rpc/rpc.h>
+#include "GenericStub.h"
+
+
+bool_t
+xdr_GenericStub_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_GenericStub_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_GenericStub_TParam(xdrs, objp)
+	XDR *xdrs;
+	TParam *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iName, MAXPARAMNAMELENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iValue, MAXPARAMVALUELENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_GenericStub_TCall(xdrs, objp)
+	XDR *xdrs;
+	TCall *objp;
+{
+	if (!xdr_int(xdrs, &objp->iCallID)) {
+		return (FALSE);
+	}
+	if (!xdr_array(xdrs, (char **)&objp->iParams.iParams_val, (u_int *)&objp->iParams.iParams_len, ~0, sizeof(TParam), (void*)xdr_GenericStub_TParam)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/GenericService/src/TestService.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#define TEST_SERVICE_IID		0x34630999
+#define TEST_SERVICE_VERSION	1
+
+extern StartUCCService( int anIID, int aVersion );
+
+int main()
+{
+	return StartUCCService( TEST_SERVICE_IID, TEST_SERVICE_VERSION );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/RemoteInterface.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,112 @@
+# Microsoft Developer Studio Project File - Name="RemoteInterface" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=RemoteInterface - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "RemoteInterface.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "RemoteInterface.mak" CFG="RemoteInterface - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "RemoteInterface - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "RemoteInterface - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "RemoteInterface - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "./bin/Release"
+# PROP Intermediate_Dir "./bin/Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "./inc" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "RemoteInterface - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "./bin/Debug"
+# PROP Intermediate_Dir "./bin/Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "./inc" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "RemoteInterface - Win32 Release"
+# Name "RemoteInterface - Win32 Debug"
+# Begin Group "src"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\CRemoteInterface.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\CTCPTransport.cpp
+# End Source File
+# End Group
+# Begin Group "inc"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\CRemoteInterface.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\CTCPTransport.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\MUCCTransport.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/RemoteInterface.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "RemoteInterface"=.\RemoteInterface.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "Test"=.\Test\Test.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name RemoteInterface
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/Test/Test.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,136 @@
+# Microsoft Developer Studio Project File - Name="Test" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Test - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Test.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Test.mak" CFG="Test - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Test - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Test - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Test - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "./bin/Release"
+# PROP Intermediate_Dir "./bin/Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "Test - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "./bin/Debug"
+# PROP Intermediate_Dir "./bin/Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Test - Win32 Release"
+# Name "Test - Win32 Debug"
+# Begin Group "src"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\test.cpp
+# End Source File
+# End Group
+# Begin Group "inc"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "lib"
+
+# PROP Default_Filter ""
+# Begin Group "debug"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Debug\RemoteInterface.lib
+
+!IF  "$(CFG)" == "Test - Win32 Release"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF  "$(CFG)" == "Test - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "release"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\bin\Release\RemoteInterface.lib
+
+!IF  "$(CFG)" == "Test - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "Test - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/Test/src/test.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "CRemoteInterface.h"
+
+// Test constant values
+const char	KRemoteHost[]		= { "10.16.163.13:666" };
+const char	KServiceName[]		= { "TestService" };
+
+int main()
+	{
+	// Some basic unit tests which call the test service via the UCC
+	CRemoteInterface rif( KRemoteHost );
+
+	// Start the service
+	rif.SetupStartService( KServiceName );
+	int ret = rif.Send();
+	if( ret )
+		{
+		printf( "*** FAILED ***" );
+		return ret;
+		}
+
+	// TestCallOne
+	printf( "Sending TestCallOne\n" );
+	rif.SetupCall( KServiceName, "TestCallOne" );
+	rif.AddParam( "PARAM1", "HELLO" );
+	rif.AddParam( "PARAM2", "WORLD" );
+	ret = rif.Send();
+	if( ret )
+		{
+		printf( "*** FAILED ***" );
+		return ret;
+		}
+
+	// TestCallTwo
+	printf( "Sending TestCallTwo\n" );
+	rif.SetupCall( KServiceName, "TestCallTwo" );
+	rif.AddParam( "PARAM1", "HELLO" );
+	rif.AddParam( "PARAM2", "WORLD" );
+	rif.AddParam( "PARAM3", "AGAIN" );
+	ret = rif.Send();
+	if( ret )
+		{
+		printf( "*** FAILED ***" );
+		return ret;
+		}
+
+	// TestCallThree
+	printf( "Sending TestCallThree\n" );
+	rif.SetupCall( KServiceName, "TestCallThree" );
+	rif.AddParam( "PARAM1", "PARAM1" );
+	rif.AddParam( "PARAM2", "PARAM2" );
+	rif.AddParam( "PARAM3", "PARAM3" );
+	rif.AddParam( "PARAM4", "PARAM4" );
+	rif.AddParam( "PARAM5", "PARAM5" );
+	rif.AddParam( "PARAM6", "PARAM6" );
+	rif.AddParam( "PARAM7", "PARAM7" );
+	rif.AddParam( "PARAM8", "PARAM8" );
+	rif.AddParam( "PARAM9", "PARAM9" );
+	rif.AddParam( "PARAM10", "PARAM10" );
+	ret = rif.Send();
+	if( ret )
+		{
+		printf( "*** FAILED ***" );
+		return ret;
+		}
+
+	// Stop the service
+	rif.SetupStopService( KServiceName );
+	ret = rif.Send();
+	if( ret )
+		{
+		printf( "*** FAILED ***" );
+		return ret;
+		}
+
+	return 0;
+	}
Binary file testexecmgmt/ucc/RemoteInterface/bin/Debug/RemoteInterface.lib has changed
Binary file testexecmgmt/ucc/RemoteInterface/bin/Release/RemoteInterface.lib has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/inc/CRemoteInterface.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CREMOTEINTERFACE_H__
+#define __CREMOTEINTERFACE_H__
+
+#include <string>
+#include "MUCCTransport.h"
+
+#define MAXCOMMANDLINELEN		1024
+
+// Error codes
+typedef enum {
+	TRI_SUCCESS,
+	TRI_ERRINTIALISING,
+	TRI_ERRSENDING,
+	TRI_ERRRECV,
+	TRI_INVALIDREPLY,
+	TRI_VARNAMETOOLONG,
+	TRI_VARVALTOOLONG,
+	TRI_COMMANDLINETOOLONG
+} TRIError;
+
+// Definitions
+#define CMD_REQ_RUNCOMMAND		6
+
+typedef struct {
+	int iUid;
+	int iCmdID;
+	int iDataLen;
+} TPHeader;
+
+typedef struct {
+	char iCommandLine[MAXCOMMANDLINELEN] ;
+	int iResult;
+} TRunCommandRequest;
+
+typedef struct {
+	int iResult;
+} TRunCommandReply;
+
+class CRemoteInterface
+	{
+public:
+	CRemoteInterface( const string &aDestination );
+	~CRemoteInterface();
+
+	void SetupStartService( const string &aServiceName );
+	void SetupStopService( const string &aServiceName );
+	void SetupCall( const string &aServiceName, const string &aCall );
+	void AddParam( const string &aName, const string &aValue );
+	int Send();
+
+private:
+	void DefaultSetupCall( const string &aServiceName, const string &aMethodID );
+
+	MUCCTransport	*iTransport;
+	bool			iConnected;
+	string			iDestination;
+	bool			iIsSetup;
+	string			iCommandLine;
+
+	int				iRand_UID;
+	double			iRandomSeed;
+	};
+
+#endif // __CREMOTEINTERFACE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/inc/CTCPTransport.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CTCPTRANSPORT_H__
+#define __CTCPTRANSPORT_H__
+
+#include <winsock2.h>
+#include "MUCCTransport.h"
+ 
+class CTCPTransport : public MUCCTransport
+	{
+public:
+	// construction
+	CTCPTransport();
+	virtual ~CTCPTransport();
+	virtual int Connect( const string &aDestination );
+	virtual void Disconnect();
+	virtual int RequestSend( const char* aData, const int aLength );
+	virtual int RequestReceive( char *aBuff, const int aLength );
+
+private:
+	SOCKET		iSocket;
+	};
+
+
+#endif // __CTCPTRANSPORT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/inc/MUCCTransport.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __MUCCTRANSPORT_H__
+#define __MUCCTRANSPORT_H__
+
+#include <string>
+
+using std::string;
+
+class MUCCTransport
+	{
+public:
+	virtual ~MUCCTransport() {}
+	virtual int Connect( const string &aDestination ) = 0;
+	virtual void Disconnect() = 0;
+	virtual int RequestSend( const char* aData, const int aLength ) = 0;
+	virtual int RequestReceive( char *aBuff, const int aLength ) = 0;
+	};
+
+#endif // __MUCCTRANSPORT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/src/CRemoteInterface.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <math.h>
+
+#include "CRemoteInterface.h"
+#include "CTCPTransport.h"
+
+// Constant values
+const char	KSpace[]				= { " " };
+const char	KQuote[]				= { "\"" };
+const char	KEquals[]				= { "=" };
+const char	KRunCmd[]				= { "runcmd" };
+const char	KServiceName[]			= { "svcname" };
+const char	KCall[]					= { "call" };
+const char	KMethodID[]				= { "methodid" };
+const char	KStartServiceID[]		= { "1" };
+const char	KStopServiceID[]		= { "2" };
+const char	KDefaultMethodID[]		= { "10" };
+
+CRemoteInterface::CRemoteInterface( const string &aDestination )
+	: iTransport(NULL), iIsSetup(false), iDestination(aDestination), iConnected(false)
+	{
+	iRandomSeed = rand();
+	}
+
+CRemoteInterface::~CRemoteInterface()
+	{
+	if( iTransport )
+		{
+		iTransport->Disconnect();
+		delete iTransport;
+		iTransport = NULL;
+		iConnected = false;
+		}
+	}
+
+void CRemoteInterface::SetupStartService( const string &aServiceName )
+	{
+	// Setup the default start to the command line
+	DefaultSetupCall( aServiceName, KStartServiceID );
+
+	// The command line is now setup
+	iIsSetup = true;
+	}
+
+void CRemoteInterface::SetupStopService( const string &aServiceName )
+	{
+	// Setup the default start to the command line
+	DefaultSetupCall( aServiceName, KStopServiceID );
+
+	// The command line is now setup
+	iIsSetup = true;
+	}
+
+void CRemoteInterface::SetupCall( const string &aServiceName, const string &aCall )
+	{
+	// Setup the default start to the command line
+	DefaultSetupCall( aServiceName, KDefaultMethodID );
+
+	// Add the call
+	iCommandLine += KCall;
+	iCommandLine += KEquals;
+	iCommandLine += KQuote;
+	iCommandLine += aCall;
+	iCommandLine += KQuote;
+	iCommandLine += KSpace;
+
+	// The command line is now setup
+	iIsSetup = true;
+	}
+
+void CRemoteInterface::AddParam( const string &aName, const string &aValue )
+	{
+	// If the command line is setup append the next parameter
+	if( iIsSetup )
+		{
+		iCommandLine += aName;
+		iCommandLine += KEquals;
+		iCommandLine += KQuote;
+		iCommandLine += aValue;
+		iCommandLine += KQuote;
+		iCommandLine += KSpace;
+		}
+	}
+
+int CRemoteInterface::Send()
+	{
+	int ret = 0;
+
+	if( !iTransport )
+		{
+		iTransport = new CTCPTransport();
+		}
+
+	// If the command line is setup then continue with the send
+	if( iIsSetup && iTransport)
+		{
+		if( !iConnected )
+			{
+			// Connect to the UCC
+			ret = iTransport->Connect( iDestination );
+			iConnected = true;
+			}
+		if( !ret )
+			{
+			if ( iCommandLine.size() > MAXCOMMANDLINELEN )
+				{
+				ret = TRI_COMMANDLINETOOLONG;
+				}
+			else
+				{
+				TRunCommandRequest* run_req = new TRunCommandRequest();
+				if( run_req != NULL )
+					{
+					memset( run_req->iCommandLine, 0x00, sizeof(run_req->iCommandLine) );
+					memcpy( run_req->iCommandLine, iCommandLine.c_str(), iCommandLine.size());
+
+					TPHeader header;
+					header.iCmdID = CMD_REQ_RUNCOMMAND;
+					header.iDataLen = sizeof(*run_req);
+					header.iUid = (int)iRand_UID;
+
+					// Send the header first
+					ret = iTransport->RequestSend( (char*)&header, sizeof(header) );
+					ret?ret=TRI_ERRSENDING:ret=0;
+					if( !ret )
+						{
+						// Now send the rest of the data
+						ret = iTransport->RequestSend( (char*)run_req, sizeof(*run_req) );
+						ret?ret=TRI_ERRSENDING:ret=0;
+						}
+
+					// Cleanup
+					delete run_req;
+					}
+				else
+					{
+					ret = TRI_ERRINTIALISING;
+					}
+				}
+			}
+		if( !ret )
+			{
+			// Retrieve the header
+			TPHeader header;
+			ret = iTransport->RequestReceive( (char*)&header, sizeof(header) );
+
+			if( !ret )
+				{
+				TRunCommandReply run_rep;
+				// Retrieve the result
+				ret = iTransport->RequestReceive( (char*)&run_rep, sizeof(run_rep) );
+				ret?ret=TRI_ERRRECV:ret=run_rep.iResult;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+void CRemoteInterface::DefaultSetupCall( const string &aServiceName, const string &aMethodID )
+	{
+	// New call started so clear out the command line buffer
+	iCommandLine.erase();
+
+	// Add the runcmd
+	iCommandLine += KRunCmd;
+	iCommandLine += KSpace;
+
+	// Add the service name
+	iCommandLine += KServiceName;
+	iCommandLine += KEquals;
+	iCommandLine += KQuote;
+	iCommandLine += aServiceName;
+	iCommandLine += KQuote;
+	iCommandLine += KSpace;
+
+	// Append the methodid to the command line
+	iCommandLine += KSpace;
+	iCommandLine += KMethodID;
+	iCommandLine += KEquals;
+	iCommandLine += KQuote;
+	iCommandLine += aMethodID;
+	iCommandLine += KQuote;
+	iCommandLine += KSpace;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/RemoteInterface/src/CTCPTransport.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "CTCPTransport.h"
+
+const int	KMaxIpAddressSize		= 30;
+const int	KMaxPortSize			= 10;
+const char	KSeparator[]			= { ":" };
+
+CTCPTransport::CTCPTransport()
+	: iSocket(INVALID_SOCKET)
+	{
+	}
+
+CTCPTransport::~CTCPTransport()
+	{
+	WSACleanup();
+	}
+
+int CTCPTransport::Connect( const string &aDestination )
+	{
+	int ret = 0;
+
+	// Extract the ipaddress andport number
+	int offset = aDestination.find( KSeparator, 0 );
+	if( offset == -1 )
+		{
+		return SOCKET_ERROR; // Find a better error code
+		}
+	
+	char ipaddress[KMaxIpAddressSize];
+	char port[KMaxPortSize];
+	memset( ipaddress, 0, sizeof(ipaddress) );
+	memset( port, 0, sizeof(port) );
+	aDestination.copy( ipaddress, offset, 0 );
+	aDestination.copy( port, aDestination.length()-offset, offset+1 );
+
+	SOCKADDR_IN addr;
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons( atoi(port) );
+	addr.sin_addr.S_un.S_addr =  inet_addr( ipaddress );
+	
+	WORD version;
+	WSADATA wsaData;
+
+	version = MAKEWORD( 2, 2 );
+	if( WSAStartup( version, &wsaData ) )
+		{
+		return WSAGetLastError();
+		}
+
+	// open the socket
+	iSocket = socket( AF_INET, SOCK_STREAM, 0 );
+	if( iSocket == INVALID_SOCKET )
+		{
+		return WSAGetLastError();
+		}
+
+	ret = connect( iSocket, (struct sockaddr*)&addr, sizeof(addr) );
+	if( ret == SOCKET_ERROR )
+		{
+		return WSAGetLastError();
+		}
+
+	return 0;
+	}
+
+
+void CTCPTransport::Disconnect()
+	{
+	if( iSocket != INVALID_SOCKET )
+		{
+		closesocket( iSocket );
+		iSocket = INVALID_SOCKET;
+		}
+	}
+
+int CTCPTransport::RequestSend( const char* aData, const int aLength )
+	{
+	int bytes_sent_this_round;
+	int total_bytes_to_send = aLength;
+	int total_bytes_sent = 0;
+
+	while( total_bytes_sent < total_bytes_to_send )
+		{
+		bytes_sent_this_round = send( iSocket, &(aData[total_bytes_sent]), total_bytes_to_send - total_bytes_sent, 0 );
+		if( bytes_sent_this_round == SOCKET_ERROR )
+			{
+			return WSAGetLastError();
+			}
+		total_bytes_sent += bytes_sent_this_round;
+		}
+	return 0;
+	}
+
+int CTCPTransport::RequestReceive( char *aBuff, const int aLength )
+	{
+	int received_byte_count = 0;
+	int bytes_to_receive = aLength;
+	int bytes_received_this_round = 1;
+
+	while( received_byte_count < bytes_to_receive )
+		{
+		bytes_received_this_round = recv( iSocket, &(aBuff[received_byte_count]), bytes_to_receive - received_byte_count, 0 );
+		if( bytes_received_this_round == SOCKET_ERROR )
+			{
+			return WSAGetLastError();
+			}
+		else if( bytes_received_this_round == 0 )
+			{
+			return SOCKET_ERROR;
+			}
+
+		received_byte_count += bytes_received_this_round;
+		}
+
+	return 0;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/create_package_for_70_lubbock.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+@rem
+@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@@rem
+@@rem
+
+@echo off
+
+echo ----------------------------------------------------------------------------------------
+echo .
+echo Creating a package with all the required files to run Sample4 on Hurricane/Lubbock
+echo .
+echo ----------------------------------------------------------------------------------------
+
+mkdir cf_70_lubbock_4
+
+xcopy sti.0004.ini			.\cf_70_lubbock_4
+xcopy sts.0004.script			.\cf_70_lubbock_4
+
+xcopy ..\ConfigurationFiles\cdb.70.lubbock.cfg	.\cf_70_lubbock_4
+
+copy \epoc32\release\arm4\urel\scheduletest.exe			.\cf_70_lubbock_4
+copy \epoc32\release\arm4\urel\CINIDATA.DLL			.\cf_70_lubbock_4
+copy \epoc32\release\arm4\urel\INTEGRATIONTESTUTILS.DLL		.\cf_70_lubbock_4
+copy \epoc32\release\arm4\urel\NetworkEmulatorControl.dll	.\cf_70_lubbock_4
+copy \epoc32\release\arm4\urel\NEControlST.dll			.\cf_70_lubbock_4
+copy \epoc32\release\arm4\urel\pingeng.dll			.\cf_70_lubbock_4
+copy \epoc32\release\arm4\urel\InetUtilsST.dll			.\cf_70_lubbock_4
+copy \epoc32\release\arm4\urel\ced.exe				.\cf_70_lubbock_4
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/create_package_for_emulator.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,46 @@
+@rem
+@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@@rem
+@@rem
+
+@echo off
+
+echo -------------------------------------------------------------------------------
+echo .
+echo Copying all configuration and script files to required locations (wins/winscw).
+echo .
+echo -------------------------------------------------------------------------------
+
+mkdir ..\..\..\wins\c\NE
+mkdir ..\..\..\winscw\c\NE
+
+copy ..\ConfigurationFiles\dcomm.ini ..\..\..\data\
+
+copy ..\ConfigurationFiles\cdb.emulator*.cfg ..\..\..\wins\c\NE
+copy .\sti.0003.ini ..\..\..\wins\c\NE
+copy .\sti.0005.ini ..\..\..\wins\c\NE
+copy .\sti.0007.ini ..\..\..\wins\c\NE
+copy .\sts.0003.script ..\..\..\wins\c\NE
+copy .\sts.0005.script ..\..\..\wins\c\NE
+copy .\sts.0007.script ..\..\..\wins\c\NE
+
+copy ..\ConfigurationFiles\cdb.emulator*.cfg ..\..\..\winscw\c\NE
+copy .\sti.0003.ini ..\..\..\winscw\c\NE
+copy .\sti.0005.ini ..\..\..\winscw\c\NE
+copy .\sti.0007.ini ..\..\..\winscw\c\NE
+copy .\sts.0003.script ..\..\..\winscw\c\NE
+copy .\sts.0005.script ..\..\..\winscw\c\NE
+copy .\sts.0007.script ..\..\..\winscw\c\NE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/create_package_for_lubbock.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,47 @@
+@rem
+@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@@rem
+@@rem
+
+@echo off
+
+echo ----------------------------------------------------------------------------------------
+echo .
+echo Creating a package with all the required files to run Sample4 on Typhoon/Lubbock
+echo .
+echo ----------------------------------------------------------------------------------------
+
+mkdir cf_lubbock
+
+xcopy sti.0004.ini			.\cf_lubbock
+xcopy sts.0004.script			.\cf_lubbock
+xcopy sti.0006.ini			.\cf_lubbock
+xcopy sts.0006.script			.\cf_lubbock
+
+
+copy \epoc32\release\arm4\urel\scheduletest.exe			.\cf_lubbock
+copy \epoc32\release\arm4\urel\CINIDATA.DLL			.\cf_lubbock
+copy \epoc32\release\arm4\urel\INTEGRATIONTESTUTILS.DLL		.\cf_lubbock
+copy \epoc32\release\arm4\urel\NetworkEmulatorControl.dll	.\cf_lubbock
+copy \epoc32\release\arm4\urel\NEControlST.dll			.\cf_lubbock
+copy \epoc32\release\arm4\urel\pingeng.dll			.\cf_lubbock
+copy \epoc32\release\arm4\urel\InetUtilsST.dll			.\cf_lubbock
+copy \epoc32\release\arm4\urel\TS_SockBench.DLL			.\cf_lubbock
+
+copy \epoc32\release\arm4\urel\ced.exe				.\cf_lubbock
+copy \epoc32\release\arm4\urel\ceddump.exe			.\cf_lubbock
+
+copy ..\ConfigurationFiles\cdb.lubbock.cfg 			.\cf_lubbock
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/script.0001.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,178 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+#######################################################################################
+#
+# USE-CASE-1 : Configure the QoS of a Linux-to-Linux PPP channel
+#
+#######################################################################################
+
+#######################################################################################
+#
+# Start the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penmn"	methodid=1
+	check RESULT=0
+runcmd svcid=8 svchost="penmn"	methodid=1
+	check RESULT=0
+runcmd svcid=10 svchost="penmn"	methodid=1
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=1
+	check RESULT=0
+runcmd svcid=6 svchost="penuu" methodid=1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Create two MTs and make them talk to each other
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=dev0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=dev1
+	assign local_uu_port1=AIR_INPORT
+
+runcmd svcid=5 svchost="penmn"		methodid=10 DEVICEID=dev0	REMOTE_ADDRESS="192.168.10.11"		REMOTE_PORT=local_uu_port1
+runcmd svcid=5 svchost="penpdsn"	methodid=10 DEVICEID=dev1	REMOTE_ADDRESS="192.168.14.10"		REMOTE_PORT=local_uu_port0
+
+
+#######################################################################################
+#
+# Create two PPP sessions and wait for them to connect to one another
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=31 MADDR="localhost" MPORT=7000 MTID=dev0 CONFIG="defaultroute noauth debug nodetach noaccomp nobsdcomp nodeflate novjccomp"
+	assign sid0=RESULT
+runcmd svcid=7 svchost="penpdsn"	methodid=31 MADDR="localhost" MPORT=7000 MTID=dev1 CONFIG="noauth 192.168.200.20:192.168.200.10 debug nodetach noaccomp nobsdcomp nodeflate novjccomp"
+	assign sid1=RESULT
+runcmd svcid=7 svchost="penmn"		methodid=7 SID=sid0
+	waitfor SESSION_STATUS=2
+runcmd svcid=7 svchost="penpdsn"	methodid=7 SID=sid1
+	waitfor SESSION_STATUS=2
+
+
+#######################################################################################
+#
+# Set the drop percentage and capture a few ping commands - you can use the 
+# icmp seq no to see how many were lost
+#
+#######################################################################################
+runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=20 PROTOCOL="UDP"
+runcmd svcid=9 svchost="localhost" methodid=4 MSG="The drop rate of the PPP channel has been set to 20%. You can see the effect of this using the ICMP sequence numbers in the ping output below."
+runcmd svcid=8 svchost="penmn" methodid=3 COMMAND="ping -c 10 192.168.12.11" TIMEOUT=-1 GETSTDOUT=1 GETSTDERR=1
+runcmd svcid=8 svchost="penmn" methodid=3 COMMAND="ping -c 10 192.168.12.11" TIMEOUT=-1 GETSTDOUT=1 GETSTDERR=1
+
+
+#######################################################################################
+#
+# Now give the user a turn to play
+#
+#######################################################################################
+signal 
+waitforsignal
+runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=0 PROTOCOL="UDP"
+
+
+#######################################################################################
+#
+# Set the delay percentage and play
+#
+#######################################################################################
+runcmd svcid=6 svchost="penuu" methodid=3 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DELAYI=150 PROTOCOL="UDP"
+runcmd svcid=9 svchost="localhost" methodid=4 MSG="The delay of the PPP channel has been set to 150ms. You can see the effect of this using the ICMP sequence numbers in the ping output below."
+runcmd svcid=10 svchost="penmn" methodid=31 CMD="ping 192.168.12.11"
+	assign pid0=RESULT
+runcmd svcid=10 svchost="penmn" methodid=8 PID=pid0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+runcmd svcid=10 svchost="penmn" methodid=8 PID=pid0
+runcmd svcid=10 svchost="penmn" methodid=5 PID=pid0
+runcmd svcid=10 svchost="penmn" methodid=32 PID=pid0
+runcmd svcid=6 svchost="penuu" methodid=3 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DELAYI=0 PROTOCOL="UDP"
+
+
+#######################################################################################
+#
+# STOP the first ppp peer and then wait for the other end to terminate gracefully.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn" methodid=6 SID=sid0
+	check RESULT=0
+runcmd svcid=7 svchost="penmn" methodid=8 SID=sid0
+runcmd svcid=7 svchost="penmn" methodid=32 SID=sid0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=7 SID=sid1
+	waitfor SESSION_PROCESS_STATUS=3
+	check RESULT=0
+	check SESSION_STATUS=4
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Remove the mobster devices, they should already have stopped
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"	methodid=6 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"	methodid=7 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=dev1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=dev1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop all the services
+#
+#######################################################################################
+runcmd svcid=10 svchost="penmn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=8 svchost="penmn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penmn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penmn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=6 svchost="penuu" methodid=2
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Done
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/script.0002.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,433 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+#######################################################################################
+#
+# USE-CASE-2 : Emulate a foreign agent handoff (Linux-to-Linux)
+#
+#######################################################################################
+
+#######################################################################################
+#
+# SECTION-A : General Startup
+#
+#######################################################################################
+#######################################################################################
+#
+# Start the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penmn"		methodid=1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=1
+	check RESULT=0
+runcmd svcid=2 svchost="penha"		methodid=1 BASEINTERFACE=0 BASENETMASK=24 BASESTARTRANGE=100 BASEENDRANGE=199 VIRTUALNETWORKPREFIX="192.168.111.0" VIRTUALNETWORKMASK=24 VIRTUALNETWORKSIZE=4
+	check RESULT=0
+runcmd svcid=3 svchost="penpdsn"	methodid=1 BASEINTERFACEINDEX=0 NETMASK=24 STARTHOSTADDRESSRANGE=100 STOPHOSTADDRESSRANGE=199
+	check RESULT=0
+runcmd svcid=4 svchost="penmn"		methodid=1
+	check RESULT=0
+
+#######################################################################################
+#
+# HOME AGENT: Create a HA session and start the agent
+#
+#######################################################################################
+runcmd svcid=2 svchost="penha" methodid=31
+	assign ha0=RESULT
+runcmd svcid=2 svchost="penha" methodid=3 AGENTID=ha0
+	check RESULT=0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+runcmd svcid=2 svchost="penha" methodid=9 AGENTID=ha0
+	check RESULT=0
+	assign home_agent_address0=STATUS_HOME_AGENT_ADDRESS
+	assign home_address0=VIRTUAL_NETWORK_ADDRESS_0
+
+
+#######################################################################################
+#
+# SECTION-B : Start the first mobile ip session
+#
+#######################################################################################
+#######################################################################################
+#
+# MOBSTER:  Create an MT on the MN and the PDSN and link them to each other. Packetise
+#			PPP frames before sending them over the network.
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=mt0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=mt1
+	assign local_uu_port1=AIR_INPORT
+runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=mt0 REMOTE_ADDRESS="192.169.10.11" REMOTE_PORT=local_uu_port1
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=mt1 REMOTE_ADDRESS="10.22.1.6" REMOTE_PORT=local_uu_port0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Create a session on each machine using the new MTs. The PDSN session will 
+#		specify the IP addresses which the other side will accept.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"   methodid=31 MADDR="localhost" MPORT=7000 MTID=mt0 CONFIG="defaultroute noauth debug nodetach"
+	assign sid0=RESULT
+runcmd svcid=7 svchost="penpdsn" methodid=31 MADDR="localhost" MPORT=7000 MTID=mt1 CONFIG="noauth 192.168.211.20:192.168.211.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# PPP:	Wait for the session to become established
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=7 SID=sid0
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+	assign mn_ppp_interface0=SESSION_INTERFACE_NAME
+runcmd svcid=7 svchost="penpdsn"	 methodid=7 SID=sid1
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+	assign pdsn_ppp_interface0=SESSION_INTERFACE_NAME
+
+
+#######################################################################################
+#
+# FOREIGN AGENT: Create a FA session and start the agent
+#
+#######################################################################################
+runcmd svcid=3 svchost="penpdsn" methodid=31
+	assign fa0=RESULT
+
+
+#######################################################################################
+#
+# FOREIGN AGENT: Start the agent
+#
+#######################################################################################
+runcmd svcid=3 svchost="penpdsn" methodid=3 AGENTID=fa0 INTERFACE=pdsn_ppp_interface0 SOLICITATIONMODE=0
+	check RESULT=0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# MOBILE NODE AGENT: Create a mip session - set the home address - start the agent
+#
+#######################################################################################
+runcmd svcid=4 svchost="penmn" methodid=31
+	assign mn0=RESULT
+runcmd svcid=4 svchost="penmn" methodid=23 AGENTID=mn0 HOME_ADDRESS=home_address0 HOME_ADDRESS_PREFIX=24 HOME_AGENT_ADDRESS=home_agent_address0 INTERFACE=mn_ppp_interface0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn" methodid=3 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# CONNECTION ESTABLISHED - signal to do the handover
+#
+#######################################################################################
+runcmd svcid=9 svchost="localhost" methodid=4 MSG="A Mobile IP session has been established for the penmn machine."
+signal
+waitforsignal
+
+
+#######################################################################################
+#
+# SECTION-C : Bring down the first mobile ip session
+#
+#######################################################################################
+#######################################################################################
+#
+# MOBILE NODE AGENT: Stop the agent and cleanup the session
+#
+#######################################################################################
+runcmd svcid=4 svchost="penmn" methodid=4 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn" methodid=32 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# FOREIGN AGENT: Stop the agent and cleanup the session
+#
+#######################################################################################
+runcmd svcid=3 svchost="penpdsn" methodid=4 AGENTID=fa0
+	check RESULT=0
+runcmd svcid=3 svchost="penpdsn" methodid=32 AGENTID=fa0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Stop the PPP session from the PDSN side and wait for the MN to exit. Retrieve
+#		all logs before removing the objects.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+runcmd svcid=7 svchost="penmn"	methodid=7 SID=sid0
+	waitfor SESSION_PROCESS_STATUS=3
+	check RESULT=0
+	check SESSION_STATUS=4
+runcmd svcid=7 svchost="penmn" methodid=8 SID=sid0
+runcmd svcid=7 svchost="penmn" methodid=32 SID=sid0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# MOBSTER: Remove the mobster devices, they should already have stopped
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=mt0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=mt0
+	check RESULT=0
+
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=mt1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=mt1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# SECTION-D : Start the first mobile ip session (Exact copy of section-b except that
+#			  the ppp level IP addresses have changed).
+#
+#######################################################################################
+#######################################################################################
+#
+# MOBSTER:  Create an MT on the MN and the PDSN and link them to each other. Packetise
+#			PPP frames before sending them over the network.
+#
+#######################################################################################
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=4000
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=mt0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=mt1
+	assign local_uu_port1=AIR_INPORT
+runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=mt0 REMOTE_ADDRESS="192.169.10.11" REMOTE_PORT=local_uu_port1
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=mt1 REMOTE_ADDRESS="10.22.1.6" REMOTE_PORT=local_uu_port0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Create a session on each machine using the new MTs. The PDSN session will 
+#		specify the IP addresses which the other side will accept.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"   methodid=31 MADDR="localhost" MPORT=7000 MTID=mt0 CONFIG="defaultroute noauth debug nodetach"
+	assign sid0=RESULT
+runcmd svcid=7 svchost="penpdsn" methodid=31 MADDR="localhost" MPORT=7000 MTID=mt1 CONFIG="noauth 192.168.221.20:192.168.221.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# PPP:	Wait for the session to become established
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=7 SID=sid0
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+	assign mn_ppp_interface0=SESSION_INTERFACE_NAME
+runcmd svcid=7 svchost="penpdsn"	 methodid=7 SID=sid1
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+	assign pdsn_ppp_interface0=SESSION_INTERFACE_NAME
+
+
+#######################################################################################
+#
+# FOREIGN AGENT: Create a FA session and start the agent
+#
+#######################################################################################
+runcmd svcid=3 svchost="penpdsn" methodid=31
+	assign fa0=RESULT
+
+
+#######################################################################################
+#
+# FOREIGN AGENT: Start the agent
+#
+#######################################################################################
+runcmd svcid=3 svchost="penpdsn" methodid=3 AGENTID=fa0 INTERFACE=pdsn_ppp_interface0 SOLICITATIONMODE=0
+	check RESULT=0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# MOBILE NODE AGENT: Create a mip session - set the home address - start the agent
+#
+#######################################################################################
+runcmd svcid=4 svchost="penmn" methodid=31
+	assign mn0=RESULT
+runcmd svcid=4 svchost="penmn" methodid=23 AGENTID=mn0 HOME_ADDRESS=home_address0 HOME_ADDRESS_PREFIX=24 HOME_AGENT_ADDRESS=home_agent_address0 INTERFACE=mn_ppp_interface0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn" methodid=3 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# CONNECTION ESTABLISHED - signal to do the handover
+#
+#######################################################################################
+runcmd svcid=9 svchost="localhost" methodid=4 MSG="A Mobile IP session has been established for the penmn machine."
+signal
+waitforsignal
+
+
+#######################################################################################
+#
+# SECTION-E : Bring down the first mobile ip session (exact copy of section-c)
+#
+#######################################################################################
+#######################################################################################
+#
+# MOBILE NODE AGENT: Stop the agent and cleanup the session
+#
+#######################################################################################
+runcmd svcid=4 svchost="penmn" methodid=4 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn" methodid=32 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# FOREIGN AGENT: Stop the agent and cleanup the session
+#
+#######################################################################################
+runcmd svcid=3 svchost="penpdsn" methodid=4 AGENTID=fa0
+	check RESULT=0
+runcmd svcid=3 svchost="penpdsn" methodid=32 AGENTID=fa0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Stop the PPP session from the PDSN side and wait for the MN to exit. Retrieve
+#		all logs before removing the objects.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+runcmd svcid=7 svchost="penmn"	methodid=7 SID=sid0
+	waitfor SESSION_PROCESS_STATUS=3
+	check RESULT=0
+	check SESSION_STATUS=4
+runcmd svcid=7 svchost="penmn" methodid=8 SID=sid0
+runcmd svcid=7 svchost="penmn" methodid=32 SID=sid0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# MOBSTER: Remove the mobster devices, they should already have stopped
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=mt0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=mt0
+	check RESULT=0
+
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=mt1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=mt1
+	check RESULT=0
+
+
+
+#######################################################################################
+#
+# SECTION-X : General Shutdown
+#
+#######################################################################################
+#######################################################################################
+#
+# HOME AGENT: Stop the agent and cleanup
+#
+#######################################################################################
+runcmd svcid=2 svchost="penha" methodid=4 AGENTID=ha0
+	check RESULT=0
+runcmd svcid=2 svchost="penha" methodid=32 AGENTID=ha0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop all the services
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=2 svchost="penha"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=3 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# DONE
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/script.0003.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,131 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+#######################################################################################
+#
+# Start the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=1
+	check RESULT=0
+runcmd svcid=6 svchost="penuu"	methodid=1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Create two MTs and make them talk to each other
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=dev0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=dev1
+	assign local_uu_port1=AIR_INPORT
+
+runcmd svcid=5 svchost="penmn"		methodid=10 DEVICEID=dev0	REMOTE_ADDRESS="192.168.10.11"	REMOTE_PORT=local_uu_port1
+runcmd svcid=5 svchost="penpdsn"	methodid=10 DEVICEID=dev1	REMOTE_ADDRESS="192.168.14.10"	REMOTE_PORT=local_uu_port0
+
+
+#######################################################################################
+#
+# Create a single PPP sessions and wait for the SymbianOS device to connect
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=31 MADDR="localhost" MPORT=7000 MTID=dev1 CONFIG="noauth 192.168.200.20:192.168.200.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# Set the channel to 20% loss rate 
+#
+#######################################################################################
+runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=20 PROTOCOL="UDP"
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Signal the device that the network is setup and wait for a signal that the test
+# has completed
+#
+#######################################################################################
+assign DEVICEID=dev0
+assign COMMDB_ISP_INDEX=2
+signal
+waitforsignal
+runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=0 PROTOCOL="UDP"
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop the PPP session
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Remove the mobster devices (they should already have stopped)
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"	methodid=6 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"	methodid=7 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=dev1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=dev1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop all the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=6 svchost="penuu"		methodid=2 FORCE=0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Done
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/script.0004.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,131 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+#######################################################################################
+#
+# Start the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=1
+	check RESULT=0
+runcmd svcid=6 svchost="penuu"	methodid=1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Create two MTs and make them talk to each other
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=dev0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=dev1
+	assign local_uu_port1=AIR_INPORT
+
+runcmd svcid=5 svchost="penmn"		methodid=10 DEVICEID=dev0	REMOTE_ADDRESS="192.168.10.11"	REMOTE_PORT=local_uu_port1
+runcmd svcid=5 svchost="penpdsn"	methodid=10 DEVICEID=dev1	REMOTE_ADDRESS="192.168.14.10"	REMOTE_PORT=local_uu_port0
+
+
+#######################################################################################
+#
+# Create a single PPP sessions and wait for the SymbianOS device to connect
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=31 MADDR="localhost" MPORT=7000 MTID=dev1 CONFIG="noauth 192.168.200.20:192.168.200.10 debug nodetach lcp-echo-interval 3 lcp-echo-failure 3"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# Set the channel to 5% loss rate 
+#
+#######################################################################################
+runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=5 PROTOCOL="UDP"
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Signal the device that the network is setup and wait for a signal that the test
+# has completed
+#
+#######################################################################################
+assign DEVICEID=dev0
+assign COMMDB_ISP_INDEX=2
+signal
+waitforsignal
+runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=0 PROTOCOL="UDP"
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop the PPP session
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Remove the mobster devices (they should already have stopped)
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"	methodid=6 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"	methodid=7 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=dev1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=dev1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop all the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=6 svchost="penuu"		methodid=2 FORCE=0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Done
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/script.0005.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,123 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+#######################################################################################
+#
+# USE-CASE-5 : Establish a PPP session and connect to a remote chargen server from
+#			   the wins emulator.
+#
+#######################################################################################
+
+#######################################################################################
+#
+# Start the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Create two MTs and make them talk to each other
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=dev0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=dev1
+	assign local_uu_port1=AIR_INPORT
+
+runcmd svcid=5 svchost="penmn"		methodid=10 DEVICEID=dev0	REMOTE_ADDRESS="penpdsn"	REMOTE_PORT=local_uu_port1
+runcmd svcid=5 svchost="penpdsn"	methodid=10 DEVICEID=dev1	REMOTE_ADDRESS="penmn"		REMOTE_PORT=local_uu_port0
+
+
+#######################################################################################
+#
+# Create a single PPP sessions and wait for the SymbianOS device to connect
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=31 MADDR="localhost" MPORT=7000 MTID=dev1 CONFIG="noauth 192.168.200.20:192.168.200.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# Signal the device that the network is setup and wait for a signal that the test
+# has completed
+#
+#######################################################################################
+assign DEVICEID=dev0
+assign COMMDB_ISP_INDEX=2
+signal
+waitforsignal
+
+
+#######################################################################################
+#
+# Stop the PPP session
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Remove the mobster devices (they should already have stopped)
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"	methodid=6 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"	methodid=7 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=dev1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=dev1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop all the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Done
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/script.0006.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,124 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+#######################################################################################
+#
+# USE-CASE-6 : Establish a PPP session and connect to a remote chargen server from
+#			   the lubbock board.
+#
+#######################################################################################
+
+#######################################################################################
+#
+# Start the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Create two MTs and make them talk to each other
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
+	assign dev1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=dev0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=dev1
+	assign local_uu_port1=AIR_INPORT
+
+runcmd svcid=5 svchost="penmn"		methodid=10 DEVICEID=dev0	REMOTE_ADDRESS="penpdsn"	REMOTE_PORT=local_uu_port1
+runcmd svcid=5 svchost="penpdsn"	methodid=10 DEVICEID=dev1	REMOTE_ADDRESS="penmn"		REMOTE_PORT=local_uu_port0
+
+
+#######################################################################################
+#
+# Create a single PPP sessions and wait for the SymbianOS device to connect
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=31 MADDR="localhost" MPORT=7000 MTID=dev1 CONFIG="noauth 192.168.200.20:192.168.200.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# Signal the device that the network is setup and wait for a signal that the test
+# has completed
+#
+#######################################################################################
+assign DEVICEID=dev0
+assign COMMDB_ISP_INDEX=2
+runcmd svcid=9 svchost="localhost" methodid=4 MSG="VERIFY: that the SymbianOS test is running."
+signal
+waitforsignal
+
+
+#######################################################################################
+#
+# Stop the PPP session
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Remove the mobster devices (they should already have stopped)
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"	methodid=6 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"	methodid=7 DEVICEID=dev0
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=dev1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=dev1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Stop all the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Done
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/script.0007.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+#######################################################################################
+#
+# USE-CASE-7 : Verify the control channel between the Symbian OS device and the UCC.
+#
+#######################################################################################
+signal
+waitforsignal
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sti.0003.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,7 @@
+[NetworkEmulatorControl]
+CommPortIndex=0
+UseCaseID=3
+
+[Ping]
+RemoteHost=192.168.12.11
+PingCount=10
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sti.0004.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,7 @@
+[NetworkEmulatorControl]
+CommPortIndex=2
+UseCaseID=4
+
+[Ping]
+RemoteHost=192.168.12.11
+PingCount=10
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sti.0005.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,16 @@
+[NetworkEmulatorControl]
+CommPortIndex=0
+UseCaseID=5
+
+[SocketBench]
+TestName = Typhoon_T_TCPChargen
+NumberOfSets = 1
+DestIPAddress = 192.168.12.11
+
+[Set1]
+TestType = TCPChargen
+VarLengthPackets = False
+PacketSize = 2000
+NumberOfSockets = 1
+NumberOfIterations = 50
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sti.0006.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,15 @@
+[NetworkEmulatorControl]
+CommPortIndex=2
+UseCaseID=6
+
+[SocketBench]
+TestName = Typhoon_T_TCPChargen
+NumberOfSets = 1
+DestIPAddress = 192.168.12.11
+
+[Set1]
+TestType = TCPChargen
+VarLengthPackets = False
+PacketSize = 2000
+NumberOfSockets = 1
+NumberOfIterations = 100
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sti.0007.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,3 @@
+[NetworkEmulatorControl]
+CommPortIndex=2
+UseCaseID=7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sts.0003.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,42 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:     
+//
+LOAD_SUITE InetUtilsST.dll
+LOAD_SUITE NEControlST.dll
+pause_at_end
+
+PRINT -------------------------------------------------------------------------
+PRINT 
+PRINT  Establish a PPP connection and ping a remote server.
+PRINT 
+PRINT -------------------------------------------------------------------------
+PRINT 
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Run some tests
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP 100, NEControlST, StartUseCase,	c:\NE\sti.0003.ini 
+RUN_TEST_STEP 100, NEControlST, WaitForSignal,	c:\NE\sti.0003.ini 
+RUN_TEST_STEP 100, NEControlST, SetDeviceID,	c:\NE\sti.0003.ini 
+RUN_TEST_STEP 100, InetutilsST,	Ping,			c:\NE\sti.0003.ini 
+RUN_TEST_STEP 100, NEControlST, Signal,			c:\NE\sti.0003.ini 
+RUN_TEST_STEP 100, NEControlST, Rendezvous,		c:\NE\sti.0003.ini 
+TEST_COMPLETE
+RUN_TEST_STEP 100, NEControlST, EndUseCase,		c:\NE\sti.0003.ini    
+TEST_COMPLETE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sts.0004.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,42 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:     
+//
+LOAD_SUITE InetUtilsST.dll
+LOAD_SUITE NEControlST.dll
+pause_at_end
+
+PRINT -------------------------------------------------------------------------
+PRINT 
+PRINT  Establish a PPP connection and ping a remote server from Lubbock.
+PRINT 
+PRINT -------------------------------------------------------------------------
+PRINT 
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Run some tests
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP 100, NEControlST, StartUseCase,	c:\sti.0004.ini 
+RUN_TEST_STEP 100, NEControlST, WaitForSignal,	c:\sti.0004.ini 
+RUN_TEST_STEP 100, NEControlST, SetDeviceID,	c:\sti.0004.ini 
+RUN_TEST_STEP 100, InetutilsST,	Ping,			c:\sti.0004.ini 
+RUN_TEST_STEP 100, NEControlST, Signal,			c:\sti.0004.ini 
+RUN_TEST_STEP 100, NEControlST, Rendezvous,		c:\sti.0004.ini 
+TEST_COMPLETE
+RUN_TEST_STEP 100, NEControlST, EndUseCase,		c:\sti.0004.ini    
+TEST_COMPLETE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sts.0005.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:     
+//
+LOAD_SUITE TS_SockBench.dll
+LOAD_SUITE NEControlST.dll
+pause_at_end
+
+PRINT -------------------------------------------------------------------------
+PRINT 
+PRINT  Establish a PPP connection and connect to a remote chargen server (TCP)
+PRINT 
+PRINT -------------------------------------------------------------------------
+PRINT 
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Start the sockbench server
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP 100, TS_SockBench, OpenServer
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Run some tests
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP -1, NEControlST, StartUseCase,	c:\NE\sti.0005.ini 
+RUN_TEST_STEP -1, NEControlST, WaitForSignal,	c:\NE\sti.0005.ini 
+RUN_TEST_STEP -1, NEControlST, SetDeviceID,		c:\NE\sti.0005.ini 
+RUN_TEST_STEP 100, TS_SockBench, TestSockBench,	c:\NE\sti.0005.ini
+RUN_TEST_STEP -1, NEControlST, Signal,			c:\NE\sti.0005.ini 
+RUN_TEST_STEP -1, NEControlST, Rendezvous,		c:\NE\sti.0005.ini 
+TEST_COMPLETE
+RUN_TEST_STEP -1, NEControlST, EndUseCase,		c:\NE\sti.0005.ini    
+TEST_COMPLETE 
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Done
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP 100, TS_SockBench, CloseServer
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sts.0006.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:     
+//
+LOAD_SUITE TS_SockBench.dll
+LOAD_SUITE NEControlST.dll
+pause_at_end
+
+PRINT -------------------------------------------------------------------------
+PRINT 
+PRINT  Establish a PPP connection and connect to a remote chargen server (TCP)
+PRINT 
+PRINT -------------------------------------------------------------------------
+PRINT 
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Start the sockbench server
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP 100, TS_SockBench, OpenServer
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Run some tests
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP -1, NEControlST, StartUseCase,	c:\sti.0006.ini 
+RUN_TEST_STEP -1, NEControlST, WaitForSignal,	c:\sti.0006.ini 
+RUN_TEST_STEP -1, NEControlST, SetDeviceID,		c:\sti.0006.ini 
+RUN_TEST_STEP 100, TS_SockBench, TestSockBench,	c:\sti.0006.ini
+RUN_TEST_STEP -1, NEControlST, Signal,			c:\sti.0006.ini 
+RUN_TEST_STEP -1, NEControlST, Rendezvous,		c:\sti.0006.ini 
+TEST_COMPLETE
+RUN_TEST_STEP -1, NEControlST, EndUseCase,		c:\sti.0006.ini    
+TEST_COMPLETE 
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Done
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP 100, TS_SockBench, CloseServer
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SampleScripts/sts.0007.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,38 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:     
+//
+LOAD_SUITE NEControlST.dll
+pause_at_end
+
+PRINT -------------------------------------------------------------------------
+PRINT 
+PRINT  Verify control channel to UCC
+PRINT 
+PRINT -------------------------------------------------------------------------
+PRINT 
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Run some synchronisation commands
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP -1, NEControlST, StartUseCase,	c:\NE\sti.0007.ini 
+RUN_TEST_STEP -1, NEControlST, WaitForSignal,	c:\NE\sti.0007.ini 
+RUN_TEST_STEP -1, NEControlST, Signal,			c:\NE\sti.0007.ini 
+RUN_TEST_STEP -1, NEControlST, Rendezvous,		c:\NE\sti.0007.ini 
+TEST_COMPLETE
+RUN_TEST_STEP -1, NEControlST, EndUseCase,		c:\NE\sti.0007.ini    
+TEST_COMPLETE 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SetupScripts/clean_emulation_environment.sh	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+####################################################################################################################
+#
+# MAIN():
+#
+####################################################################################################################
+
+
+####################################################################################################################
+#
+# (1) Print info
+#
+####################################################################################################################
+
+
+####################################################################################################################
+#
+# (2) Remove the symlinks
+#
+####################################################################################################################
+rm -f ../bin/pppd
+rm -f ../bin/dynmn_tool
+rm -f ../bin/dynfa_tool
+rm -f ../bin/dynha_tool
+rm -f ../bin/dynmnd
+rm -f ../bin/dynfad
+rm -f ../bin/dynhad
+rm -f ../bin/dynmnd.template.conf
+rm -f ../bin/dynfad.template.conf
+rm -f ../bin/dynhad.template.conf
+rm -f ../bin/dynfad.key
+
+
+####################################################################################################################
+#
+# Done
+#
+####################################################################################################################
+echo "Emulation Environment setup has been cleaned." 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/SetupScripts/setup_emulation_environment.sh	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+####################################################################################################################
+#
+# Global Variables
+#
+####################################################################################################################
+last_path="";
+
+
+####################################################################################################################
+#
+# GetPath
+# 
+# $1 - Name of thing to get the path of
+# $2 - Default path
+#
+# Places pathname in last_path global var
+#
+####################################################################################################################
+GetPath()
+{
+    # Ask for the path
+    echo -n "Enter the path for" $1 "["$2"]: ";
+    read answer rubbish;
+
+    # If the string is empty then replace with the default path
+    if test -z $answer; then
+	last_path=$2;
+    else
+	last_path=$answer;
+    fi
+
+    # Done
+}
+
+
+####################################################################################################################
+#
+# Ask
+#
+# $1 = Question string.
+#
+# Returns 1 for yes 0 for no
+#
+####################################################################################################################
+Ask()
+{
+    echo -n $1 "[yes / no] ";
+    read answer rubbish;
+    if [ $answer = "yes" ]; then
+	return 1;
+    else
+	return 0;
+    fi
+}
+
+
+
+####################################################################################################################
+#
+# MAIN():
+#
+####################################################################################################################
+
+
+####################################################################################################################
+#
+# (1) Print info
+#
+####################################################################################################################
+clear
+echo --------------------------------------------------------------------------------------------------------------
+echo
+echo "    Emulation Environment setup for the Network Emulator       "
+echo
+echo --------------------------------------------------------------------------------------------------------------
+
+
+####################################################################################################################
+#
+# (2) Get path information
+#
+####################################################################################################################
+GetPath "pppd" "/usr/sbin/pppd"
+pppd_path=$last_path;
+GetPath "the dynamics agents" "/home/penuser/dynamics/sbin/"
+dynamics_sbin_path=$last_path;
+echo --------------------------------------------------------------------------------------------------------------
+
+
+####################################################################################################################
+#
+# (3) Setup the symlinks
+#
+####################################################################################################################
+ln -v -f -s $pppd_path ../bin/pppd
+
+ln -v -f -s $dynamics_sbin_path/dynmn_tool ../bin/dynmn_tool
+ln -v -f -s $dynamics_sbin_path/dynfa_tool ../bin/dynfa_tool
+ln -v -f -s $dynamics_sbin_path/dynha_tool ../bin/dynha_tool
+
+ln -v -f -s $dynamics_sbin_path/dynmnd ../bin/dynmnd
+ln -v -f -s $dynamics_sbin_path/dynfad ../bin/dynfad
+ln -v -f -s $dynamics_sbin_path/dynhad ../bin/dynhad
+
+ln -v -f -s ../ConfigurationFiles/dynmnd.ref_template.conf ../bin/dynmnd.template.conf
+ln -v -f -s ../ConfigurationFiles/dynhad.ref_template.conf ../bin/dynhad.template.conf
+ln -v -f -s ../ConfigurationFiles/dynfad.ref_template.conf ../bin/dynfad.template.conf
+
+ln -v -f -s $dynamics_sbin_path/../etc/dynfad.key ../bin/dynfad.key
+
+echo --------------------------------------------------------------------------------------------------------------
+
+
+####################################################################################################################
+#
+# Done
+#
+####################################################################################################################
+echo "    Setup successful"
+echo --------------------------------------------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/AliasLibrary/CInterfaceAlias.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,498 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <assert.h>
+#include <string.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ctype.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CInterfaceAlias.h"
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXALIASNAME                  64
+#define MAXALIASCOUNT                 1024
+#define MAXINTERFACECOUNT             1024
+#define ETHERNET_INTERFACE_PREFIX     "eth"
+
+/*******************************************************************************
+ *
+ * IMPLEMENTATION: CInterfaceAlias
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * PUBLIC: CInterfaceAlias
+ *
+ ******************************************************************************/
+CInterfaceAlias::CInterfaceAlias()
+{
+  iState = IAS_INIT;
+  iBaseInterfaceIndex = 0;
+  iAliasIndex = 0;
+}
+
+CInterfaceAlias::~CInterfaceAlias()
+{
+  assert( iState != IAS_UP );
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC: CreateNewInterfaceAlias
+ *
+ ******************************************************************************/
+TInterfaceAliasError CInterfaceAlias::CreateNewInterfaceAlias( int aBaseInterfaceIndex, int aNetMask, int aHostAddress, int *aAliasIndex, int *aErrorCode )
+{
+  int alias_index;
+  char alias_name_temp[MAXALIASNAME];
+  int sockfd;
+  int err;
+  struct sockaddr_in base_interface_addr;
+  struct ifreq ifr;
+  struct sockaddr_in *saddr;
+  TInterfaceAliasError rv;
+
+  // check the state
+  if( iState != IAS_INIT ) {
+    return IE_INVALID_STATE;
+  }
+
+  // check the params
+  assert( aAliasIndex != NULL );
+  assert( aErrorCode != NULL );
+  *aErrorCode = 0;
+  *aAliasIndex = -1;
+  if( aBaseInterfaceIndex < 0 ) {
+    return IE_INVALID_PARAM;
+  }
+
+  // get a free alias index
+  rv = GetFreeAliasIndex( aBaseInterfaceIndex, &alias_index, aErrorCode );
+  if( rv != IE_NONE ) {
+    return rv;
+  }
+
+  // get the address of the base interface
+  rv = GetBaseInterfaceAddress( aBaseInterfaceIndex, &base_interface_addr, aErrorCode );
+  if( rv != IE_NONE ) {
+    return rv;
+  }
+
+  // now strip off the host part and replace with the passed host address
+  base_interface_addr.sin_addr.s_addr = ChangeHostAddress( base_interface_addr.sin_addr.s_addr, aNetMask, aHostAddress ); 
+
+  // setup the interface name
+  sprintf( alias_name_temp, "eth%d:%d", aBaseInterfaceIndex, alias_index );
+  assert( (strlen(alias_name_temp) + 1) < IFNAMSIZ );
+
+  // create a socket to make ioctl calls on
+  sockfd = socket( AF_INET, SOCK_DGRAM, 0 );
+  if( sockfd <= 0 ) {
+    *aErrorCode = errno;
+    return IE_SOCKET_FAILED;
+  }
+
+  // setup the request
+  memcpy( ifr.ifr_name, alias_name_temp, strlen(alias_name_temp) + 1 );
+  saddr = (struct sockaddr_in*)(&(ifr.ifr_addr));
+  saddr->sin_family = AF_INET;
+  saddr->sin_port = 0;
+  saddr->sin_addr = base_interface_addr.sin_addr;
+
+  // make the ioctl call
+  err = ioctl( sockfd, SIOCSIFADDR, &ifr );
+  close( sockfd );
+  if( err == -1 ) {
+    *aErrorCode = errno;
+    return IE_IOCTL_FAILED;
+  }
+
+  // update the state vars
+  iState = IAS_UP;
+  iBaseInterfaceIndex = aBaseInterfaceIndex;
+  *aAliasIndex = iAliasIndex = alias_index;
+  iInterfaceName = alias_name_temp;
+  iInterfaceAddress = inet_ntoa( base_interface_addr.sin_addr );
+
+  // done
+  return IE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC:  DestroyInterfaceAlias
+ *
+ ******************************************************************************/
+TInterfaceAliasError CInterfaceAlias::DestroyInterfaceAlias( int *aErrorCode )
+{
+  int sockfd;
+  int err;
+  struct ifreq ifr;
+  char ifn[64];
+
+  // check state
+  if( iState != IAS_UP ) {
+    return IE_INVALID_STATE;
+  }
+
+  // check params
+  assert( aErrorCode != NULL );
+  *aErrorCode = 0;
+
+  // create a socket to make ioctl calls on
+  sockfd = socket( AF_INET, SOCK_DGRAM, 0 );
+  assert( sockfd >= 0 );
+  
+  // setup the request record
+  sprintf( ifn, "eth%d:%d", iBaseInterfaceIndex, iAliasIndex );
+  memcpy( ifr.ifr_name, ifn, strlen(ifn) + 1 );
+  ifr.ifr_flags = 0;
+  
+  // get the current flags - this is very important since most flags actually go straight through to
+  // base interface - so we need to keep this and just clear the IFF_UP flag which is local to the alias
+  err = ioctl( sockfd, SIOCGIFFLAGS, &ifr );
+  if( err == -1 ) {
+    iState = IAS_DOWN;
+    *aErrorCode = errno;
+    close( sockfd );
+    return IE_IOCTL_FAILED;
+  }
+
+  // mask out the IFF_UP flag
+  ifr.ifr_flags &= ~IFF_UP; 
+
+  // make the ioctl calls 
+  err = ioctl( sockfd, SIOCSIFFLAGS, &ifr );
+  close( sockfd );
+  if( err == -1 ) {
+    iState = IAS_DOWN;
+    *aErrorCode = errno;
+    return IE_IOCTL_FAILED;
+  }
+  
+  // otherwise done
+  iState = IAS_DOWN;
+  return IE_NONE;
+}
+
+
+
+/*******************************************************************************
+ *
+ * PUBLIC:  GetInterfaceIndex
+ *
+ ******************************************************************************/
+TInterfaceAliasError CInterfaceAlias::GetInterfaceIndex( int *aBaseInterfaceIndex, int *aAliasIndex )
+{
+  // check params
+  assert( aBaseInterfaceIndex != NULL );
+  assert( aAliasIndex != NULL );
+
+  // check state
+  if( iState == IAS_INIT ) {
+    return IE_INVALID_STATE;
+  }
+
+  // return info
+  *aBaseInterfaceIndex = iBaseInterfaceIndex;
+  *aAliasIndex = iAliasIndex;
+  return IE_NONE;
+}
+
+ 
+/*******************************************************************************
+ *
+ * PUBLIC:  GetInterfaceName
+ *
+ ******************************************************************************/
+TInterfaceAliasError CInterfaceAlias::GetInterfaceName( string *aInterfaceName )
+{
+  assert( aInterfaceName != NULL );
+  if( iState == IAS_INIT ) {
+    return IE_INVALID_STATE;
+  }
+  *aInterfaceName = iInterfaceName;
+  return IE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC:  GetInterfaceAddress
+ *
+ ******************************************************************************/
+TInterfaceAliasError CInterfaceAlias::GetInterfaceAddress( string *aInterfaceAddress )
+{
+  assert( aInterfaceAddress != NULL );
+  if( iState == IAS_INIT ) {
+    return IE_INVALID_STATE;
+  }
+  *aInterfaceAddress = iInterfaceAddress;
+  return IE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE: ParseInterfaceName
+ *
+ ******************************************************************************/
+int CInterfaceAlias::ParseInterfaceName( char *aInterfaceName, int *aBaseIndex, int *aAliasIndex )
+{
+  int rv;
+ 
+  // check params
+  assert( aInterfaceName != NULL );
+  assert( aBaseIndex != NULL );
+  assert( aAliasIndex != NULL );
+
+  // init params
+  *aBaseIndex = *aAliasIndex = -1;
+
+  // do the scanf
+  rv = sscanf( aInterfaceName, "eth%d:%d", aBaseIndex, aAliasIndex );
+
+  // return valid if at least a base index was read
+  if( rv >= 1 ) {
+    return 1;
+  }
+  return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE: GetInterfaceList
+ *
+ ******************************************************************************/
+TInterfaceAliasError CInterfaceAlias::GetInterfaceList( char *aInterfaceBuffer, int aInputBufferLength, int *aOutputBufferLength, int *aErrorCode )
+{
+  int sockfd;
+  int err;
+  struct ifconf ifc;
+    
+  // check params
+  assert( aInterfaceBuffer != NULL );
+  assert( aOutputBufferLength != NULL );
+  assert( aErrorCode != NULL );
+
+  // set the params
+  *aOutputBufferLength = *aErrorCode = 0;
+  
+  // create a socket to make ioctl calls on
+  sockfd = socket( AF_INET, SOCK_DGRAM, 0 );
+  if( sockfd <= 0 ) {
+    *aErrorCode = errno;
+    return IE_SOCKET_FAILED;
+  }
+
+  // do the ioctl() call to retrieve all the interfaces
+  ifc.ifc_len = aInputBufferLength;
+  ifc.ifc_buf = aInterfaceBuffer;
+  err = ioctl( sockfd, SIOCGIFCONF, &ifc );
+  close( sockfd );
+  if( err == -1 ) {
+    *aErrorCode = errno;
+    return IE_IOCTL_FAILED;
+  }
+
+  // call was successful, set the output buffer length
+  *aOutputBufferLength = ifc.ifc_len;
+
+  // done
+  return IE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE: GetFreeAliasIndex
+ *
+ ******************************************************************************/ 
+TInterfaceAliasError CInterfaceAlias::GetFreeAliasIndex( int aBaseInterfaceIndex, int *aAliasIndex, int *aErrorCode )
+{
+  TInterfaceAliasError rv;
+  struct ifreq ifr[MAXINTERFACECOUNT];  
+  char alias_status[MAXALIASCOUNT];
+  int is_valid, base_index, alias_index, interface_count, i;
+  int base_index_found = 0;
+  int current_alias_count = 0;
+
+  // check and set params
+  assert( aAliasIndex != NULL );
+  assert( aErrorCode != NULL );
+  *aAliasIndex = 0;
+  *aErrorCode = 0;
+  
+  // clear the arrays
+  memset( alias_status, 0, sizeof(alias_status) );
+
+  // get the interface list
+  rv = GetInterfaceList( (char*)ifr, sizeof(ifr), &interface_count, aErrorCode );
+  if( rv != IE_NONE ) {
+    return rv;
+  }
+  interface_count = interface_count / sizeof(struct ifreq);
+
+  // for each interface entry...
+  for( i = 0; i < interface_count; i++ ) {
+    
+    // parse the name of the interface
+    is_valid = ParseInterfaceName( (ifr[i]).ifr_name, &base_index, &alias_index );
+
+    // process the interface
+    if( (is_valid) && (base_index == aBaseInterfaceIndex) ) {
+      base_index_found = 1;
+      if( alias_index >= 0 ) {
+	assert( alias_index < MAXALIASCOUNT );
+	alias_status[alias_index] = 1;
+	current_alias_count++;
+      }
+    }
+  }
+  
+  // see if there are any free aliases
+  if( current_alias_count == MAXALIASCOUNT ) {
+    return IE_NO_FREE_ALIAS;
+  }
+
+  // otherwise return the first free alias
+  for( i = 0; i < MAXALIASCOUNT; i++ ) {
+    if( alias_status[i] == 0 )
+      break;
+  }
+  assert( i < MAXALIASCOUNT );
+  
+  // done
+  *aAliasIndex = i;
+  return IE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE: GetBaseInterfaceAddress
+ *
+ ******************************************************************************/ 
+TInterfaceAliasError CInterfaceAlias::GetBaseInterfaceAddress( int aBaseInterfaceIndex, struct sockaddr_in *aInterfaceAddress, int *aErrorCode )
+{
+  int sockfd, err;
+  struct ifreq ifr;
+
+  // check args
+  assert( aInterfaceAddress != NULL );
+  assert( aErrorCode != NULL );
+  *aErrorCode = 0;
+
+  // create the interface name
+  memset( &ifr, 0, sizeof(ifr) );
+  snprintf( ifr.ifr_name, IFNAMSIZ, "eth%d", aBaseInterfaceIndex );
+  
+  // create a socket to make the ioctl calls on
+  sockfd = socket( AF_INET, SOCK_DGRAM, 0 );
+  if( sockfd <= 0 ) {
+    *aErrorCode = errno;
+    return IE_SOCKET_FAILED;
+  }
+
+  // make the ioctl call
+  err = ioctl( sockfd, SIOCGIFADDR, &ifr );
+  close( sockfd );
+  if( err == -1 ) {
+    *aErrorCode = errno;
+    return IE_IOCTL_FAILED;
+  }
+    
+  // save the address
+  *aInterfaceAddress = *((struct sockaddr_in*)(&ifr.ifr_addr));
+  
+  // done
+  return IE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE: ChangeHostAddress
+ *
+ ******************************************************************************/ 
+int CInterfaceAlias::ChangeHostAddress( int aBaseAddress, int aNetMask, int aHostAddress )
+{
+  int hostmask = 0;
+  int netmask = 0;
+  int rv;
+
+  // create masks for the netpart and the hostpart
+  netmask = NetmaskFromBitcount( aNetMask );
+  hostmask = ~netmask;
+
+  // now create the address
+  rv = ntohl( aBaseAddress );
+  rv &= netmask;
+  rv |= (aHostAddress & hostmask);
+  rv = htonl( rv );
+  return rv;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE: NetmaskFromBitcount
+ *
+ ******************************************************************************/ 
+int CInterfaceAlias::NetmaskFromBitcount( int aBitCount )
+{
+  int i, netmask = 0;
+  for( netmask = 0, i = 0; i < aBitCount; i++ ) {
+    netmask |= 1<<(31-i);
+  }
+  return netmask;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/AliasLibrary/CInterfaceAlias.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CInterfaceAlias
+*
+*/
+
+
+
+#ifndef __CINTERFACEALIAS_H__
+#define __CINTERFACEALIAS_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <string>
+using namespace std;
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+typedef enum {
+  IAS_INIT,
+  IAS_UP,
+  IAS_DOWN
+} TInterfaceState;
+
+typedef enum {
+  IE_NONE,
+  IE_NO_FREE_ALIAS,
+  IE_INVALID_PARAM,
+  IE_SOCKET_FAILED,
+  IE_INVALID_ADDR,
+  IE_IOCTL_FAILED,
+  IE_INVALID_STATE,
+  IE_INVALID_INTERFACE
+} TInterfaceAliasError;
+
+/*******************************************************************************
+ *
+ * Class CInterfaceAlias
+ *
+ ******************************************************************************/
+class CInterfaceAlias
+{
+ public:
+  CInterfaceAlias();
+  ~CInterfaceAlias();
+
+  TInterfaceAliasError CreateNewInterfaceAlias( int aBaseInterfaceIndex, int aNetMask, int aHostAddress, int *aAliasIndex, int *aErrorCode );
+  TInterfaceAliasError DestroyInterfaceAlias( int *aErrorCode );
+  TInterfaceAliasError GetInterfaceIndex( int *aBaseInterfaceIndex, int *aAliasIndex );
+  TInterfaceAliasError GetInterfaceName( string *aInterfaceName );
+  TInterfaceAliasError GetInterfaceAddress( string *aInterfaceAddress );
+
+ private:
+  TInterfaceAliasError GetBaseInterfaceAddress( int aBaseInterfaceIndex, struct sockaddr_in *aInterfaceAddress, int *aErrorCode );
+  TInterfaceAliasError GetFreeAliasIndex( int aBaseInterfaceIndex, int *aAliasIndex, int *aErrorCode );
+  int ParseInterfaceName( char *aInterfaceName, int *aBaseIndex, int *aAliasIndex );
+  TInterfaceAliasError GetInterfaceList( char *aInterfaceBuffer, int aInputBufferLength, int *aOutputBufferLength, int *aErrorCode );
+  int ChangeHostAddress( int aBaseAddress, int aNetMask, int aHostAddress );
+  int NetmaskFromBitcount( int aBitCount );
+
+  TInterfaceState iState;
+  int iBaseInterfaceIndex;
+  int iAliasIndex;
+  string iInterfaceAddress;
+  string iInterfaceName;
+};
+
+#endif //__CINTERFACEALIAS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/AliasLibrary/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../BinInternal/libalias.a
+INCLUDES=
+CFLAGS=		-Wall -gstabs #-ftest-coverage -fprofile-arcs
+
+OBJECTS=	CInterfaceAlias.o
+
+LIBS=
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS)
+	ar -rcs $(TARGET) $(OBJECTS)
+
+%.o:	%.c
+	gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ *.bbg *.bb *.gcov *.da 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/CXClient.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: CXClient.cpp
+* Author: Sanjeet Matharu 
+* This is the client side of the protocol which takes name/value pairs and does stuff
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <memory.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#include <windows.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "cxclient.h"
+
+#define MAXRETRIES		5
+
+//------------------------------------------------------------------------------
+//constructor
+CXClient::CXClient()
+{
+	iClientStatus = SENDING_HELLO;
+
+	sprintf(hellobuffer, "%s", "HELLO");
+	sprintf(goodbyebuffer, "%s", "GOODBYE");
+}
+
+//------------------------------------------------------------------------------
+//destructor
+CXClient::~CXClient()
+{
+	
+}
+
+//------------------------------------------------------------------------------
+//this function adds the specified value into the list of name value pairs
+int CXClient::OnExecute(int handle, char* cValue, int dim1, int dim2)
+{
+	int error = 0;
+	int localsocket = handle;
+	int counter = 0;
+
+	if(localsocket != 0)
+	{
+		error = SendData(localsocket, hellobuffer);
+		//send the hello to the server side first
+		if( error != OK_DATATRANSFER)
+		{
+			//give up and return a message
+			printf("There was a problem saying hello...\n");
+			return -1;
+		}
+	}
+	else
+	{
+		printf("There was a problem with the socket...\n");
+		return -1;
+	}
+
+	//go through the valuebuffer and send the data
+	for(counter = 0; counter < dim1; counter++)
+	{
+		error = SendData(localsocket, &cValue[counter*dim2]);
+		if( error != OK_DATATRANSFER)
+		{
+			//give up and return a message
+			printf("There was a problem sending the data...\n");
+			return -1;
+		}
+	}
+
+	//send the goodbye to the server side 
+	if(localsocket != 0)
+	{
+		error = SendData(localsocket, goodbyebuffer);
+		if( error != OK_DATATRANSFER )
+		{
+			//give up and return a message
+			printf("There was a problem when saying goodbye...\n");
+			return -1;
+		}
+	}
+	else
+	{
+		printf("There was a problem with the socket...\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+//------------------------------------------------------------------------------
+//this sends the hello command to the client over the specified socket to initiate comms
+int CXClient::SendData(int handle, char* aValue)
+{
+	char c;		//this is the buffer that is used to receive the data from across the link
+	char receivebuffer[MAXBUFFERLEN];
+
+	int counter = 0;
+	int bufferlength = 0;
+	int sendcounter = 0;
+	int err = -1;
+	
+	bool success = false;
+	memset(receivebuffer, 0, sizeof(receivebuffer));		//initialise
+
+	bufferlength = strlen(aValue);
+
+	//send the data
+	while( sendcounter < MAXRETRIES ) 
+	{
+		//write to the socket
+		err = WriteClient( handle, HT_SOCKET, aValue, bufferlength );
+
+		//if unable to send for some reason (verify that the error code is the length of one char)
+		if( err != bufferlength )
+		{
+			printf("Data %s sending failed %d...\n", aValue, err);
+			sendcounter++;
+		}
+		else	//print ok 
+		{
+			printf("Data %s sending ok %d chars sent...\n", aValue, bufferlength);
+			sendcounter = MAXRETRIES;
+			//send an end of string character so the server can evaluate what has been received
+			WriteClient( handle, HT_SOCKET, "", 1 );
+		}
+	}
+
+	//receive the reply ONLY if send has succeeded (hence inside the maxretries limit)
+	if( ( sendcounter <= MAXRETRIES ) )
+	{
+		while( 1 )
+		{
+			err = ReadClient( handle, HT_SOCKET, &c );
+
+			if( strcmp( &c, "" ) == 0)
+			{
+				//if there was a problem with the read (i.e. invalid command received from server, knackered link)
+				if( ( err <= 0 ) || ( strcmp(receivebuffer, aValue) != 0 ) )
+				{
+					printf("Data read failed ( device returned %s and receive code was %d )...\n", receivebuffer, err);
+					memset(receivebuffer, 0, sizeof(receivebuffer));		//reset
+					return ERROR_DATATRANSFER;
+				}
+				else
+				{
+					printf("Data read succeeded ( device returned %s )...\n", receivebuffer);
+					memset(receivebuffer, 0, sizeof(receivebuffer));		//reset
+					counter = 0;	//reset
+					break;
+				}
+			}	//if
+
+			receivebuffer[counter++] = c;
+		}		//while
+	}
+	
+	return OK_DATATRANSFER;
+}
+//------------------------------------------------------------------------------
+int CXClient::ReadClient(int handle, int handletype, char* c)
+{
+	int err;
+	
+	assert( c != NULL );
+	
+	// socket handles
+	if( handletype == HT_SOCKET ) 
+	{
+		err = recv( handle, c, 1, 0 );
+		if( err != 1 ) //if the single char has not been received
+		{
+			err = GetLastError();
+			return err;
+		}
+	}
+
+	// success
+	return err;
+}
+
+//------------------------------------------------------------------------------
+int CXClient::WriteClient(int handle, int handletype, char *buff, int bufflen )
+{
+	int err = 0;
+	unsigned long bytes_written = 0;
+
+	assert( buff != NULL );
+
+	// socket handles
+	if( handletype == HT_SOCKET ) 
+	{
+		err = send( handle, buff, bufflen, 0 );
+		if( err != bufflen ) 
+		{
+			err = GetLastError();
+			return err;
+		}
+	}
+
+	return err;	
+}
+
+//------------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/CXClient.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: CXClient.h
+* Author: Sanjeet Matharu 
+* This is the client side of the protocol which sneds name/value pairs and does stuff
+*
+*/
+
+
+
+#ifndef __CXCLIENT_H__
+#define __CXCLIENT_H__
+
+#define HT_SOCKET			0
+#define HT_WIN32FILEHANDLE	1
+#define HT_LINUXFILEHANDLE	2
+
+#define OK_DATATRANSFER		10
+#define ERROR_DATATRANSFER	20
+
+#define REPLY_OK			"OK"
+#define	REPLY_ERROR			"ERROR"
+#define REPLY_TIMEOUT		"TIMEOUT"
+
+#define MAXBUFFERLEN		50
+
+//Types
+typedef enum 
+{
+	SENDING_HELLO,
+	SENDING_GOODBYE,
+	SENDING_DATA,
+} TClientStatus;
+
+//----------------------------------------------------------------------------------
+//generic server class
+class CXClient
+{
+	public:
+
+		//constructor/destructor
+		CXClient();
+		~CXClient();
+
+		int OnExecute(int socket, char* cValue, int dim1, int dim2);
+
+	private:
+
+		//functions
+		int SendHello(int handle);
+		int SendGoodbye(int handle);
+		int SendData(int handle, char* aValue);
+
+		int ReadClient(int handle, int handletype, char* c);
+		int WriteClient(int handle, int handletype, char *buff, int bufflen);
+	
+		//data
+		TClientStatus iClientStatus;
+		char hellobuffer[6];
+		char goodbyebuffer[8];
+};
+
+//----------------------------------------------------------------------------------
+
+#endif __CXCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/cprotocol.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,100 @@
+# Microsoft Developer Studio Project File - Name="cprotocol" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=cprotocol - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "cprotocol.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "cprotocol.mak" CFG="cprotocol - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "cprotocol - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "cprotocol - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "cprotocol - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "cprotocol - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\..\BinInternal\libcprotocol.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "cprotocol - Win32 Release"
+# Name "cprotocol - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CXClient.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CXClient.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/cprotocol.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "cprotocol"=.\cprotocol.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/CXServer.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,455 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: CXServer.cpp
+* Author: Sanjeet Matharu 
+* This is the server side of the protocol which takes name/value pairs and does stuff
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <memory.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#include <windows.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "cxserver.h"
+
+#define TIMEOUTPERIOD	15	//seconds
+
+//------------------------------------------------------------------------------
+//constructor
+CXServer::CXServer()
+{
+	iStatus = RECEIVE_HELLO;	//initialise to RECEIVE_HELLO
+
+	//initialise the name and value pairs
+	for(int i = 0; i < MAXLISTLENGTH; i++)
+	{
+		memset( iList[i].iName, 0, MAXBUFFERLEN );
+		memset( iList[i].iValue, 0, MAXBUFFERLEN );
+	}
+
+	iListPtr = NULL;					//this is used to point to either the name or the value in the list
+	timeout.tv_sec = TIMEOUTPERIOD;		//set up socket timeout period
+	timeout.tv_usec = 0;
+}
+
+//------------------------------------------------------------------------------
+//destructor
+CXServer::~CXServer()
+{
+	iStatus = RECEIVE_HELLO;	//end on RECEIVE_HELLO
+
+	iListPtr = NULL;
+	
+	//clear the name and value pairs
+	for(int i = 0; i < MAXLISTLENGTH; i++)
+	{
+		memset( iList[i].iName, 0, MAXBUFFERLEN );
+		memset( iList[i].iValue, 0, MAXBUFFERLEN );
+	}
+}
+
+//------------------------------------------------------------------------------
+//this function adds the specified value into the list of name value pairs
+int CXServer::OnExecute(int handle, int handletype)
+{
+	int err = 0;
+	int buff = -1;
+
+	//check the list for the next available space
+	for(int i = 0; i < MAXLISTLENGTH; i++ ) 
+	{
+		if( *iList[i].iName == 0 ) 
+		{
+			buff = i;
+			break;
+		}
+	}
+
+	// check that a slot was found, return error if not
+	if( buff == -1 ) 
+	{
+		return CSP_LISTFULL;
+	}
+
+	//if we get here and the status is value there is a problem and we'd loop like forever
+	while( iStatus != RECEIVE_VALUE )
+	{
+		switch( iStatus )
+		{
+			case RECEIVE_HELLO:
+				
+				err = CheckForHello(handle, handletype, buff);
+				
+				//the was a problem with the socket connection
+				if(err != 1)
+				{
+					return err;
+				}
+
+				break;
+	
+			case RECEIVE_NAME:
+
+				err = CheckForData(handle, handletype, buff);
+				
+				if(err != 0)
+				{
+					return err;
+				}
+				
+				break;
+
+			case RECEIVE_GOODBYE:
+
+				iStatus = RECEIVE_HELLO;
+				break;
+
+			default:
+
+				break;
+		}
+	}
+
+	// done
+	return err;
+}
+
+//------------------------------------------------------------------------------
+// This function checks to see whether the Hello call has been made by the client
+// it returns OK or ERROR accordingly
+int CXServer::CheckForHello(int handle, int handletype, int freeslot)
+{
+	char c;
+	int counter = 0;
+	int err;
+	int buff = -1;
+	int bufflen = 0;
+	
+	//initialisation
+	sprintf(&c, "%c", "");
+	sprintf(iHellobuffer, "%s", "HELLO");
+
+	//ensure that there are some free slots available in the list
+	assert(freeslot != -1);
+
+	buff = freeslot;
+
+	//set the pointer to point to the name element
+	iListPtr = iList[buff].iName;
+
+	while( 1 ) 
+	{
+		// receive the next byte
+		err = Read( handle, handletype, &c );
+				
+		//if something has been read from the socket
+		if( ( err == 1 ) )
+		{
+			//...and the character received is zero
+			if( strcmp( &c, "" ) == 0)
+			{
+				//we have the complete string so compare with our buffer
+				if(strcmp(iHellobuffer, iListPtr) != 0)
+				{
+					Write(handle, handletype, REPLY_ERROR, strlen(REPLY_ERROR) );
+					//clear the buffer
+					memset( iListPtr, 0, MAXBUFFERLEN );
+					//reset bufferlen counter so that writing can start from the beginning next time
+					bufflen = 0;
+				}
+				else	//data is ok
+				{
+					Write( handle, handletype, iListPtr, strlen(iListPtr) );
+					Write( handle, HT_SOCKET, "", 1 );
+					break;
+				}
+			}
+			else
+			{
+				// add the byte to the buffer
+				iListPtr[bufflen++] = c;
+			}
+		}
+		else	//if
+		{
+			//if there was a dodgy read then the socket link is broken
+			memset( iListPtr, 0, MAXBUFFERLEN );
+			bufflen = 0;
+			err = GetLastError();
+			printf( "Data could not be read.  Error code is %d...\n", err);
+			return err;
+		}
+	}	//while
+
+	//update the status
+	iStatus = RECEIVE_NAME;
+
+	//since the first element in the list will have HELLO in it, it should be reinitialised for use later on
+	memset( iListPtr, 0, MAXBUFFERLEN );
+	
+	return err;	
+}
+
+//------------------------------------------------------------------------------
+//this checks the socket for data
+int CXServer::CheckForData(int handle, int handletype, int freeslot)
+{
+	int bufflen = 0;
+	int buff = 0;
+	int err = 0;
+	char c;
+
+	assert( iStatus == RECEIVE_NAME);
+
+	buff = freeslot;
+
+	//check for data on the socket
+	if( CheckForTimeout(handle) != 0 )
+	{
+		//revert status to previous as we received no data within the alloted time
+		iStatus = RECEIVE_HELLO;
+		Write(handle, handletype, REPLY_TIMEOUT, strlen(REPLY_TIMEOUT) );
+		return err;
+	}
+
+	// the client should send the list of arguments - this is the name and value receiving section!!!!
+	// this section will continue to loop until the the goodbye message has been received
+	while( iStatus != RECEIVE_GOODBYE ) 
+	{
+		//need to do the timeout thing here for value data
+		if( iStatus == RECEIVE_VALUE )
+		{
+			if( CheckForTimeout(handle) != 0 )
+			{
+				//revert status to previous as we received no data within the alloted time
+				iStatus = RECEIVE_NAME;
+				//point to the previous name element in the array so that the last bit of data is overwritten
+				iListPtr = iList[buff].iName;
+				bufflen = 0;
+				Write( handle, handletype, REPLY_TIMEOUT, strlen(REPLY_TIMEOUT) );
+				return err;
+			}
+		}
+
+		// receive the next byte
+		err = Read( handle, handletype, &c );
+
+		//if something has been read from the socket
+		if( ( err == 1 ) )
+		{
+			//need to check for available data space
+			if( buff > (MAXLISTLENGTH - 1) ) 
+			{
+				Write(handle, handletype, REPLY_ERROR, strlen(REPLY_ERROR));
+				return 	CSP_LISTFULL;
+			}
+
+			// if the data buffer is full then we have an error
+			if( bufflen == (MAXBUFFERLEN - 1) ) 
+			{
+				Write(handle, handletype, REPLY_ERROR, strlen(REPLY_ERROR));
+				return 	CSP_BUFFERFULL;
+			}
+			
+			//...or the character received is zero		
+			if( strcmp( &c,"" ) == 0)
+			{
+				//reply to say that we got the data ok
+				Write( handle, handletype, iListPtr, strlen(iListPtr) );
+				Write( handle, HT_SOCKET, "", 1 );
+			
+				CheckForGoodbye(handle, handletype, buff);
+				
+				//if GOODBYE has not been received and the status has not changed
+				if( iStatus != RECEIVE_GOODBYE )
+				{
+					//change the status from name -> value or vice versa
+					if( iListPtr == iList[buff].iName )
+					{
+						iListPtr = iList[buff].iValue;
+						//reset bufferlen counter so that writing can start from the beginning
+
+						bufflen = 0;
+
+						iStatus = RECEIVE_VALUE;
+					}
+					else
+					{	
+						//move onto the next element in the list
+						iListPtr = iList[++buff].iName;
+						
+						//reset bufferlen counter so that writing can start from the beginning
+						bufflen = 0;
+						
+						iStatus = RECEIVE_NAME;
+					}		//else
+				}			//if (iStatus != ...)
+			}				//if (c == 0)
+			else
+			{
+				// add the byte to the buffer
+				iListPtr[bufflen++] = c;
+			}
+		}				//if
+		else
+		{
+			//if there was a dodgy read
+			Write(handle, handletype, REPLY_ERROR, strlen(REPLY_ERROR));
+			memset( iListPtr, 0, MAXBUFFERLEN );
+			
+			//reset bufferlen counter so that writing can start from the beginning next time
+			bufflen = 0;
+			
+			//and if status was VALUE then go back to NAME
+			if(iStatus = RECEIVE_VALUE)
+			{
+				iStatus = RECEIVE_NAME;
+				iListPtr = iList[buff].iName;
+				return err;
+			}
+		}
+	}
+
+	//change status back to receive hello
+	iStatus = RECEIVE_HELLO;
+
+	//everthing should be ok at this stage so reset err
+	err = 0;
+
+	return err;
+}
+
+//------------------------------------------------------------------------------
+//this function checks for the GOODBYE message.  If it has been set then it changes the status
+void CXServer::CheckForGoodbye(int handle, int handletype, int latestposition)
+{
+	
+	sprintf(iGoodbyebuffer, "%s", "GOODBYE");
+
+	//if an exact match is found
+	if(strcmp(iGoodbyebuffer, iListPtr) == 0)
+	{
+		//change status
+		iStatus = RECEIVE_GOODBYE;
+
+		//reset the data in the name/value slot
+		memset( iListPtr, 0, MAXBUFFERLEN );
+
+		printf( "Expecting HELLO from client side...\n" );
+	}
+}
+//------------------------------------------------------------------------------
+//this function reads data from a specific port
+int CXServer::Read(int handle, int handletype, char* c)
+{
+	int err = 0;
+
+	assert( c != NULL );
+	
+	// socket handles
+	if( handletype == HT_SOCKET ) 
+	{
+		err = recv( handle, c, 1, 0 );
+		if( err != 1 ) //if the single char has not been received
+		{
+			err = GetLastError();
+			return err;
+		}
+	}
+
+	return err;		
+}
+
+//------------------------------------------------------------------------------
+//this function writes on a specific port
+int CXServer::Write(int handle, int handletype, char *buff, int bufflen)
+{
+	int err;
+	
+	assert( buff != NULL );
+
+	// socket handles
+	if( handletype == HT_SOCKET ) 
+	{
+		err = send( handle, buff, bufflen, 0 );
+		if( err != bufflen ) 
+		{
+			err = GetLastError();
+			return err;
+		}
+	}
+
+	return 0;
+}
+
+//------------------------------------------------------------------------------
+//this function waits for input to be received on the specified socket for a specific time
+int CXServer::CheckForTimeout(int handle)
+{
+	int live = 0;
+	int err = 0;
+	
+	while( 1 )
+	{
+		//set up socket timer structure
+		FD_ZERO( &iReadSocketSet );
+		FD_SET( (unsigned)handle, &iReadSocketSet );
+
+		//wait for some input
+		live = select(NULL, &iReadSocketSet, NULL, NULL, &timeout);
+
+		//if there is some input
+		if( live < 0 )
+		{
+			printf( "Call to select() failed...\n" );
+			return live;
+		}
+		else if ( live == 0 )	
+		{
+			printf( "No descriptors ready...\n" );
+			printf( "Timed out...\n" );
+			err = -1;
+			return err;
+		}
+		else	//something is ready
+		{
+			FD_ISSET( handle, &iReadSocketSet );
+			printf( "Data read...\n" );
+			return err;
+		}
+	}
+
+	return err;
+}
+//------------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/CXServer.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: CXServer.h
+* Author: Sanjeet Matharu 
+* This is the server side of the protocol which takes name/value pairs and does stuff
+*
+*/
+
+
+
+#ifndef __CXSERVER_H__
+#define __CXSERVER_H__
+
+#define MAXLISTLENGTH		100	//this is the name/value pair max list length
+#define MAXBUFFERLEN		64	//maximum length of the name and value strings
+
+#define HT_SOCKET			0
+#define HT_WIN32FILEHANDLE	1
+#define HT_LINUXFILEHANDLE	2
+
+#define REPLY_OK			"OK"
+#define	REPLY_ERROR			"ERROR"
+#define REPLY_TIMEOUT		"TIMEOUT"
+
+#define CSP_LISTFULL		2001
+#define CSP_BUFFERFULL		2002
+
+//Types
+typedef enum 
+{
+	RECEIVE_HELLO,
+	RECEIVE_NAME,
+	RECEIVE_VALUE,
+	RECEIVE_GOODBYE
+} TReceiveStatus;
+
+//struct required for the name/value pairs
+typedef struct 
+{
+	char iName[MAXBUFFERLEN];
+	char iValue[MAXBUFFERLEN];
+} TNameValuePair;
+
+//----------------------------------------------------------------------------------
+//generic server class
+class CXServer
+{
+	public:
+
+		//constructor/destructor
+		CXServer();
+		~CXServer();
+
+		//functions
+		int OnExecute(int handle, int handletype);
+
+		//data
+		TReceiveStatus iStatus;
+		TNameValuePair iList[MAXLISTLENGTH];
+		
+	private:
+
+		//functions
+		int CheckForHello(int handle, int handletype, int freeslot);
+		int CheckForData(int handle, int handletype, int freeslot);
+		void CheckForGoodbye(int handle, int handletype, int latestposition);
+		int CheckForTimeout(int handle);
+
+		int Read(int handle, int handletype, char* c);
+		int Write(int handle, int handletype, char *buff, int bufflen );
+		
+		//data
+		char* iListPtr;
+
+		char iGoodbyebuffer[8];
+		char iHellobuffer[6];
+
+		fd_set iReadSocketSet;
+		struct timeval timeout;
+};
+
+//----------------------------------------------------------------------------------
+
+#endif __CXSERVER_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/sprotocol.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,100 @@
+# Microsoft Developer Studio Project File - Name="sprotocol" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=sprotocol - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "sprotocol.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "sprotocol.mak" CFG="sprotocol - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "sprotocol - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "sprotocol - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "sprotocol - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "sprotocol - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\..\BinInternal\libsprotocol.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "sprotocol - Win32 Release"
+# Name "sprotocol - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CXServer.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CXServer.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/sprotocol.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "sprotocol"=.\sprotocol.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsCommandWrapper/CDynamicsCommand.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1408 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#ifndef WIN32
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#else
+#include <winsock2.h>
+#endif
+#include <stdlib.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CDynamicsCommand.h"
+#include "../include/standard_unix.h"
+#include "../ProcessLibrary/proclib.h"
+#include "../include/strncpynt.h"
+
+
+/****************************************************************************************
+ * 
+ * Definitions
+ * 
+ ***************************************************************************************/
+#define HOME_AGENT_TOOL				"./dynha_tool"
+#define FOREIGN_AGENT_TOOL			"./dynfa_tool"
+#define MOBILE_NODE_AGENT_TOOL		        "./dynmn_tool"
+
+#define CALL_FAILED_PREFIX			"Call failed: "
+#define INVALID_ARGUMENTS_PREFIX	        "Invalid arguments. "
+#define CSH_FAILED_PREFIX                       "csh: "
+#define TARGET_NOT_FOUND                        "No such file" 
+#define FOREIGN_AGENT_DESTROY_TUNNEL_PREFIX     "Destroyed tunnel"
+#define MOBILE_AGENT_FOREIGN_AGENT_LIST_PREFIX  "List of heard mobility agents:"
+#define MOBILE_NODE_AGENT_SETPOLICY_PREFIX      "Set policy succeeded."
+#define MOBILE_NODE_AGENT_CONNECT_PREFIX        "Connect success."
+#define MOBILE_NODE_AGENT_DISCONNECT_PREFIX     "Disconnected"
+#define MOBILE_NODE_AGENT_CONFIRM_PREFIX        "Confirmed."
+#define CALL_FAILED_FUNCTION_NOT_PERMITTED      "function not permitted"
+#define CALL_FAILED_AGENT_UNREACHABLE           "agent unreachable"
+
+#define TOKENSIZE                               256
+#define MAX_TIMEOUT			        120000
+#define MIN_TIMEOUT				1
+
+
+/****************************************************************************************
+ * 
+ * Macro Functions
+ * 
+ ***************************************************************************************/
+#define IS_WHITESPACE(c)  (((c) == ' ')||((c) == '\t'))
+#define MIN(x,y)          (((x) < (y)) ? (x) : (y))
+
+
+/****************************************************************************************
+ * 
+ * File-scope static variables
+ * 
+ ***************************************************************************************/
+char *iTunnelModeString[] = { "no tunnel", "full tunnel", "triangle tunnel", "full tunnel direct to HA", NULL };
+char *iPolicyString[] = { "Early-expire", "Newest-FA", "Eager-switching", "Newest-ADV", NULL };
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: General
+ * 
+ ***************************************************************************************/
+CDynamicsCommand::CDynamicsCommand()
+{
+	iTimeout = MAX_TIMEOUT;
+}
+
+
+CDynamicsCommand::~CDynamicsCommand()
+{
+}
+
+
+void CDynamicsCommand::SetPipePath( string aPipePath )
+{
+	iPipePath = aPipePath;
+}
+
+
+void CDynamicsCommand::SetTimeout( int aTimeout )
+{
+	if( (aTimeout >= MIN_TIMEOUT) && (aTimeout <= MAX_TIMEOUT) ) {
+		iTimeout = aTimeout;
+	}
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: ForeignAgentGetStatus
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::ForeignAgentGetStatus( TForeignAgentStatusInfo *aForeignAgentInfo )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res = 0;
+
+  // check params
+  assert( aForeignAgentInfo != NULL );
+  
+  // run the dynamics command line 
+  rv = DynamicsCall( FOREIGN_AGENT_TOOL, "status", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output 
+  res |= GetIntegerEntry( standard_output.c_str(), "tunnels", &(aForeignAgentInfo->iTunnelCount) );
+  res |= GetIntegerEntry( standard_output.c_str(), "pending reg.req.", &(aForeignAgentInfo->iPendingRegistrationRequests) );
+  res |= GetIntegerEntry( standard_output.c_str(), "request rejected", &(aForeignAgentInfo->iRequestsRejected) );
+  res |= GetIntegerEntry( standard_output.c_str(), "request accepted", &(aForeignAgentInfo->iRequestsAccepted) );
+  res |= GetIntegerEntry( standard_output.c_str(), "reply accepted", &(aForeignAgentInfo->iReplysAccepted) );
+  res |= GetIntegerEntry( standard_output.c_str(), "reply rejected", &(aForeignAgentInfo->iReplysRejected) );
+  res |= GetIntegerEntry( standard_output.c_str(), "discard(unk. ext)", &(aForeignAgentInfo->iDiscardedUnknownExtension) );
+  res |= GetIntegerEntry( standard_output.c_str(), "discard(malformed)", &(aForeignAgentInfo->iDiscardedMalformed) );
+  res |= GetIntegerEntry( standard_output.c_str(), "discard(vendor)", &(aForeignAgentInfo->iDiscardedVendor) );
+  res |= GetIntegerEntry( standard_output.c_str(), "advertisement sent", &(aForeignAgentInfo->iAdvertisementsSent) );
+  
+  // check for errors
+  if( res != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  
+  // done
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: ForeignAgentDestroyTunnel
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::ForeignAgentDestroyTunnel( unsigned int aMobileNodeAddress )
+{
+  TDynamicsCallInfo rv;
+  int match;
+  string standard_output, standard_error;
+  char *mnaddr;
+  struct in_addr iaddr;
+  char params[MAXCOMMANDLINE];
+ 
+  // create the params string
+  iaddr.ADDRESS_INTEGER = aMobileNodeAddress;
+  mnaddr = inet_ntoa( iaddr );
+  snprintf( params, MAXCOMMANDLINE, "%s", mnaddr );
+
+  // run the dynamics command line 
+  rv = DynamicsCall( FOREIGN_AGENT_TOOL, "destroy", params, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // check for success - otherwise give general error
+  match = strncmp( FOREIGN_AGENT_DESTROY_TUNNEL_PREFIX, standard_output.c_str(), strlen(FOREIGN_AGENT_DESTROY_TUNNEL_PREFIX) );
+  if( match != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: ForeignAgentGetTunnels
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::ForeignAgentGetTunnels( int *aTunnelCount, TTunnelID *aTunnelIDArray )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int list_size;
+
+  // check the params
+  assert( aTunnelCount != NULL );
+  assert( aTunnelIDArray != NULL );
+  list_size = *aTunnelCount;
+  *aTunnelCount = 0;
+
+  // run the dynamics command line 
+  rv = DynamicsCall( FOREIGN_AGENT_TOOL, "list", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output and return
+  rv =  ParseForeignAgentListOutput( standard_output, list_size, aTunnelIDArray, aTunnelCount );
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: ForeignAgentGetTunnelInfo
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::ForeignAgentGetTunnelInfo( unsigned int aMobileNodeAddress, TForeignAgentTunnelInfo *aTunnelInfo )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res = 0;
+  char params[MAXCOMMANDLINE];
+  struct in_addr mobile_node_address;
+
+  // check params
+  assert( aTunnelInfo != NULL );
+
+  // write the params
+  mobile_node_address.ADDRESS_INTEGER = aMobileNodeAddress;
+  snprintf( params, MAXCOMMANDLINE, " %s", inet_ntoa(mobile_node_address) );
+
+  // run the dynamics command line 
+  rv = DynamicsCall( FOREIGN_AGENT_TOOL, "show", params, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output 
+  res |= GetAddressEntry( standard_output.c_str(), "mobile addr", &(aTunnelInfo->iMobileNodeAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "care-of addr", &(aTunnelInfo->iCareofAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "home agent addr", &(aTunnelInfo->iHomeAgentAddress) );
+  res |= GetIntegerEntry( standard_output.c_str(), "private HA id", &(aTunnelInfo->iPrivateHomeAgentID) );
+  res |= GetDateEntry( standard_output.c_str(), "creation time", &(aTunnelInfo->iCreationTime) );
+  res |= GetDateEntry( standard_output.c_str(), "expiration time", &(aTunnelInfo->iExpirationTime) );
+  res |= GetDateEntry( standard_output.c_str(), "refresh time", &(aTunnelInfo->iRefreshTime) );
+  res |= GetDateEntry( standard_output.c_str(), "last timestamp", &(aTunnelInfo->iLastTimestamp) );
+  res |= GetIntegerEntry( standard_output.c_str(), "SPI", &(aTunnelInfo->iSPI) );
+  res |= GetIntegerEntry( standard_output.c_str(), "timeout", &(aTunnelInfo->iTimeout) );
+  
+  // check for errors
+  if( res != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  
+  // done
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: HomeAgentGetStatus
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::HomeAgentGetStatus( THomeAgentStatusInfo *aHomeAgentInfo )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res = 0;
+
+  // check params
+  assert( aHomeAgentInfo != NULL );
+  
+  // run the dynamics command line 
+  rv = DynamicsCall( HOME_AGENT_TOOL, "status", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output 
+  res |= GetIntegerEntry( standard_output.c_str(), "tunnels", &(aHomeAgentInfo->iTunnelCount) );
+  res |= GetIntegerEntry( standard_output.c_str(), "request rejected", &(aHomeAgentInfo->iRequestsRejected) );
+  res |= GetIntegerEntry( standard_output.c_str(), "request accepted", &(aHomeAgentInfo->iRequestsAccepted) );
+  res |= GetIntegerEntry( standard_output.c_str(), "discard(unk. ext)", &(aHomeAgentInfo->iDiscardedUnknownExtension) );
+  res |= GetIntegerEntry( standard_output.c_str(), "discard(malformed)", &(aHomeAgentInfo->iDiscardedMalformed) );
+  res |= GetIntegerEntry( standard_output.c_str(), "discard(vendor)", &(aHomeAgentInfo->iDiscardedVendor) );
+  res |= GetIntegerEntry( standard_output.c_str(), "advertisement sent", &(aHomeAgentInfo->iAdvertisementsSent) );
+  
+  // check for errors
+  if( res != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  
+  // done
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: HomeAgentDestroyTunnel
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::HomeAgentDestroyTunnel( unsigned int aMobileNodeAddress, unsigned int aHomeAgentAddress, 
+							    int aTunnelID )
+{
+  TDynamicsCallInfo rv;
+  int match;
+  string standard_output, standard_error;
+  char *mnaddr;
+  struct in_addr iaddr;
+  char params[MAXCOMMANDLINE];
+
+  // create the params string
+  iaddr.ADDRESS_INTEGER = aMobileNodeAddress;
+  mnaddr = inet_ntoa( iaddr );
+  snprintf( params, MAXCOMMANDLINE, "%s", mnaddr );
+
+  // run the dynamics command line 
+  rv = DynamicsCall( HOME_AGENT_TOOL, "destroy", params, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // check for success - otherwise give general error
+  match = strncmp( FOREIGN_AGENT_DESTROY_TUNNEL_PREFIX, standard_output.c_str(), strlen(FOREIGN_AGENT_DESTROY_TUNNEL_PREFIX) );
+  if( match != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: HomeAgentGetTunnels
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::HomeAgentGetTunnels( int *aTunnelCount, unsigned int *aMobileNodeAddresses )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int list_size;
+
+  // check the params
+  assert( aTunnelCount != NULL );
+  assert( aMobileNodeAddresses != NULL );
+  list_size = *aTunnelCount;
+  *aTunnelCount = 0;
+
+  // run the dynamics command line 
+  rv = DynamicsCall( HOME_AGENT_TOOL, "list", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output and return
+  rv =  ParseHomeAgentListOutput( standard_output, list_size, aMobileNodeAddresses, aTunnelCount );
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: HomeAgentGetTunnelInfo
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::HomeAgentGetTunnelInfo( unsigned int aMobileNodeAddress, THomeAgentTunnelInfo *aTunnelInfo )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res = 0;
+  char params[MAXCOMMANDLINE];
+  struct in_addr mobile_node_address;
+
+  // check params
+  assert( aTunnelInfo != NULL );
+
+  // write the params
+  mobile_node_address.ADDRESS_INTEGER = aMobileNodeAddress;
+  snprintf( params, MAXCOMMANDLINE, " %s", inet_ntoa(mobile_node_address) );
+
+  // run the dynamics command line 
+  rv = DynamicsCall( HOME_AGENT_TOOL, "show", params, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output   
+  res |= GetAddressEntry( standard_output.c_str(), "mobile addr", &(aTunnelInfo->iMobileNodeAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "care-of addr", &(aTunnelInfo->iCareofAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "home agent addr", &(aTunnelInfo->iHomeAgentAddress) );
+  res |= GetDateEntry( standard_output.c_str(), "creation time", &(aTunnelInfo->iCreationTime) );
+  res |= GetDateEntry( standard_output.c_str(), "expiration time", &(aTunnelInfo->iExpirationTime) );
+  res |= GetDateEntry( standard_output.c_str(), "refresh time", &(aTunnelInfo->iRefreshTime) );
+  res |= GetDateEntry( standard_output.c_str(), "last timestamp", &(aTunnelInfo->iLastTimestamp) );
+  res |= GetIntegerEntry( standard_output.c_str(), "SPI", &(aTunnelInfo->iSPI) );
+  res |= GetIntegerEntry( standard_output.c_str(), "timeout", &(aTunnelInfo->iTimeout) );
+  
+  // check for errors
+  if( res != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  
+  // done
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentGetCareofAddress
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentGetCareofAddress( struct in_addr *aCareofAddress )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res = 0;
+  unsigned int addr;
+
+  // check params
+  assert( aCareofAddress != NULL );
+
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "careof", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output   
+  res = GetAddressEntry( standard_output.c_str(), "Care-of address:", &addr );
+  if( res != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  aCareofAddress->s_addr = addr;
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentGetStatus
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentGetStatus( TMobileNodeAgentStatusInfo *aMobileNodeAgentInfo )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res = 0;
+  char buff[MAXCOMMANDLINE];
+  // check params
+  assert( aMobileNodeAgentInfo != NULL );
+  
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "status", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output 
+  res |= GetStringEntry( standard_output.c_str(), "state", buff, MAXCOMMANDLINE );
+  res |= CheckMatchAsBoolean( buff, "Connected", &(aMobileNodeAgentInfo->iConnected) );
+  res |= GetStringEntry( standard_output.c_str(), "tunnel is", buff, MAXCOMMANDLINE );
+  res |= CheckMatchAsBoolean( buff, "up", &(aMobileNodeAgentInfo->iTunnelUp) );
+  res |= GetAddressEntry( standard_output.c_str(), "local addr", &(aMobileNodeAgentInfo->iLocalAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "co-addr", &(aMobileNodeAgentInfo->iColocatedAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "FA-addr", &(aMobileNodeAgentInfo->iForeignAgentAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "HA-addr", &(aMobileNodeAgentInfo->iHomeAgentAddress) );
+  res |= GetAddressEntry( standard_output.c_str(), "Home addr", &(aMobileNodeAgentInfo->iHomeAddress) );
+  res |= GetStringEntry( standard_output.c_str(), "info text", aMobileNodeAgentInfo->iInfoText, MAXINFOLEN );
+  res |= GetStringEntry( standard_output.c_str(), "tunneling mode", buff, MAXCOMMANDLINE );
+  res |= ConvertTunnelStringToInteger( buff, &(aMobileNodeAgentInfo->iTunnelMode) );
+
+  // the following are optional - they only appear in the output when we have a connection
+  GetStringEntry( standard_output.c_str(), "last warning", aMobileNodeAgentInfo->iLastErrorString, MAXERRORSTRING );
+  GetIntegerEntry( standard_output.c_str(), "reply code", &(aMobileNodeAgentInfo->iReplyCode) );
+  GetIntegerEntry( standard_output.c_str(), "lifetime left", &(aMobileNodeAgentInfo->iLifetimeRemaining) );
+  GetIntegerEntry( standard_output.c_str(), "last request", &(aMobileNodeAgentInfo->iSecondsSinceLastRequest) );
+  GetIntegerEntry( standard_output.c_str(), "last reply", &(aMobileNodeAgentInfo->iSecondsSinceLastReply) );
+  
+  // check for errors
+  if( res != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  
+  // done
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentConnect
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentConnect()
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int match;
+
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "connect", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // check output
+  match = strncmp( MOBILE_NODE_AGENT_CONNECT_PREFIX, standard_output.c_str(), strlen(MOBILE_NODE_AGENT_CONNECT_PREFIX) );
+  if( match != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+    STRNCPY_NULL_TERMINATE( rv.iDynamicsErrorString, standard_output.c_str(), MAXIMUMERRORSTRINGLENGTH );
+  }
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentDisconnect
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentDisconnect()
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int match;
+
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "disconnect", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // check output
+  match = strncmp( MOBILE_NODE_AGENT_DISCONNECT_PREFIX, standard_output.c_str(), strlen(MOBILE_NODE_AGENT_DISCONNECT_PREFIX) );
+  if( match != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentConfirm
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentConfirm()
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int match;
+
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "confirm", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // check output
+  match = strncmp( MOBILE_NODE_AGENT_CONFIRM_PREFIX, standard_output.c_str(), strlen(MOBILE_NODE_AGENT_CONFIRM_PREFIX) );
+  if( match != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentRescan
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentRescan()
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "rescan", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentSetPolicy
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentSetPolicy( int aPolicyVector )
+{
+  TDynamicsCallInfo rv, res;
+  string standard_output, standard_error;
+  char params[MAXCOMMANDLINE];
+  int i, match;
+
+  // init the rv to success
+  memset( &rv, 0, sizeof(rv) );
+  rv.iResult = DC_SUCCESS;  
+
+  // we can only set one policy at a time - so set each time
+  for( i = 0; iPolicyString[i] != NULL; i++ ) { 
+
+    // set the parameter string
+    snprintf( params, MAXCOMMANDLINE, " %s %s", iPolicyString[i], ((aPolicyVector&(1<<i)) ? "on" : "off") );
+
+    // run the dynamics command line
+    res = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "policy", params, &standard_output, &standard_error );
+
+    // check output
+    match = strncmp( MOBILE_NODE_AGENT_SETPOLICY_PREFIX, standard_output.c_str(), strlen(MOBILE_NODE_AGENT_SETPOLICY_PREFIX) );
+    if( match != 0 ) {
+      res.iResult = DC_UNEXPECTED_OUTPUT;
+    }
+
+    // return the first error
+    if( (res.iResult != DC_SUCCESS) && (rv.iResult == DC_SUCCESS) ) {
+      rv = res;
+      rv.iErrorDetail = i;
+    }
+  }
+
+  // done
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentGetPolicy
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentGetPolicy( int *aPolicyVector )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res, on, i;
+
+  // check the params
+  assert( aPolicyVector != NULL );
+  *aPolicyVector = 0;
+  memset( &rv, 0, sizeof(rv) );
+  
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "policy", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output
+  for( i = 0; iPolicyString[i] != NULL; i++ ) {
+    res = GetPolicyEntry( standard_output.c_str(), iPolicyString[i], &on );
+    if( res != 0 ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      return rv;
+    }
+    if( on != 0 ) {
+      (*aPolicyVector) |= (1<<i);
+    }
+  } 
+
+  // done
+  rv.iResult = DC_SUCCESS;
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentGetForeignAgentList
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentGetForeignAgentList( int *aListCount, 
+									TMobileNodeForeignAgentInfo *aForeignAgentInfoList )
+{
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int list_size;
+
+  // check params 
+  assert( aListCount != NULL );
+  assert( aForeignAgentInfoList != NULL );
+  list_size = *aListCount;
+  *aListCount = 0;
+
+  // init the list
+  memset( aForeignAgentInfoList, 0, (sizeof(*aForeignAgentInfoList)*list_size) );
+
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "list", NULL, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output
+  rv = ParseMobileNodeAgentListOutput( standard_output, list_size, aForeignAgentInfoList, aListCount );
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC METHOD: MobileNodeAgentGetForeignAgentInfo
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::MobileNodeAgentGetForeignAgentInfo( unsigned int aFAAddress, 
+									TMobileNodeForeignAgentInfo *aForeignAgentInfo )
+{ 
+  TDynamicsCallInfo rv;
+  string standard_output, standard_error;
+  int res = 0;
+  char params[MAXCOMMANDLINE];
+  struct in_addr foreign_agent_address;
+
+  // check params
+  assert( aForeignAgentInfo != NULL );
+  memset( aForeignAgentInfo, 0, sizeof(*aForeignAgentInfo) );
+
+  // write the params
+  foreign_agent_address.ADDRESS_INTEGER = aFAAddress;
+  snprintf( params, MAXCOMMANDLINE, " %s", inet_ntoa(foreign_agent_address) );
+
+  // run the dynamics command line 
+  rv = DynamicsCall( MOBILE_NODE_AGENT_TOOL, "show", params, &standard_output, &standard_error );
+  if( rv.iResult != DC_SUCCESS ) {
+    return rv;
+  }
+
+  // parse the output 
+  res |= GetAddressEntry( standard_output.c_str(), "FA", &(aForeignAgentInfo->iForeignAgentAddress) );
+  res |= GetStringEntry( standard_output.c_str(), "Interface", aForeignAgentInfo->iInterfaceName, MAXINTERFACENAME );
+  res |= GetIntegerEntry( standard_output.c_str(), "Priority", &(aForeignAgentInfo->iPriority) );
+  aForeignAgentInfo->iInUse = 1;
+  res |= GetIntegerEntry( standard_output.c_str(), "Interface index", &(aForeignAgentInfo->iInterfaceIndex) );
+  res |= GetIntegerEntry( standard_output.c_str(), "Last adv.", &(aForeignAgentInfo->iInterfaceIndex) );
+  res |= GetStringEntry( standard_output.c_str(), "NAI", aForeignAgentInfo->iNAI, MAXNAILEN );
+
+  
+  // check for errors
+  if( res != 0 ) {
+    rv.iResult = DC_UNEXPECTED_OUTPUT;
+  }
+  
+  // done
+  return rv;
+
+}
+
+
+/****************************************************************************************
+ * 
+ * SECTION: HELPERS
+ * 
+ ***************************************************************************************/
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: GetDateEntry
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::GetDateEntry( const char *aOutput, const char *aLabel, int *aValue )
+{
+  char *ptr;
+  struct tm stime;
+  time_t ttime;
+
+  // check params
+  assert( aOutput != NULL );
+  assert( aLabel != NULL );
+  assert( aValue != NULL );
+
+  // set default
+  *aValue = 0;
+
+  // look for the label in the output
+  ptr = strstr( aOutput, aLabel );
+  if( ptr == NULL ) {
+    return -1;
+  }
+
+  // skip over any spaces
+  ptr += strlen(aLabel);
+  for( ; IS_WHITESPACE(*ptr); ptr++ ) 
+    ;
+
+  // convert the string address into an int
+  strptime( ptr, "%A %B %d %H:%M:%S %Y", &stime );
+  ttime = mktime( &stime );
+  *aValue = ttime;
+  return 0;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: GetAddressEntry
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::GetAddressEntry( const char *aOutput, const char *aLabel, unsigned int *aValue )
+{
+  int err;
+  char *ptr;
+  struct in_addr iaddr;
+
+  // check params
+  assert( aOutput != NULL );
+  assert( aLabel != NULL );
+  assert( aValue != NULL );
+
+  // set default
+  *aValue = 0;
+
+  // look for the label in the output
+  ptr = strstr( aOutput, aLabel );
+  if( ptr == NULL ) {
+    return -1;
+  }
+
+  // skip over any spaces
+  ptr += strlen(aLabel);
+  for( ; IS_WHITESPACE(*ptr); ptr++ ) 
+    ;
+
+  // if the current char is no a digit then there is a problem
+  if( !isdigit(*ptr) ) {
+    return -1;
+  }
+
+  // convert the string address into an in_addr 
+  err = inet_aton( ptr, &iaddr );
+  if( err == 0 ) {
+    return -1;
+  }
+  *aValue = iaddr.ADDRESS_INTEGER;
+  return 0;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: GetIntegerEntry
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::GetIntegerEntry( const char *aOutput, const char *aLabel, int *aValue )
+{
+  char *ptr;
+
+  // check params
+  assert( aOutput != NULL );
+  assert( aLabel != NULL );
+  assert( aValue != NULL );
+
+  // set the default value
+  *aValue = 0;
+
+  // look for the label in the output
+  ptr = strstr( aOutput, aLabel );
+  if( ptr == NULL ) {
+    return -1;
+  }
+
+  // skip over any spaces
+  ptr += strlen(aLabel);
+  for( ; IS_WHITESPACE(*ptr); ptr++ ) 
+    ;
+
+  // if the current char is no a digit then there is a problem
+  if( (!isdigit(*ptr)) && ((*ptr) != '-') ) {
+    return -1;
+  }
+
+  // otherwise return the integer
+  *aValue = atoi(ptr);
+  return 0;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: GetPolicyEntry
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::GetPolicyEntry( const char *aOutput, const char *aLabel, int *aValue )
+{
+  char *ptr;
+
+  // check params
+  assert( aOutput != NULL );
+  assert( aLabel != NULL );
+  assert( aValue != NULL );
+
+  // set the default
+  *aValue = 0;
+
+  // look for the label in the output
+  ptr = strstr( aOutput, aLabel );
+  if( ptr == NULL ) {
+    return -1;
+  }
+
+  // skip over any spaces
+  ptr += strlen(aLabel);
+  for( ; IS_WHITESPACE(*ptr); ptr++ ) 
+    ;
+
+  // if the string is not 'ON' or 'OFF' then we are confused
+  if( (ptr[0] != 'O') || ((ptr[1] != 'N') && (ptr[1] != 'F')) ) {
+    return -1;
+  }
+
+  // this should either be OFF => O or ON => 1
+  *aValue = ((ptr[1] == 'N') ? 1 : 0);
+  return 0;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: GetStringEntry
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::GetStringEntry( const char *aOutput, const char *aLabel, char *aValue, int aBufferSize  )
+{
+  char *ptr, *start, *end;
+  int string_length;
+
+  // check params
+  assert( aOutput != NULL );
+  assert( aLabel != NULL );
+  assert( aValue != NULL );
+  assert( aBufferSize > 0 );
+
+  // set the default
+  aValue[0] = 0;
+
+  // look for the label in the output
+  ptr = strstr( aOutput, aLabel );
+  if( ptr == NULL ) {
+    return -1;
+  }
+
+  // skip over any spaces
+  ptr += strlen(aLabel);
+  for( ; IS_WHITESPACE(*ptr); ptr++ ) 
+    ;
+
+  // get the length of the substr to copy - don't copy the newline
+  start = ptr;
+  end = strchr( start, '\n' );
+  if( end == NULL ) {
+    end = strchr( start, 0 );
+  }
+  string_length = end - start;
+  string_length = MIN( string_length, (aBufferSize-1) );
+  
+  // now copy the string and return
+  memcpy( aValue, start, string_length );
+  aValue[string_length] = 0;
+  return 0;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: ParseForeignAgentListOutput: Parse ((IP_ADDR + SPACE + IP_ADDR + SPACE + INTEGER + '\n')* + '\n')
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::ParseForeignAgentListOutput( string aOutput, int aListSize, TTunnelID *aTunnelIDArray, int *aListCount )
+{
+  TDynamicsCallInfo rv;
+  const char *cline, *mobile_node_address_str, *home_agent_address_str, *tunnel_id_str;
+  int tunnel_id, err;
+  struct in_addr mobile_node_address, home_agent_address;
+
+  // intialise the result
+  memset( &rv, 0, sizeof(rv) );
+  rv.iResult = DC_SUCCESS;
+
+  // parse a line at a time
+  cline = aOutput.c_str();
+  while( 1 ) {
+    
+    // check for end of output 
+    if( (cline == NULL) || (*cline == 0) || (*cline == '\n') ) {
+      break;
+    }
+
+    // check for full output buffer
+    if( (*aListCount) == aListSize ) {
+      break;
+    }
+
+    // otherwise go and find the tokens
+    mobile_node_address_str = cline;
+    home_agent_address_str = strchr( mobile_node_address_str, ' ' );
+    if( home_agent_address_str == NULL ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      break;
+    }
+    home_agent_address_str++;
+    tunnel_id_str = strchr( home_agent_address_str, ' ' );
+    if( tunnel_id_str == NULL ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      break;
+    }
+    tunnel_id_str++;
+
+    // try and convert these into the correct format
+    err = inet_aton( mobile_node_address_str, &mobile_node_address );
+    if( err == 0 ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      break;
+    }
+    err = inet_aton( home_agent_address_str, &home_agent_address );
+    if( err == 0 ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      break;
+    }
+    tunnel_id = atoi( tunnel_id_str );
+
+    // now place these into the output array
+    (aTunnelIDArray[*aListCount]).iMobileNodeAddress = mobile_node_address.ADDRESS_INTEGER;
+    (aTunnelIDArray[*aListCount]).iHomeAgentAddress = home_agent_address.ADDRESS_INTEGER;
+    (aTunnelIDArray[*aListCount]).iTunnelID = tunnel_id;
+    (*aListCount) += 1;
+
+    // finally, update the 
+    cline = strchr( cline, '\n' );
+    if( cline == NULL ) {
+      break;
+    }
+    cline++;
+  }
+    
+  // done 
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: ParseHomeAgentListOutput: Parse: (X tunnels:\n(IP_ADDR+\n)*\n)
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::ParseHomeAgentListOutput( string aOutput, int aListSize, unsigned int *aTunnelList, int *aListCount )
+{
+  TDynamicsCallInfo rv;
+  const char *cline;
+  int err, i;
+  struct in_addr saddr;
+
+  // check params
+  assert( aListCount != NULL );
+  assert( aTunnelList != NULL );
+  *aListCount = 0;
+
+  // initialise the result
+  memset( &rv, 0, sizeof(rv) );
+  rv.iResult = DC_SUCCESS;
+
+  // now parse each line
+  for( cline = aOutput.c_str(), i = 0; i < aListSize; i++ ) {
+
+    // if this line starts with a newline then we are at the end
+    if( (cline == NULL) || (*cline == 0) || (*cline == '\n') ) {
+      break;
+    }
+    
+    // get the IP address of the mobile node
+    err = inet_aton( cline, &saddr );
+    if( err == 0 ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      break;
+    }
+    
+    // store this in the list
+    aTunnelList[(*aListCount)] = saddr.s_addr;
+    (*aListCount)++;
+
+    // now move to the next line
+    cline = strchr( cline, '\n' );
+    if( cline == NULL ) {
+      break;
+    }
+    cline++;
+  }
+    
+    
+  // done 
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: ParseMobileNodeAgentListOutput: 
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::ParseMobileNodeAgentListOutput( string aOutput, int aListSize, 
+								    TMobileNodeForeignAgentInfo *aForeignAgentList, int *aListCount )
+{
+  TDynamicsCallInfo rv;
+  const char *cline;
+  int match, priority, in_use_flag, err;
+  struct in_addr saddr;
+  char foreign_address_string[TOKENSIZE], interface_name_string[TOKENSIZE], white_space[TOKENSIZE];
+
+  // check params
+  assert( aForeignAgentList != NULL );
+  assert( aListCount != NULL );
+  memset( &rv, 0, sizeof(rv) );
+  rv.iResult = DC_SUCCESS;
+  *aListCount = 0;
+
+  // the first line should be "List of heard mobility agents:\n"
+  cline = aOutput.c_str();
+  assert( cline != NULL );
+  match = strncmp( MOBILE_AGENT_FOREIGN_AGENT_LIST_PREFIX, cline, strlen(MOBILE_AGENT_FOREIGN_AGENT_LIST_PREFIX) );
+  if( match != 0 ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      return rv;
+  }
+
+  // now process each line 
+  while( 1 ) {
+    
+    // move to the next line
+    cline = strchr( cline, '\n' );
+    cline++;
+    
+    // if are at the end of input then we are done
+    if( *cline == 0 ) {
+      break;
+    }
+
+    // if the list is full then we are done
+    if( (*aListCount) >= aListSize ) {
+      break;
+    }
+    
+    // parse the line: IP_ADDR + WHITESPACE + INTERFACENAME + WHITESPACE + prio + 100 + ...
+    err = sscanf( cline, "%s%[ \t]%s%[ \t]prio%[ \t]%d", foreign_address_string, white_space, interface_name_string, 
+		  white_space, white_space, &priority );
+    if( err != 6 ) {
+      rv.iResult = DC_UNEXPECTED_OUTPUT;
+      break;
+    }
+
+    // check for flags in the line - IN-USE
+    in_use_flag = strstrbeforedelim( cline, "IN-USE", '\n' );
+
+    // save these values in the list making appropriate conversions
+    inet_aton( foreign_address_string, &saddr );
+    aForeignAgentList[(*aListCount)].iForeignAgentAddress = saddr.ADDRESS_INTEGER;
+    STRNCPY_NULL_TERMINATE( aForeignAgentList[(*aListCount)].iInterfaceName, interface_name_string, MAXINTERFACENAME );
+    aForeignAgentList[(*aListCount)].iInUse = ((in_use_flag == 0) ? 1 : 0);
+    aForeignAgentList[(*aListCount)].iPriority = priority;
+
+    // fill in the fields not got here
+    aForeignAgentList[(*aListCount)].iInterfaceIndex = 0;
+    aForeignAgentList[(*aListCount)].iLastAdvertisement = 0;
+    aForeignAgentList[(*aListCount)].iNAI[0] = 0;
+
+    // update the list count
+    (*aListCount) += 1;
+  }      
+    
+  // done 
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: DynamicsCall
+ * 
+ ***************************************************************************************/
+TDynamicsCallInfo CDynamicsCommand::DynamicsCall( char *aExecutable, char *aCommand, char *aParams, 
+						  string *aStandardOutput, string *aStandardError )
+{
+  int command_length, match, errcode;
+  TDynamicsCallInfo rv;
+  CAProcess proc;
+  TCAProcessError perr;
+  char dynamics_error_string[MAXIMUMERRORSTRINGLENGTH], *ptr, *submatch;
+
+	// check params
+	assert( aExecutable != NULL );
+	assert( aCommand != NULL );
+	assert( aStandardOutput != NULL );
+	assert( aStandardError != NULL );
+
+	// init the rv
+	memset( &rv, 0, sizeof(rv) );
+
+	// create the command line for this call
+	snprintf( iCommandLine, MAXCOMMANDLINE, "%s %s", aExecutable, aCommand );
+
+	// append the params if set
+	if( aParams != NULL ) {
+		command_length = strlen( iCommandLine );
+		snprintf( &(iCommandLine[command_length]), (MAXCOMMANDLINE - command_length), " %s", aParams );
+	}
+
+	// append the config file if set
+	if( iPipePath.length() != 0 ) {
+		command_length = strlen( iCommandLine );
+		snprintf( &(iCommandLine[command_length]), (MAXCOMMANDLINE - command_length), " -p %s", iPipePath.c_str() );
+	}
+
+	// now run the command line and trap the output
+	//	fprintf( stderr, "COMMANDLINE: '%s'\n", iCommandLine );
+	perr = proc.Execute( iCommandLine, &errcode, iTimeout, aStandardOutput, aStandardError );
+	if( perr != CAE_NONE ) {
+		rv.iResult = DC_EXECUTE_FAILED;
+		rv.iErrorCode = (int)perr;
+		rv.iErrorDetail = errcode;
+		return rv;
+	}
+
+	// see if there was a 'csh:' error
+	match = strncmp( CSH_FAILED_PREFIX, aStandardError->c_str(), strlen(CSH_FAILED_PREFIX) );
+	if( match == 0 ) {
+	  submatch = strstr( aStandardError->c_str(), TARGET_NOT_FOUND );
+	  rv.iResult = ((submatch == NULL) ? DC_CSH_FAILED: DC_COMMAND_TOOL_NOT_FOUND);
+	  rv.iErrorCode = 0;
+	  rv.iErrorDetail = 0;
+	  if( rv.iResult == DC_CSH_FAILED ) {
+	    STRNCPY_NULL_TERMINATE( dynamics_error_string, aStandardError->c_str(), MAXIMUMERRORSTRINGLENGTH );
+	    ptr = &(dynamics_error_string[strlen(CSH_FAILED_PREFIX)]);
+	    STRNCPY_NULL_TERMINATE( rv.iDynamicsErrorString, ptr, MAXIMUMERRORSTRINGLENGTH );
+	  }
+	  return rv;
+	}
+
+	// see if there was a 'Call failed: ' error
+	match = strncmp( CALL_FAILED_PREFIX, aStandardOutput->c_str(), strlen(CALL_FAILED_PREFIX) );
+	if( match == 0 ) {
+		rv.iResult = DC_CALL_FAILED;
+		rv.iErrorCode = GetCallFailedReason( aStandardOutput->c_str() );
+		rv.iErrorDetail = 0;
+		if( rv.iErrorCode == DCF_UNKNOWN ) {
+		  STRNCPY_NULL_TERMINATE( dynamics_error_string, aStandardOutput->c_str(), MAXIMUMERRORSTRINGLENGTH );
+		  ptr = &(dynamics_error_string[strlen(CALL_FAILED_PREFIX)]);
+		  STRNCPY_NULL_TERMINATE( rv.iDynamicsErrorString, ptr, MAXIMUMERRORSTRINGLENGTH );
+		} else {
+		  rv.iDynamicsErrorString[0] = 0;
+		}
+		return rv;
+	}
+
+	// see if there was an 'Invalid arguments. ' error
+	match = strncmp( INVALID_ARGUMENTS_PREFIX, aStandardOutput->c_str(), strlen(INVALID_ARGUMENTS_PREFIX) );
+	if( match == 0 ) {
+		rv.iResult = DC_INVALID_ARGUMENTS;
+		rv.iErrorCode = 0;
+		rv.iErrorDetail = 0;
+		STRNCPY_NULL_TERMINATE( dynamics_error_string, aStandardOutput->c_str(), MAXIMUMERRORSTRINGLENGTH );
+		ptr = &(dynamics_error_string[strlen(INVALID_ARGUMENTS_PREFIX)]);
+		STRNCPY_NULL_TERMINATE( rv.iDynamicsErrorString, ptr, strlen(INVALID_ARGUMENTS_PREFIX) );
+		return rv;
+	}
+	
+	// otherwise everything looks ok - return the output for the upper layer to translate
+	rv.iResult = DC_SUCCESS;
+	rv.iErrorCode = 0;
+	rv.iErrorDetail = 0;
+	(rv.iDynamicsErrorString)[0] = 0;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: GetCallFailedReason
+ * 
+ ***************************************************************************************/
+TDynamicsCallFailedReason CDynamicsCommand::GetCallFailedReason( const char *aOutput )
+{
+  int match;
+  const char *err_string;
+
+  // validate that this is a call failed 
+  match = strncmp( CALL_FAILED_PREFIX, aOutput, strlen(CALL_FAILED_PREFIX) );
+  assert( match == 0 );
+
+  // get the error string
+  err_string = &(aOutput[strlen(CALL_FAILED_PREFIX)]);
+
+  // check for 'function not permitted'
+  match = strncmp( CALL_FAILED_FUNCTION_NOT_PERMITTED, err_string, strlen(CALL_FAILED_FUNCTION_NOT_PERMITTED) );
+  if( match == 0 ) {
+    return DCF_FUNCTION_NOT_PERMITTED;
+  }
+
+  // check for 'agent unreachable'
+  match = strncmp( CALL_FAILED_AGENT_UNREACHABLE, err_string, strlen(CALL_FAILED_AGENT_UNREACHABLE) );
+  if( match == 0 ) {
+    return DCF_AGENT_UNREACHABLE;
+  }
+
+  // can't interpret
+  return DCF_UNKNOWN;
+}
+
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: ConvertTunnelStringToInteger
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::ConvertTunnelStringToInteger( char *aTunnelMode, int *aValue )
+{
+  int rv = -1, i, match;
+
+  // check params
+  assert( aTunnelMode != NULL );
+  assert( aValue != NULL );
+  *aValue = -1;
+
+  // look for a match
+  for( i = 0; iTunnelModeString[i] != NULL; i++ ) {
+    match = strncmp( iTunnelModeString[i], aTunnelMode, strlen(iTunnelModeString[i]) );
+    if( match == 0 ) {
+      *aValue = i;
+      rv = 0;
+    }
+  }
+
+  // done
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: CheckMatchAsBoolean
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::CheckMatchAsBoolean( char *aInput, char *aTrue, int *aValue )
+{
+  int match;
+
+  // check params
+  assert( aInput != NULL );
+  assert( aTrue != NULL );
+  assert( aValue != NULL );
+
+  // check match
+  match = strcmp( aInput, aTrue );
+  *aValue = ((match == 0) ? 1 : 0);
+  return 0;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE METHOD: strstrbeforedelim
+ * 
+ ***************************************************************************************/
+int CDynamicsCommand::strstrbeforedelim( const char *aSearchSpace, const char *aToken, char aDelim )
+{
+  char *next_delim_position, *next_substr_position;
+ 
+  // check params
+  assert( aSearchSpace != NULL );
+  assert( aToken != NULL );
+  
+  // look for the substr - if not found then not found
+  next_substr_position = strstr( aSearchSpace, aToken );
+  if( next_substr_position == NULL ) {
+    return -1;
+  }
+
+  // look for the delim - if not found then the substr was found
+  next_delim_position = strchr( aSearchSpace, aDelim );
+  if( next_delim_position == NULL ) {
+    return 0;
+  }
+
+  // see which one came first
+  if( next_substr_position < next_delim_position ) {
+    return 0;
+  }
+  return -1;
+}
+
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsCommandWrapper/CDynamicsCommand.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,242 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CDynamicsCommand
+*
+*/
+
+
+
+#ifndef __CDYNAMICSCOMMAND_H__
+#define __CDYNAMICSCOMMAND_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <string>
+using namespace std;
+
+
+/****************************************************************************************
+ * 
+ * Constants
+ * 
+ ***************************************************************************************/
+#define MAXIMUMERRORSTRINGLENGTH	128
+#define MAXCOMMANDLINE			256
+#define MAXINTERFACENAME                64
+#define MAXNAILEN                       128
+#define MAXINFOLEN                      128
+#define MAXERRORSTRING                  256
+
+
+/****************************************************************************************
+ * 
+ * Types - General
+ * 
+ ***************************************************************************************/
+typedef enum {
+	DC_SUCCESS,
+	DC_COMMAND_TOOL_NOT_FOUND,
+	DC_INVALID_ARGUMENTS,
+	DC_CSH_FAILED,
+	DC_CALL_FAILED,
+	DC_EXECUTE_FAILED,
+	DC_UNEXPECTED_OUTPUT,
+} TDynamicsCallResult;
+
+typedef enum {
+  DCF_UNKNOWN,
+  DCF_FUNCTION_NOT_PERMITTED,
+  DCF_AGENT_UNREACHABLE
+} TDynamicsCallFailedReason;
+
+typedef struct {
+	TDynamicsCallResult iResult;
+	int iErrorCode;
+	int iErrorDetail;
+	char iDynamicsErrorString[MAXIMUMERRORSTRINGLENGTH];
+} TDynamicsCallInfo;
+
+
+/****************************************************************************************
+ * 
+ * Types - For Foreign Agent Calls
+ * 
+ ***************************************************************************************/
+typedef struct {
+  int iTunnelCount;
+  int iPendingRegistrationRequests;
+  int iRequestsRejected;
+  int iRequestsAccepted;
+  int iReplysAccepted;
+  int iReplysRejected;
+  int iDiscardedUnknownExtension;
+  int iDiscardedMalformed;
+  int iDiscardedVendor;
+  int iAdvertisementsSent;
+} TForeignAgentStatusInfo;
+
+typedef struct {
+  unsigned int iMobileNodeAddress;
+  unsigned int iHomeAgentAddress;
+  int iTunnelID;
+} TTunnelID;
+
+typedef struct {
+  unsigned int iMobileNodeAddress;
+  unsigned int iCareofAddress;
+  unsigned int iHomeAgentAddress;
+  int iPrivateHomeAgentID;
+  int iCreationTime;
+  int iExpirationTime;
+  int iRefreshTime;
+  int iLastTimestamp;
+  int iSPI;
+  int iTimeout;
+} TForeignAgentTunnelInfo;
+
+
+/****************************************************************************************
+ * 
+ * Types - For Home Agent Calls
+ * 
+ ***************************************************************************************/
+typedef struct {
+  int iTunnelCount;
+  int iRequestsRejected;
+  int iRequestsAccepted;
+  int iDiscardedUnknownExtension;
+  int iDiscardedMalformed;
+  int iDiscardedVendor;
+  int iAdvertisementsSent;
+} THomeAgentStatusInfo;
+
+typedef struct {
+  unsigned int iMobileNodeAddress;
+  unsigned int iCareofAddress;
+  unsigned int iHomeAgentAddress;
+  int iCreationTime;
+  int iExpirationTime;
+  int iRefreshTime;
+  int iLastTimestamp;
+  int iSPI;
+  int iTimeout;
+} THomeAgentTunnelInfo;
+
+
+/****************************************************************************************
+ * 
+ * Types - For Mobile Node Agent Calls
+ * 
+ ***************************************************************************************/
+typedef struct {
+  int iConnected;
+  int iTunnelUp;
+  unsigned int iLocalAddress;
+  unsigned int iColocatedAddress;
+  unsigned int iForeignAgentAddress;
+  unsigned int iHomeAgentAddress;
+  unsigned int iHomeAddress;
+  int iLifetimeRemaining;
+  int iTunnelMode;
+  int iSecondsSinceLastRequest;
+  int iSecondsSinceLastReply;
+  int iReplyCode;
+  char iInfoText[MAXINFOLEN];
+  char iLastErrorString[MAXERRORSTRING];
+} TMobileNodeAgentStatusInfo;
+
+typedef struct {
+  unsigned int iForeignAgentAddress;
+  char iInterfaceName[MAXINTERFACENAME];
+  int iPriority;
+  int iInUse;
+  int iInterfaceIndex;
+  int iLastAdvertisement;
+  char iNAI[MAXNAILEN];
+} TMobileNodeForeignAgentInfo;
+
+
+/****************************************************************************************
+ * 
+ * CDynamicsCommand Class Definition
+ * 
+ ***************************************************************************************/
+class CDynamicsCommand 
+{
+public:
+	// General
+	CDynamicsCommand();
+	~CDynamicsCommand();
+	void SetPipePath( string aPipePath );
+	void SetTimeout( int aTimeoutInMilliseconds );
+
+	// Foreign Agent Calls
+	TDynamicsCallInfo ForeignAgentGetStatus( TForeignAgentStatusInfo *aForeignAgentInfo );
+	TDynamicsCallInfo ForeignAgentDestroyTunnel( unsigned int aMobileNodeAddress );
+	TDynamicsCallInfo ForeignAgentGetTunnels( int *aTunnelCount, TTunnelID *aTunnelIDArray );
+	TDynamicsCallInfo ForeignAgentGetTunnelInfo( unsigned int aMobileNodeAddress, TForeignAgentTunnelInfo *aTunnelInfo );
+
+	// Home Agent Calls
+	TDynamicsCallInfo HomeAgentGetStatus( THomeAgentStatusInfo *aHomeAgentInfo );
+	TDynamicsCallInfo HomeAgentDestroyTunnel( unsigned int aMobileNodeAddress , unsigned int aHomeAgentAddress = 0, int aTunnelID = 0);
+	TDynamicsCallInfo HomeAgentGetTunnels( int *aTunnelCount, unsigned int *aMobileNodeAddresses );
+	TDynamicsCallInfo HomeAgentGetTunnelInfo( unsigned int aMobileNodeAddress, THomeAgentTunnelInfo *aTunnelInfo );
+
+	// Mobile Node Calls
+	TDynamicsCallInfo MobileNodeAgentGetCareofAddress( struct in_addr *aCareofAddress );
+	TDynamicsCallInfo MobileNodeAgentGetStatus( TMobileNodeAgentStatusInfo *aMobileNodeAgentInfo );
+	TDynamicsCallInfo MobileNodeAgentConnect();
+	TDynamicsCallInfo MobileNodeAgentDisconnect();
+	TDynamicsCallInfo MobileNodeAgentConfirm();
+	TDynamicsCallInfo MobileNodeAgentRescan();
+	TDynamicsCallInfo MobileNodeAgentSetPolicy( int aPolicyVector );
+	TDynamicsCallInfo MobileNodeAgentGetPolicy( int *aPolicyVector );
+	TDynamicsCallInfo MobileNodeAgentGetForeignAgentList( int *aListCount, TMobileNodeForeignAgentInfo *aForeignAgentInfoList );
+	TDynamicsCallInfo MobileNodeAgentGetForeignAgentInfo( unsigned int aFAAddress, TMobileNodeForeignAgentInfo *aForeignAgentInfo );
+
+private:
+	// Helper functions
+	TDynamicsCallInfo DynamicsCall( char *aExecutable, char *aCommand, char *aParams, string *aStandardOutput, 
+					string *aStandardError );
+
+	int GetIntegerEntry( const char *aOutput, const char *aLabel, int *aValue );
+	int GetDateEntry( const char *aOutput, const char *aLabel, int *aValue );
+	int GetAddressEntry( const char *aOutput, const char *aLabel, unsigned int *aValue );
+	int GetPolicyEntry( const char *aOutput, const char *aLabel, int *aValue );
+	int GetStringEntry( const char *aOutput, const char *aLabel, char *aValue, int aBufferSize  );
+
+	TDynamicsCallFailedReason GetCallFailedReason( const char *aOutput );
+
+	TDynamicsCallInfo ParseForeignAgentListOutput( string aOutput, int aListSize, TTunnelID *aTunnelIDArray, int *aListCount );
+	TDynamicsCallInfo ParseHomeAgentListOutput( string aOutput, int aListSize, unsigned int *aTunnelList, int *aListCount );
+	TDynamicsCallInfo ParseMobileNodeAgentListOutput( string aOutput, int aListSize, TMobileNodeForeignAgentInfo *aForeignAgentList, 
+							  int *aListCount );
+
+	int ConvertTunnelStringToInteger( char *aTunnelMode, int *aValue );
+	int CheckMatchAsBoolean( char *aInput, char *aTrue, int *aValue );
+	int strstrbeforedelim( const char *aSearchSpace, const char *aToken, char aDelim );
+
+	// Members
+	int iTimeout;
+	string iPipePath;
+	char iCommandLine[MAXCOMMANDLINE];
+};
+
+
+#endif //__CDYNAMICSCOMMAND_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsCommandWrapper/DynamicsCommandWrapper.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,104 @@
+# Microsoft Developer Studio Project File - Name="DynamicsCommandWrapper" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=DynamicsCommandWrapper - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DynamicsCommandWrapper.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DynamicsCommandWrapper.mak" CFG="DynamicsCommandWrapper - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DynamicsCommandWrapper - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "DynamicsCommandWrapper - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "DynamicsCommandWrapper - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "DynamicsCommandWrapper - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "DynamicsCommandWrapper - Win32 Release"
+# Name "DynamicsCommandWrapper - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CDynamicsCommand.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CDynamicsCommand.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsCommandWrapper/DynamicsCommandWrapper.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "DynamicsCommandWrapper"=.\DynamicsCommandWrapper.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsCommandWrapper/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,32 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../BinInternal/libdynwrap.a
+INCLUDES=
+OBJECTS=	CDynamicsCommand.o
+LIBS=
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) 
+	ar -rcs $(TARGET) $(OBJECTS)
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/CDynamicsConfigFile.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,411 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#ifndef WIN32
+#include <unistd.h>
+#else
+#include <io.h>
+#endif
+#include <errno.h>
+#include <assert.h>
+
+
+/******************************************************************************************************
+ *
+ * Local Includes
+ *
+ *****************************************************************************************************/
+#include "file_utilities.h"
+#include "CDynamicsConfigFile.h"
+
+
+/******************************************************************************************************
+ *
+ * Definition
+ *
+ *****************************************************************************************************/
+#define MAXFILENAMESIZE      128
+#define MAXLINEPOSITION      99999
+#define MAXTOKENMATCHES      16
+#define MAXLINESIZE          2048
+#ifdef WIN32
+#define snprintf             _snprintf
+#endif
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: Constructors
+ *
+ *****************************************************************************************************/
+CDynamicsConfigFile::CDynamicsConfigFile()
+{
+  iStatus = DCS_INIT;
+  iReferenceFilename = "";
+  iLocalFilename = "";
+}
+
+
+CDynamicsConfigFile::~CDynamicsConfigFile()
+{
+  assert( iStatus != DCS_ACTIVE_LOCAL_COPY );
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: SetReferenceFile
+ *
+ *****************************************************************************************************/
+TDCFError CDynamicsConfigFile::SetReferenceFile( string aReferenceFile )
+{
+  // check that we don't have an active local copy
+  if( iStatus == DCS_ACTIVE_LOCAL_COPY ) {
+    return DCE_INVALID_STATE;
+  }
+
+  // set the reference file
+  iReferenceFilename = aReferenceFile;
+  iStatus = DCS_REFERENCE_FILE_SET;
+  return DCE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: CreateLocalCopy
+ *
+ *****************************************************************************************************/
+TDCFError CDynamicsConfigFile::CreateLocalCopy( int *aSystemError )
+{
+  TFUError ferr;
+  FILE *fp_dest, *fp_source;
+  char copy_filename[MAXFILENAMESIZE];
+
+  // check params
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // check the state
+  if( iStatus != DCS_REFERENCE_FILE_SET ) {
+    return DCE_INVALID_STATE;
+  }
+
+  // create a tempfile to hold the local copy
+  fp_dest = OpenTempfile( (char*)iReferenceFilename.c_str(), copy_filename, MAXFILENAMESIZE, "w", aSystemError );
+  if( fp_dest == NULL ) {
+    return DCE_OPEN_TEMP_ERROR;
+  }
+
+  // open the source file
+  fp_source = fopen( (char*)iReferenceFilename.c_str(), "r" );
+  if( fp_source == NULL ) {
+    fclose( fp_dest );
+	unlink( copy_filename );
+    *aSystemError = errno;
+    return DCE_OPEN_ERROR;
+  }
+
+  // copy the files, close them, and look for errors
+  ferr = CopyFileByPtr( fp_source, fp_dest, aSystemError );
+  fflush( fp_source );
+  fflush( fp_dest );
+  fclose( fp_source );
+  fclose( fp_dest );
+  if( ferr != FUE_NONE ) {
+  	unlink( copy_filename );
+    return (TDCFError)ferr;
+  }
+
+  // we have been successful - update the state
+  iLocalFilename = copy_filename;
+  iStatus = DCS_ACTIVE_LOCAL_COPY;
+  return DCE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: RemoveLocalCopy
+ *
+ *****************************************************************************************************/
+TDCFError CDynamicsConfigFile::RemoveLocalCopy( int *aSystemError )
+{
+  // check params
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // check the state
+  if( iStatus != DCS_ACTIVE_LOCAL_COPY ) {
+    return DCE_INVALID_STATE;
+  }
+
+  // remove the local copy
+  unlink( iLocalFilename.c_str() );
+  iStatus = DCS_REFERENCE_FILE_SET;
+  return DCE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: SetSingleOption
+ *
+ *****************************************************************************************************/
+TDCFError CDynamicsConfigFile::SetSingleOption( string aLabel, string aValue, int *aSystemError )
+{
+  TFUError ferr;
+  int line_numbers[MAXTOKENMATCHES], match_count, insert_line, replace_flag = 1;
+
+  // check params
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // check the state
+  if( iStatus != DCS_ACTIVE_LOCAL_COPY ) {
+    return DCE_INVALID_STATE;
+  }
+
+  // get the list of occurences of the label
+  match_count = MAXTOKENMATCHES;
+  ferr = FindMatchingLines( (char*)iLocalFilename.c_str(), (char*)aLabel.c_str(), line_numbers, &match_count, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+
+  // make sure there is one or zero occurences
+  if( match_count > 1 ) {
+    return DCE_MULTIPLE_MATCHES;
+  }
+
+  // set the line to insert at -- if zero occurences then add at the start of the file and DONT REPLACE
+  insert_line = line_numbers[0];
+  if( match_count == 0 ) {
+    insert_line = 1;
+    replace_flag = 0;
+  }
+
+  // insert the line
+  ferr = InsertLine( (char*)iLocalFilename.c_str(), insert_line, (char*)aValue.c_str(), aValue.length(), replace_flag, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+  
+  // done
+  return DCE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: AddListOption
+ *
+ *****************************************************************************************************/
+TDCFError CDynamicsConfigFile::AddListOption( string aBlockStartTag, string aBlockEndTag, string aLineItem, int *aSystemError )
+{
+  TFUError ferr;
+  int start_block_tag[MAXTOKENMATCHES], end_block_tag[MAXTOKENMATCHES], start_block_count, end_block_count;
+
+  // check params
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // check the state
+  if( iStatus != DCS_ACTIVE_LOCAL_COPY ) {
+    return DCE_INVALID_STATE;
+  }
+
+  // count the number of times the block start label appears in the file -- must 1 here
+  start_block_count = MAXTOKENMATCHES;
+  ferr = FindMatchingLines( (char*)iLocalFilename.c_str(), (char*)aBlockStartTag.c_str(), start_block_tag, &start_block_count, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+
+  // count the number of times the block end label appears in the file -- must 1 here
+  end_block_count = MAXTOKENMATCHES;
+  ferr = FindMatchingLines( (char*)iLocalFilename.c_str(), (char*)aBlockEndTag.c_str(), end_block_tag, &end_block_count, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+
+  // make sure there is exactly one of each tag
+  if( start_block_count == 0 ) {
+    return DCE_START_TAG_NOT_FOUND;
+  }
+  if( start_block_count > 1 ) {
+    return DCE_MULTIPLE_START_TAGS_FOUND;
+  }
+  if( end_block_count == 0 ) {
+    return DCE_END_TAG_NOT_FOUND;
+  }
+  if( end_block_count > 1 ) {
+    return DCE_MULTIPLE_END_TAGS_FOUND;
+  }
+
+  // ok - insert the line before the end tag  
+  ferr = InsertLine( (char*)iLocalFilename.c_str(), end_block_tag[0], (char*)aLineItem.c_str(), aLineItem.length(), 0, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+  
+  // done
+  return DCE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: RemoveListOption
+ *
+ *****************************************************************************************************/
+TDCFError CDynamicsConfigFile::RemoveListOption( string aBlockStartTag, string aBlockEndTag, string aFirstToken, int *aSystemError )
+{
+  TFUError ferr;
+  int start_block_tag[MAXTOKENMATCHES], end_block_tag[MAXTOKENMATCHES], entries[MAXTOKENMATCHES], start_block_count, end_block_count, entry_count;
+  int i;
+
+  // check params
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // check the state
+  if( iStatus != DCS_ACTIVE_LOCAL_COPY ) {
+    return DCE_INVALID_STATE;
+  }
+
+  // count the number of times the block start label appears in the file -- must 1 here
+  start_block_count = MAXTOKENMATCHES;
+  ferr = FindMatchingLines( (char*)iLocalFilename.c_str(), (char*)aBlockStartTag.c_str(), start_block_tag, &start_block_count, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+
+  // count the number of times the block end label appears in the file -- must 1 here
+  end_block_count = MAXTOKENMATCHES;
+  ferr = FindMatchingLines( (char*)iLocalFilename.c_str(), (char*)aBlockEndTag.c_str(), end_block_tag, &end_block_count, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+
+  // make sure there is exactly one of each tag
+  if( start_block_count <= 0 ) {
+    return DCE_START_TAG_NOT_FOUND;
+  } else if( end_block_count <= 0 ) {
+    return DCE_END_TAG_NOT_FOUND;
+  } else if( start_block_count > 1 ) {
+    return DCE_MULTIPLE_START_TAGS_FOUND;
+  } else if( end_block_count > 1 ) {
+    return DCE_MULTIPLE_END_TAGS_FOUND;
+  }
+  assert( (start_block_count == 1) && (end_block_count == 1) );
+
+  // count the number of lines matching the token
+  entry_count = MAXTOKENMATCHES;
+  ferr = FindMatchingLines( (char*)iLocalFilename.c_str(), (char*)aFirstToken.c_str(), entries, &entry_count, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+
+  // now look for the first entry that is between the tags
+  for( i = 0; i < entry_count; i++ ) {
+    if( (entries[i] >= start_block_tag[0]) && (entries[i] <= end_block_tag[0]) )
+      break;
+  }
+			
+  // if no match was found between the tags then exit
+  if( i == entry_count ) {
+    return DCE_ENTRY_NOT_FOUND;
+  }
+
+  // remove the line
+  ferr = InsertLine( (char*)iLocalFilename.c_str(), entries[i], NULL, 0, 1, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+  
+  // done
+  return DCE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: RemoveListOption
+ *
+ *****************************************************************************************************/
+TDCFError CDynamicsConfigFile::RemoveSingleOption( string aLabel, int *aSystemError )
+{
+  TFUError ferr;
+  int line_numbers[MAXTOKENMATCHES], match_count, insert_line;
+  char nline[MAXLINESIZE];
+
+  // check params
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // check the state
+  if( iStatus != DCS_ACTIVE_LOCAL_COPY ) {
+    return DCE_INVALID_STATE;
+  }
+
+  // get the list of occurences of the label
+  match_count = MAXTOKENMATCHES;
+  ferr = FindMatchingLines( (char*)iLocalFilename.c_str(), (char*)aLabel.c_str(), line_numbers, &match_count, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+
+  // make sure there is one or zero occurences
+  if( match_count > 1 ) {
+    return DCE_MULTIPLE_MATCHES;
+  }
+
+  // if there is zero then there is nothing to set
+  if( match_count == 0 ) {
+	  return DCE_NONE;
+  }
+
+  // otherwise replace the line with the string '# aLabel'
+  assert( match_count == 1 );
+  insert_line = line_numbers[0];
+  snprintf( nline, MAXLINESIZE, "# %s", aLabel.c_str() );
+
+  // insert the line
+  ferr = InsertLine( (char*)iLocalFilename.c_str(), insert_line, nline, strlen(nline), 1, aSystemError );
+  if( ferr != FUE_NONE ) {
+    return (TDCFError)ferr;
+  }
+  
+  // done
+  return DCE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PUBLIC METHOD: GetLocalFilename
+ *
+ *****************************************************************************************************/
+const char *CDynamicsConfigFile::GetLocalFilename()
+{
+	return iLocalFilename.c_str();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/CDynamicsConfigFile.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+#ifndef __CDYNAMICSCONFIGFILE_H__
+#define __CDYNAMICSCONFIGFILE_H__
+
+/******************************************************************************************************
+ *
+ * System Includes
+ *
+ *****************************************************************************************************/
+#include <string>
+using namespace std;
+
+
+/******************************************************************************************************
+ *
+ * Types
+ *
+ *****************************************************************************************************/
+typedef enum {
+  // These values must precisely match FUE_ errors
+  DCE_NONE,
+  DCE_READ_ERROR,
+  DCE_WRITE_ERROR,
+  DCE_OPEN_ERROR,
+  DCE_OPEN_TEMP_ERROR,
+  DCE_OPEN_SOURCE_ERROR,			// 5
+  DCE_RENAME_ERROR,
+  DCE_END_OF_FILE,
+
+  // These are specific errors
+  DCE_INVALID_STATE,
+  DCE_COPY_ERROR,
+  DCE_MULTIPLE_MATCHES,				// 10
+  DCE_START_TAG_NOT_FOUND,
+  DCE_MULTIPLE_START_TAGS_FOUND,
+  DCE_END_TAG_NOT_FOUND,
+  DCE_MULTIPLE_END_TAGS_FOUND,		
+  DCE_ENTRY_NOT_FOUND,                          // 15
+} TDCFError;
+
+typedef enum {
+  DCS_INIT,
+  DCS_REFERENCE_FILE_SET,
+  DCS_ACTIVE_LOCAL_COPY,
+} TDCFStatus;
+
+
+/******************************************************************************************************
+ *
+ * class CDynamicsConfigFile
+ *
+ *****************************************************************************************************/
+class CDynamicsConfigFile
+{
+public:
+  CDynamicsConfigFile();
+  ~CDynamicsConfigFile();
+
+  // Management
+  TDCFError SetReferenceFile( string aReferenceFile );
+  TDCFError CreateLocalCopy( int *aSystemError );
+  TDCFError RemoveLocalCopy( int *aSystemError );
+
+  // Les fonctionnaires
+  TDCFError SetSingleOption( string aLabel, string aValue, int *aSystemError );
+  TDCFError RemoveSingleOption( string aLabel, int *aSystemError );
+  TDCFError AddListOption( string aBlockStartTag, string aBlockEndTag, string aLineItem, int *aSystemError );
+  TDCFError RemoveListOption( string aBlockStartTag, string aBlockEndTag, string aFirstToken, int *aSystemError );
+  const char *GetLocalFilename();
+
+private:
+
+  // Stateless helpers
+  TDCFError GenerateLocalFilenameTemplate( char *aBuffer, int aSize );
+
+  // Members
+  string iReferenceFilename;
+  string iLocalFilename;
+  TDCFStatus iStatus;
+};
+
+#endif //__CDYNAMICSCONFIGFILE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/DynamicsConfigurationLibrary.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,108 @@
+# Microsoft Developer Studio Project File - Name="DynamicsConfigurationLibrary" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=DynamicsConfigurationLibrary - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DynamicsConfigurationLibrary.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DynamicsConfigurationLibrary.mak" CFG="DynamicsConfigurationLibrary - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DynamicsConfigurationLibrary - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "DynamicsConfigurationLibrary - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "DynamicsConfigurationLibrary - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libdynconf.lib"
+
+!ELSEIF  "$(CFG)" == "DynamicsConfigurationLibrary - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libdynconf.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "DynamicsConfigurationLibrary - Win32 Release"
+# Name "DynamicsConfigurationLibrary - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CDynamicsConfigFile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_utilities.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CDynamicsConfigFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_utilities.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/DynamicsConfigurationLibrary.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "DynamicsConfigurationLibrary"=.\DynamicsConfigurationLibrary.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../BinInternal/libdynamicsconfig.a
+INCLUDES=
+OBJECTS=	CDynamicsConfigFile.o 	\
+		file_utilities.o
+LIBS=
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) 
+	ar -rcs $(TARGET) $(OBJECTS)
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/file_utilities.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,559 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#ifndef WIN32
+#include <unistd.h>
+#else
+#include <io.h>
+#endif
+#include <assert.h>
+ 
+
+/******************************************************************************************************
+ *
+ * Local Includes
+ *
+ *****************************************************************************************************/
+#include "file_utilities.h"
+
+
+/******************************************************************************************************
+ *
+ * Definitions
+ *
+ *****************************************************************************************************/
+#define TEMPFILE_SUFFIX               "XXXXXX"
+#define MAXLINESIZE                    2048
+#define COPYBUFFER                     2048
+#define TEMPFILENAMESIZE               128
+#define INSERT_TEMPFILE_PREFIX         "insert_tempfile."
+
+#define MIN(a,b)                       (((a)<(b))?a:b)
+
+
+/******************************************************************************************************
+ *
+ * Prototypes
+ *
+ *****************************************************************************************************/
+#ifdef WIN32
+static int mkstemp( char *aString );
+#endif
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: OpenTempfile
+ *
+ *****************************************************************************************************/
+FILE *OpenTempfile( char *aFilenamePrefix, char *aFilename, int aLen, char *aMode, int *aSystemError )
+{
+  int err, prefix_len;
+  FILE *fp;
+
+  // check params
+  assert( aFilenamePrefix != NULL );
+  assert( aFilename != NULL );
+  assert( aSystemError != NULL );
+  assert( aLen > (strlen(TEMPFILE_SUFFIX) + 1) );
+  *aSystemError = 0;
+
+  // copy the prefix into the buffer
+  prefix_len = MIN( strlen(aFilenamePrefix), (aLen - strlen(TEMPFILE_SUFFIX) - 1) );
+  memcpy( aFilename, aFilenamePrefix, prefix_len );
+
+  // copy the template into the buffer and NULL terminate
+  memcpy( &(aFilename[prefix_len]), TEMPFILE_SUFFIX, strlen(TEMPFILE_SUFFIX) );
+  aFilename[prefix_len + strlen(TEMPFILE_SUFFIX)] = 0;
+  
+  // get the filename
+  err = mkstemp( aFilename );
+  if( err == -1 ) { 
+    *aSystemError = errno;
+    return NULL;
+  }
+
+  // now open the file
+  fp = fopen( aFilename, aMode );
+  if( fp == NULL ) {
+    *aSystemError = errno;
+  }
+  return fp;
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: CopyFileByPtr
+ *
+ *****************************************************************************************************/
+TFUError CopyFileByPtr( FILE *aSource, FILE *aDest, int *aSystemError )
+{
+  char buff[COPYBUFFER];
+  int bytes_read, bytes_written;
+
+  // check params
+  assert( aSource != NULL );
+  assert( aDest != NULL );
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // now copy all the bytes
+  while( 1 ) {
+
+    // read from the source
+    bytes_read = fread( buff, 1, COPYBUFFER, aSource );
+    assert( bytes_read >= 0 );
+
+    // check for read errors 
+    if( ferror(aSource) != 0 ) {
+      *aSystemError = errno;
+      return FUE_READ_ERROR;
+    }
+
+    // if some bytes were read then write to the destination
+    bytes_written = fwrite( buff, 1, bytes_read, aDest );
+    assert( bytes_written >= 0 );
+
+    // check for write errors
+    if( bytes_written != bytes_read ) {
+      *aSystemError = errno;
+      return FUE_WRITE_ERROR;
+    }
+
+    // check for eof 
+    if( feof(aSource) != 0 ) {
+      return FUE_NONE;
+    }
+  }
+
+  // done
+  assert( !"INVALID CODE PATH" );
+  return FUE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: CopyFileByName
+ *
+ *****************************************************************************************************/
+TFUError CopyFileByName( char *aSource, char *aDest, int *aSystemError )
+{
+  FILE *fpsrc, *fpdst;
+  TFUError err;
+
+  // check params
+  assert( aSource != NULL );
+  assert( aDest != NULL );
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // open the source filename
+  fpsrc = fopen( aSource, "r" );
+  if( fpsrc == NULL ) {
+    *aSystemError = errno;
+    return FUE_OPEN_ERROR;
+  }
+
+  // open the dest filename
+  fpdst = fopen( aDest, "w" );
+  if( fpdst == NULL ) {
+    fclose( fpsrc );
+    *aSystemError = errno;
+    return FUE_OPEN_ERROR;
+  }
+  
+  // copy the files
+  err = CopyFileByPtr( fpsrc, fpdst, aSystemError );
+
+  // close the files
+  fflush( fpsrc );
+  fflush( fpdst );
+  fclose( fpsrc );
+  fclose( fpdst );
+
+  // if the copy failed then remove the new file
+  if( err != FUE_NONE ) {
+    unlink( aDest );
+  }
+
+  // done
+  return err;      
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: InsertLine
+ *
+ *****************************************************************************************************/
+TFUError InsertLine( char *aFilename, int aLineNumber, char *aLine, int aLineSize, int aReplaceFlag, int *aSystemError )
+{
+  char buff[COPYBUFFER], tempfilename[TEMPFILENAMESIZE];
+  int i, end_of_file, err, insert_line_logic, line_inserted = 0;
+  TFUError rv;
+  FILE *fp_dest, *fp_source;
+
+  // check params
+  assert( aFilename != NULL );
+  assert( (aLine != NULL) || (aLineSize == 0) );
+  assert( aSystemError != NULL );
+  assert( aLineNumber > 0 );
+  *aSystemError = 0;
+
+  // open the file
+  fp_source = fopen( aFilename, "r" );
+  if( fp_source == NULL ) {
+    *aSystemError = errno;
+    return FUE_OPEN_SOURCE_ERROR;
+  }
+
+  // now open the tempfile
+  fp_dest = OpenTempfile( INSERT_TEMPFILE_PREFIX, tempfilename, TEMPFILENAMESIZE, "w", aSystemError );
+  if( fp_dest == NULL ) {
+    fclose( fp_source );
+    return FUE_OPEN_TEMP_ERROR;
+  }
+
+  // now copy all files until we get to the target line - add the new line - then keep going
+  for( i = 1; ; i++ ) {
+    
+    // read the next line from the source file 
+    fgets( buff, COPYBUFFER, fp_source );
+
+    // check for errors
+    if( ferror(fp_source) != 0 ) {
+      *aSystemError = errno;
+      rv = FUE_READ_ERROR;
+      break;
+    }
+
+    // see if we want to insert the newline at this point: we do if the user specified to insert before 
+    // this line OR if we have hit the end of the file. In both cases there must be something to insert.
+    end_of_file = feof( fp_source );
+    insert_line_logic = ((aLineNumber == i) || ((line_inserted == 0)&&(end_of_file != 0)));
+    if( (insert_line_logic != 0) && (aLineSize > 0) ) {
+      fwrite( aLine, 1, aLineSize, fp_dest );
+      if( ferror(fp_dest) != 0 ) {
+	*aSystemError = errno;
+	rv = FUE_WRITE_ERROR;
+	break;
+      }
+      fputc( '\n', fp_dest );
+      line_inserted = 1;
+    }
+    
+    // if we have hit the end of the file then we are done
+    if( end_of_file != 0 ) {
+      rv = FUE_NONE;
+      break;
+    }
+
+    // write the line just read -- unless we just inserted a line and the replace flag is set
+    if( (insert_line_logic == 0) || (aReplaceFlag == 0) ) {
+      fwrite( buff, 1, strlen(buff), fp_dest );
+      if( ferror(fp_dest) != 0 ) {
+		*aSystemError = errno;
+		rv = FUE_WRITE_ERROR;
+		break;
+      }
+    }
+    
+    // go to next line
+  }
+
+  // close both files
+  fflush( fp_source );
+  fflush( fp_dest );
+  fclose( fp_source );
+  fclose( fp_dest );
+
+  // if we were successful then remove the original file and rename the new file to the original 
+  // filename -- otherwise just remove the tempfile
+  if( rv == FUE_NONE ) {
+    unlink( aFilename );
+    err = rename( tempfilename, aFilename );
+    if( err != 0 ) {
+      *aSystemError = errno;
+      rv = FUE_RENAME_ERROR;
+      unlink( tempfilename );
+    }
+  } else {
+    unlink( tempfilename );
+  }
+      
+  // done
+  return rv;
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: GetLine
+ *
+ *****************************************************************************************************/
+TFUError GetLine( char *aFilename, int aLineNumber, char *aBuffer, int aBufferSize, int *aSystemError )
+{
+  FILE *fp;
+  char *cline;
+  int i;
+
+  // check params
+  assert( aLineNumber >= 0 );
+  assert( aBuffer != NULL );
+  assert( aSystemError != NULL );
+  *aSystemError = 0;
+
+  // open the file
+  fp = fopen( aFilename, "r" );
+  if( fp == NULL ) {
+    *aSystemError = errno;
+    return FUE_OPEN_ERROR;
+  }
+
+  // read through the file until finding the appropriate line
+  for( i = 0; i < aLineNumber; i++ ) {
+    cline = fgets( aBuffer, aBufferSize, fp );
+    if( cline == NULL )
+      break;
+  }
+
+  // done with the file
+  fflush( fp );
+  fclose( fp );
+
+  // if cline is null then we reached the end-of-file
+  if( cline == NULL ) {
+    return FUE_END_OF_FILE;
+  }
+
+  // otherwise just return -- the line is in the buffer
+  return FUE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: FindMatchingLines
+ *
+ *****************************************************************************************************/
+TFUError FindMatchingLines( char *aFilename, char *aToken, int *aLineList, int *aListSize, int *aSystemError )
+{
+  int list_capacity, i, match;
+  char cline[MAXLINESIZE], *cptr, *token_start, *token_end;
+  FILE *fp;
+  TFUError rv;
+
+  // check params
+  assert( aFilename != NULL );
+  assert( aToken != NULL );
+  assert( aLineList != NULL );
+  assert( aListSize != NULL );
+  assert( aSystemError != NULL );
+  list_capacity = *aListSize;
+  *aListSize = 0;
+  *aSystemError = 0;
+
+  // open the file
+  fp = fopen( aFilename, "r" );
+  if( fp == NULL ) {
+    *aSystemError = errno;
+    return FUE_OPEN_ERROR;
+  }
+
+  // now read through the line and look for a line starting with the passed token (after whitespace and '#')
+  for( i = 1; ; i++ ) {
+    
+    // read the next line
+    cptr = fgets( cline, MAXLINESIZE, fp );
+    
+    // check for errors
+    if( ferror(fp) != 0 ) {
+      *aSystemError = errno;
+      rv = FUE_READ_ERROR;
+      break;
+    }
+
+    // check for end of file
+    if( cptr == NULL ) {
+      rv =  FUE_NONE;
+      break;
+    }
+
+    // remove any whitespace (' ' + '\t') and hashes to find the start of the token
+    for( token_start = cline; (*token_start == ' ') || (*token_start == '\t') || (*token_start == '#'); token_start++ )
+      ;
+
+    // now find the end of the token
+    for( token_end = token_start; (*token_end != ' ') && (*token_end != '\t') && (*token_end != '\n') && (*token_end != 0); token_end++ ) 
+      ;
+
+    // null terminate the token - no need to save the old value
+    *token_end = 0;
+
+    // now compare the tokens and add the match
+    match = strcmp( token_start, aToken );
+    if( (match == 0) && ((*aListSize) < list_capacity) ) {
+		aLineList[(*aListSize)++] = i;
+    }
+	
+    // and do it all again
+  }
+
+  // close up the file and return
+  fflush( fp );
+  fclose( fp );
+
+  // done
+  return rv;
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: FindMatchingLinesByRawPrefix
+ *
+ *****************************************************************************************************/
+TFUError FindMatchingLinesByRawPrefix( char *aFilename, char *aToken, int *aLineList, int *aListSize, int *aSystemError )
+{
+  int list_capacity, i, match, token_length;
+  char cline[MAXLINESIZE], *cptr;
+  FILE *fp;
+  TFUError rv;
+
+  // check params
+  assert( aFilename != NULL );
+  assert( aToken != NULL );
+  assert( aLineList != NULL );
+  assert( aListSize != NULL );
+  assert( aSystemError != NULL );
+  list_capacity = *aListSize;
+  *aListSize = 0;
+  *aSystemError = 0;
+
+  // get the length of the passed token
+  token_length = strlen( aToken );
+  assert( token_length > 0 );
+
+  // open the file
+  fp = fopen( aFilename, "r" );
+  if( fp == NULL ) {
+    *aSystemError = errno;
+    return FUE_OPEN_ERROR;
+  }
+
+  // now read through the line and look for a line starting with the passed token
+  for( i = 1; ; i++ ) {
+    
+    // read the next line
+    cptr = fgets( cline, MAXLINESIZE, fp );
+    
+    // check for errors
+    if( ferror(fp) != 0 ) {
+      *aSystemError = errno;
+      rv = FUE_READ_ERROR;
+      break;
+    }
+
+    // check for end of file
+    if( cptr == NULL ) {
+      rv =  FUE_NONE;
+      break;
+    }
+
+
+    // now compare the tokens and add the match
+    match = strncmp( cptr, aToken, token_length );
+    if( (match == 0) && ((*aListSize) < list_capacity) ) {
+		aLineList[(*aListSize)++] = i;
+    }
+	
+    // and do it all again
+  }
+
+  // close up the file and return
+  fflush( fp );
+  fclose( fp );
+
+  // done
+  return rv;
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: GetFileLineCount
+ *
+ *****************************************************************************************************/
+TFUError GetFileLineCount( char *aFilename, int *aLineCount, int *aSystemError )
+{
+  FILE *fp;
+  char cline[MAXLINESIZE], *cptr;
+
+  // check params
+  assert( aFilename != NULL );
+  assert( aLineCount != NULL );
+  assert( aSystemError != NULL );
+  *aLineCount = *aSystemError = 0;
+
+  // open the file
+  fp = fopen( aFilename, "r" );
+  if( fp == NULL ) {
+    *aSystemError = errno;
+    return FUE_OPEN_ERROR;
+  }
+
+  // read through the file and count the number of lines
+  while( 1 ) {
+    cptr = fgets( cline, MAXLINESIZE, fp );
+    if( cptr == NULL )
+      break;
+    (*aLineCount)++;
+  }
+
+  // done with the file
+  fclose( fp );
+
+  // otherwise just return -- the line is in the buffer
+  return FUE_NONE;
+}
+
+
+/******************************************************************************************************
+ *
+ * PRIVATE METHOD: mkstemp
+ *
+ *****************************************************************************************************/
+#ifdef WIN32
+int mkstemp( char *aString )
+{
+	char *ptr;
+	ptr = _mktemp( aString );
+	if( ptr == NULL ) {
+		return -1;
+	}
+	return 0;
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/file_utilities.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+#ifndef __FILE_UTILITIES_H__
+#define __FILE_UTILITIES_H__
+
+
+/******************************************************************************************************
+ *
+ * System Includes
+ *
+ *****************************************************************************************************/
+#include <string>
+using namespace std;
+
+
+/******************************************************************************************************
+ *
+ * Types
+ *
+ *****************************************************************************************************/
+typedef enum {
+  FUE_NONE,
+  FUE_READ_ERROR,
+  FUE_WRITE_ERROR,
+  FUE_OPEN_ERROR,
+  FUE_OPEN_TEMP_ERROR,
+  FUE_OPEN_SOURCE_ERROR,
+  FUE_RENAME_ERROR,
+  FUE_END_OF_FILE,
+} TFUError;
+
+
+/******************************************************************************************************
+ *
+ * Prototypes
+ *
+ *****************************************************************************************************/
+FILE *OpenTempfile( char *aFilenamePrefix, char *aFilename, int aLen, char *aMode, int *aSystemError );
+TFUError CopyFileByPtr( FILE *aSource, FILE *aDest, int *aSystemError );
+TFUError CopyFileByName( char *aSource, char *aDest, int *aSystemError );
+TFUError GetLine( char *aFilename, int aLineNumber, char *aBuffer, int aBufferSize, int *aSystemError );
+TFUError InsertLine( char *aFilename, int aLineNumber, char *aLine, int aLineSize, int aReplaceFlag, int *aSystemError );
+TFUError FindMatchingLines( char *aFilename, char *aToken, int *aLineList, int *aListSize, int *aSystemError );
+TFUError FindMatchingLinesByRawPrefix( char *aFilename, char *aToken, int *aLineList, int *aListSize, int *aSystemError );
+TFUError GetFileLineCount( char *aFilename, int *aLineCount, int *aSystemError );
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/CSHostexecuteasync.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,307 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Thu Oct 16 14:41:55 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <signal.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHostexecuteasync.h"
+#include "CSHostexecuteasync.h"
+#include "../include/standard_unix.h"
+#include "../include/strncpynt.h"
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSHostexecuteasync::CSHostexecuteasync()
+{
+	iProcess = NULL;
+}
+
+CSHostexecuteasync::~CSHostexecuteasync()
+{
+	assert( iProcess == NULL );
+}
+
+int CSHostexecuteasync::GetKey()
+{
+	return iKey;
+}
+
+void CSHostexecuteasync::SetKey( int aKey )
+{
+	iKey = aKey;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startprocess
+ * 
+ ***************************************************************************************/
+TResult CSHostexecuteasync::cstr_startprocess( char *aArgs )
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	int errcode;
+	TCAProcessError perr;
+
+	// create a process object
+	iProcess = new CAProcess();
+	assert( iProcess != NULL );
+
+	// start the process running
+	perr = iProcess->StartProcess( aArgs, &errcode, true, true, false );
+	if( perr != CAE_NONE ) {
+		rv.iStandardResult = ERR_START_PROCESS_ERROR;
+		rv.iExtendedCode = (int)perr;
+		rv.iSystemError = errcode;
+		delete iProcess;
+		iProcess = NULL;
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeprocess
+ * 
+ ***************************************************************************************/
+TResult CSHostexecuteasync::dstr_removeprocess( int aArgs, int *aDeleteInstance )
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// make sure that we still have a process
+	assert( iProcess != NULL );
+	
+	// get the status of the process to make sure we are ok
+	perr = iProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus == PS_STARTED ) {
+	  *aDeleteInstance = 0;
+	  rv.iStandardResult = ERR_INVALIDSTATE;
+	  return rv;
+	}
+
+	// ok - remove the process
+	delete iProcess;
+	iProcess = NULL;
+
+	// done - success
+	*aDeleteInstance = 1; 
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: killprocess
+ * 
+ ***************************************************************************************/
+TResult CSHostexecuteasync::killprocess( int aArgs )
+{
+	return StopProcessWithSignal( SIGKILL );
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopprocess
+ * 
+ ***************************************************************************************/
+TResult CSHostexecuteasync::stopprocess( int aArgs )
+{
+	return StopProcessWithSignal( SIGTERM );
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getprocessinfo
+ * 
+ ***************************************************************************************/
+THostExecuteAsyncProcessInfo CSHostexecuteasync::getprocessinfo( int aArgs )
+{
+	string command_line;
+	THostExecuteAsyncProcessInfo rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus = PS_INVALID;
+	TProcessExitReason preason = ER_INVALID;
+	int exitcode = 0;
+
+	// check the state
+	assert( iProcess != NULL );
+
+	// interrogate the process	
+	perr = iProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) ) {
+		perr = iProcess->GetExitReason( &preason );
+		assert( perr == CAE_NONE );
+	}
+	if( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) ) {
+		perr = iProcess->GetExitCode( &exitcode );
+		assert( perr == CAE_NONE );
+	}
+	command_line = iProcess->GetCommandString();
+
+	// copy into the rv
+	rv.iErrorCode = ERR_NONE;
+	rv.iErrorDetail = 0;
+	rv.iProcessStatus = (int)pstatus;
+	rv.iProcessExitReason = (int)preason;
+	rv.iExitCode = exitcode;
+	STRNCPY_NULL_TERMINATE( rv.iCommandLine, command_line.c_str(), MAXCOMMANDLINE );
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstandardoutput
+ * 
+ ***************************************************************************************/
+TVarData CSHostexecuteasync::getstandardoutput( int aArgs )
+{
+	TVarData rv;
+	TCAProcessError perr;
+	int output_read_count, error_read_count, read_error;
+	string output;
+
+	// since we create in the constructor and stop in the destructor there must be a process
+	assert( iProcess != NULL );
+
+	// poll for new output - ignore errors since there may be some buffered data anyway
+	perr = iProcess->PollProcessForNewOutput( 0, &output_read_count, &error_read_count );
+
+	// now read it into a string
+	output_read_count = iProcess->GetRecordedStandardOutput( &output, &read_error );
+	if( output_read_count == 0 ) {
+	  rv.TVarData_val = NULL;
+	  rv.TVarData_len = 0;
+	  return rv;
+	}
+
+	// copy it into a buffer
+	rv.TVarData_val = (char*)malloc( output.size() + 1 );
+	rv.TVarData_len = output.size() + 1;
+	memcpy( rv.TVarData_val, output.c_str(), output.size() );
+	rv.TVarData_val[output.size()] = 0;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstandarderror
+ * 
+ ***************************************************************************************/
+TVarData CSHostexecuteasync::getstandarderror( int aArgs )
+{
+	TVarData rv;
+	TCAProcessError perr;
+	int output_read_count, error_read_count, read_error;
+	string stderror;
+
+	// since we create in the constructor and stop in the destructor there must be a process
+	assert( iProcess != NULL );
+
+	// poll for new output - ignore errors since there may be some buffered data anyway
+	perr = iProcess->PollProcessForNewOutput( 0, &output_read_count, &error_read_count );
+
+	// now read it into a string
+	error_read_count = iProcess->GetRecordedStandardError( &stderror, &read_error );
+	if( error_read_count == 0 ) {
+	  rv.TVarData_len = 0;
+	  rv.TVarData_val = NULL;
+	  return rv;
+	}
+
+	// copy it into a buffer
+	rv.TVarData_val = (char*)malloc( stderror.size() + 1 );
+	rv.TVarData_len = stderror.size() + 1;
+	memcpy( rv.TVarData_val, stderror.c_str(), stderror.size() );
+	rv.TVarData_val[stderror.size()] = 0;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: StopProcessWithSignal
+ * 
+ ***************************************************************************************/
+TResult CSHostexecuteasync::StopProcessWithSignal( int aSignal )
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// since we create in the constructor and stop in the destructor there must be a process
+	assert( iProcess != NULL );
+
+	// if the process isn't running then it has died outside the scope of this controller, 
+	// clean up the state, return an error since this is noteworthy and should be either 
+	// expected or not happen.
+	perr = iProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+	  assert( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) );
+	  rv.iStandardResult = ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE;
+	  return rv;
+	}
+
+	// request the process to stop
+	perr = iProcess->RequestStop( aSignal );
+	if( perr != CAE_NONE ) {
+	  rv.iStandardResult = ERR_STOP_PROCESS_ERROR;
+	  rv.iExtendedCode = (int)perr;
+	  return rv;
+	}
+
+	// wait for the process to stop
+	perr = iProcess->WaitForProcessToTerminate( -1 );
+	if( perr != CAE_NONE ) {
+	  rv.iStandardResult = ERR_WAIT_PROCESS_ERROR;
+	  rv.iExtendedCode = (int)perr;
+	  return rv;
+	}
+
+	// done - success
+	return rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/CSHostexecuteasync.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Thu Oct 16 14:41:55 2003
+*
+*/
+
+
+
+
+#ifndef __CSHOSTEXECUTEASYNC_H__
+#define __CSHOSTEXECUTEASYNC_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "hostexecuteasync.h"
+#include "../ProcessLibrary/proclib.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSHostexecuteasync
+ * 
+ ***************************************************************************************/
+class CSHostexecuteasync
+{
+public:
+	// Standard Methods
+	CSHostexecuteasync();
+	~CSHostexecuteasync();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+	TResult cstr_startprocess( char *aArgs );
+	TResult dstr_removeprocess( int aArgs, int *aDeleteInstance );
+	TResult killprocess( int aArgs );
+	TResult stopprocess( int aArgs );
+	THostExecuteAsyncProcessInfo getprocessinfo( int aArgs );
+	TVarData getstandardoutput( int aArgs );
+	TVarData getstandarderror( int aArgs );
+
+private:
+	int iKey;
+	CAProcess *iProcess;
+	TResult StopProcessWithSignal( int aSignal );
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/CSvcHostexecuteasync.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Thu Oct 16 14:41:55 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHostexecuteasync.h"
+#include "hostexecuteasync.h"
+
+
+/****************************************************************************************
+ * 
+ * Macro Functions
+ * 
+ ***************************************************************************************/
+#define SET_ERROR_CODE(type_name,member_name,ptr_to_result)    { \
+                                                                 ptr_to_result = (type_name*)aArgs;                    \
+                                                                 memset( ptr_to_result, 0, sizeof(type_name) );        \
+                                                                 ptr_to_result->member_name = aError;                  \
+                                                               }
+
+#define SET_LIST_ERROR_CODE(type_name,ptr_to_result)           { \
+                                                                 assert( aError != ERR_NONE );                         \
+                                                                 ptr_to_result = (type_name*)aArgs;                    \
+                                                                 if( ptr_to_result->type_name##_len != 0 ) {           \
+                                                                   free( ptr_to_result->type_name##_val );             \
+                                                                   ptr_to_result->type_name##_val = NULL;              \
+                                                                   ptr_to_result->type_name##_len = 0;                 \
+                                                                 }                                                     \
+							       }			
+
+
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSHostexecuteasync> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcHostexecuteasync::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	int rv;
+	int *ik_integer;
+
+	switch( aMethod ) {
+
+		// Integer params 
+	case DSTR_REMOVEPROCESS:
+	case KILLPROCESS:
+	case STOPPROCESS:
+	case GETPROCESSINFO:
+	case GETSTANDARDOUTPUT:
+	case GETSTANDARDERROR:
+		ik_integer = (int*)aArgs;
+		rv = *ik_integer;
+		break;
+
+		// Error
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcHostexecuteasync::SetError( int aMethod, void *aArgs, int aError )
+{
+	int rv;
+	TResult *rv_result;
+	THostExecuteAsyncProcessInfo *rv_proc_info;
+	TVarData *rv_vardata;
+	TComponentList *rv_cl;
+
+	switch( aMethod ) {
+
+		// TComponentList
+	case LIST_DEVICES:
+		SET_LIST_ERROR_CODE( TComponentList, rv_cl );
+		break;
+
+		// TResult
+	case CSTR_STARTPROCESS:
+	case DSTR_REMOVEPROCESS:
+	case KILLPROCESS:
+	case STOPPROCESS:
+	    SET_ERROR_CODE( TResult, iStandardResult, rv_result );
+		break;
+
+		// THostExecuteAsyncProcessInfo
+	case GETPROCESSINFO:
+	    SET_ERROR_CODE( THostExecuteAsyncProcessInfo, iErrorCode, rv_proc_info );
+		break;
+
+		// VarData
+	case GETSTANDARDOUTPUT:
+	case GETSTANDARDERROR:
+	    SET_LIST_ERROR_CODE( TVarData, rv_vardata );
+		break;
+
+		// Invalid
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError
+ * 
+ ***************************************************************************************/
+int CSvcHostexecuteasync::GetError( int aMethod, void *aArgs )
+{
+  TResult *result;
+  
+  // check assumption
+  assert( (aMethod == CSTR_STARTPROCESS) || (aMethod == DSTR_REMOVEPROCESS) );
+  
+  // return error code
+  result = (TResult*)aArgs;
+  return result->iStandardResult;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcHostexecuteasync::StartRPCService( CComponentManager<CSHostexecuteasync> *aComponentManager, TStartupInfo *aArg )
+{
+	assert( iComponentManager == NULL );
+	iComponentManager = aComponentManager;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcHostexecuteasync::StopRPCService()
+{
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/CSvcHostexecuteasync.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Thu Oct 16 14:41:55 2003
+*
+*/
+
+
+
+
+#ifndef __CSVCHOSTEXECUTEASYNC_H__
+#define __CSVCHOSTEXECUTEASYNC_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "hostexecuteasync.h"
+#include "CSHostexecuteasync.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcHostexecuteasync
+ * 
+ ***************************************************************************************/
+class CSvcHostexecuteasync
+{
+public:
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSHostexecuteasync> *aComponentManager, TStartupInfo *aArg );
+	static int StopRPCService();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/HostExecute.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,165 @@
+# Microsoft Developer Studio Project File - Name="HostExecute" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=HostExecute - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "HostExecute.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "HostExecute.mak" CFG="HostExecute - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "HostExecute - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "HostExecute - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "HostExecute"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "HostExecute - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "HostExecute - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\ExternalSource\modification_source\oncrpc" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oncrpcms.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\BinInternal" /libpath:"..\..\ExternalSource\binaries"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "HostExecute - Win32 Release"
+# Name "HostExecute - Win32 Debug"
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hostexecuteasync.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hostexecuteasync_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hostexecuteasync_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\hostexecuteasync_xdr.c
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSHostexecuteasync.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSHostexecuteasync.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcHostexecuteasync.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcHostexecuteasync.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# End Group
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hostexecuteasync.x
+
+!IF  "$(CFG)" == "HostExecute - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "HostExecute - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\hostexecuteasync.x
+
+"hostexecuteasync.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BuildTools\rpcgen -server  -component_base -wrapstring hostexecuteasync.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/HostExecute.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "HostExecute"=.\HostExecute.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,38 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../bin/hostexecuteasync
+INCLUDES= 	-I../include
+OBJECTS=	CSHostexecuteasync.o		\
+		CSvcHostexecuteasync.o		\
+		hostexecuteasync_svc.o		\
+		hostexecuteasync_svc_stub_impl.o	\
+		hostexecuteasync_xdr.o		
+
+
+LIBS=		-L../../BinInternal -lproc
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) ../../BinInternal/libproc.a
+	g++ -gstabs -Wall -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ dyntmp*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __HOSTEXECUTEASYNC_H__
+#define __HOSTEXECUTEASYNC_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TComponentList(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TComponentList();
+#endif
+
+#define MAXCOMMANDLINE 1024
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TResult(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TResult();
+#endif
+
+
+struct THostExecuteAsyncProcessInfo {
+	int iErrorCode;
+	int iErrorDetail;
+	char iCommandLine[MAXCOMMANDLINE];
+	int iProcessStatus;
+	int iProcessExitReason;
+	int iExitCode;
+};
+typedef struct THostExecuteAsyncProcessInfo THostExecuteAsyncProcessInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_THostExecuteAsyncProcessInfo(...);
+}
+#else
+bool_t xdr_hostexecuteasync_THostExecuteAsyncProcessInfo();
+#endif
+
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TVarData(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TVarData();
+#endif
+
+
+struct TStartupInfo {
+	int iDummy;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TStartupInfo(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TStartupInfo();
+#endif
+
+
+#define HOSTEXECUTEASYNC ((u_long)0x34630209)
+#define HOSTEXECUTEASYNC_VERSION ((u_long)9)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_9( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_9();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_9( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_9();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_9( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_9();
+#endif /* __cplusplus */
+#define CSTR_STARTPROCESS ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_startprocess_9( char ** arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_startprocess_9();
+#endif /* __cplusplus */
+#define DSTR_REMOVEPROCESS ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *dstr_removeprocess_9( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *dstr_removeprocess_9();
+#endif /* __cplusplus */
+#define KILLPROCESS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *killprocess_9( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *killprocess_9();
+#endif /* __cplusplus */
+#define STOPPROCESS ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopprocess_9( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopprocess_9();
+#endif /* __cplusplus */
+#define GETPROCESSINFO ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern THostExecuteAsyncProcessInfo *getprocessinfo_9( int * arg, CLIENT *cl );
+}
+#else
+extern THostExecuteAsyncProcessInfo *getprocessinfo_9();
+#endif /* __cplusplus */
+#define GETSTANDARDOUTPUT ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getstandardoutput_9( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getstandardoutput_9();
+#endif /* __cplusplus */
+#define GETSTANDARDERROR ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getstandarderror_9( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getstandarderror_9();
+#endif /* __cplusplus */
+
+#endif /* __HOSTEXECUTEASYNC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+
+/*******************************************************************************
+ *
+ * Constants
+ *
+ ******************************************************************************/
+const MAXCOMMANDLINE		= 1024;
+
+
+/*******************************************************************************
+ *
+ * Constants
+ *
+ ******************************************************************************/
+const ERR_WAIT_PROCESS_ERROR			= -103;
+const ERR_START_PROCESS_ERROR			= -105;
+const ERR_STOP_PROCESS_ERROR			= -106;
+const ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE		= -111;
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+
+struct THostExecuteAsyncProcessInfo {
+	int iErrorCode;
+	int iErrorDetail;
+	char iCommandLine[MAXCOMMANDLINE];
+	int iProcessStatus;
+	int iProcessExitReason;
+	int iExitCode;
+};
+typedef opaque TVarData<>;
+
+
+struct TStartupInfo {
+	int iDummy;
+};
+
+/*******************************************************************************
+ *
+ * Interface
+ *
+ ******************************************************************************/
+program HOSTEXECUTEASYNC {
+	version HOSTEXECUTEASYNC_VERSION
+	{
+		/* Initialise the service */
+		int SS_STARTUPRPCSERVICE( TStartupInfo )		= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )				= 2;
+		TComponentList LIST_DEVICES( void )				= 30;
+
+		/* Create instances */
+		TResult CSTR_STARTPROCESS( string )				= 31;
+		TResult DSTR_REMOVEPROCESS( int )				= 32;
+		
+		/* Operate on the instance */
+		TResult KILLPROCESS( int )							= 5;
+		TResult STOPPROCESS( int )							= 6;
+		THostExecuteAsyncProcessInfo GETPROCESSINFO( int )	= 7;
+		TVarData GETSTANDARDOUTPUT( int )					= 8;
+		TVarData GETSTANDARDERROR( int )					= 9;	
+	} = 9; 
+} = 0x34630209;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "hostexecuteasync.h"
+
+static void hostexecuteasync_9();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+	(void)pmap_unset(HOSTEXECUTEASYNC, HOSTEXECUTEASYNC_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, HOSTEXECUTEASYNC, HOSTEXECUTEASYNC_VERSION, hostexecuteasync_9, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (HOSTEXECUTEASYNC, HOSTEXECUTEASYNC_VERSION, udp).\n");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, HOSTEXECUTEASYNC, HOSTEXECUTEASYNC_VERSION, hostexecuteasync_9, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (HOSTEXECUTEASYNC, HOSTEXECUTEASYNC_VERSION, tcp).\n");
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+	exit(1);
+}
+
+static void
+hostexecuteasync_9(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		TStartupInfo ss_startuprpcservice_9_arg;
+		int sc_shutdownrpcservice_9_arg;
+		char *cstr_startprocess_9_arg;
+		int dstr_removeprocess_9_arg;
+		int killprocess_9_arg;
+		int stopprocess_9_arg;
+		int getprocessinfo_9_arg;
+		int getstandardoutput_9_arg;
+		int getstandarderror_9_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_hostexecuteasync_TStartupInfo;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_9;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_9;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_hostexecuteasync_TComponentList;
+		local = (char *(*)()) list_devices_9;
+		break;
+
+	case CSTR_STARTPROCESS:
+		xdr_argument = xdr_wrapstring;
+		xdr_result = xdr_hostexecuteasync_TResult;
+		local = (char *(*)()) cstr_startprocess_9;
+		break;
+
+	case DSTR_REMOVEPROCESS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hostexecuteasync_TResult;
+		local = (char *(*)()) dstr_removeprocess_9;
+		break;
+
+	case KILLPROCESS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hostexecuteasync_TResult;
+		local = (char *(*)()) killprocess_9;
+		break;
+
+	case STOPPROCESS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hostexecuteasync_TResult;
+		local = (char *(*)()) stopprocess_9;
+		break;
+
+	case GETPROCESSINFO:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hostexecuteasync_THostExecuteAsyncProcessInfo;
+		local = (char *(*)()) getprocessinfo_9;
+		break;
+
+	case GETSTANDARDOUTPUT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hostexecuteasync_TVarData;
+		local = (char *(*)()) getstandardoutput_9;
+		break;
+
+	case GETSTANDARDERROR:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hostexecuteasync_TVarData;
+		local = (char *(*)()) getstandarderror_9;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+		exit(1);
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,491 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Thu Oct 16 16:55:08 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHostexecuteasync.h"
+#include "CSHostexecuteasync.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSHostexecuteasync> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_9( TStartupInfo *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSHostexecuteasync>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcHostexecuteasync::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_9( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcHostexecuteasync::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_9( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHostexecuteasync::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startprocess
+ * 
+ ***************************************************************************************/
+TResult *cstr_startprocess_9( char **aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	CSHostexecuteasync *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( CSTR_STARTPROCESS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// create a new component instance
+	instance_key = iComponentManager->CreateInstance();
+	if( instance_key < 0 ) {
+		CSvcHostexecuteasync::SetError( CSTR_STARTPROCESS, (void*)&rv, instance_key );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->cstr_startprocess( *aArgs );
+	result = CSvcHostexecuteasync::GetError( CSTR_STARTPROCESS, (void*)&rv );
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	if( result != ERR_NONE ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == 0 );
+	} else { 
+		CSvcHostexecuteasync::SetError( CSTR_STARTPROCESS, (void*)&rv, instance_key );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeprocess
+ * 
+ ***************************************************************************************/
+TResult *dstr_removeprocess_9( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	int should_delete = 1;
+	CSHostexecuteasync *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( DSTR_REMOVEPROCESS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// get the key for the instance from the args
+	instance_key = CSvcHostexecuteasync::GetInstanceKeyFromArgs( DSTR_REMOVEPROCESS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		CSvcHostexecuteasync::SetError( DSTR_REMOVEPROCESS, (void*)&rv, instance_key );
+		return &rv;
+	}
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHostexecuteasync::SetError( DSTR_REMOVEPROCESS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->dstr_removeprocess( *aArgs, &should_delete );
+
+	result = CSvcHostexecuteasync::GetError( DSTR_REMOVEPROCESS, (void*)&rv );
+
+	// it is illegal for the method to succeed but not delete the instance
+	assert( (result != ERR_NONE) || (should_delete == 1) );
+
+	// delete the instance if requested
+	if( should_delete != 0 ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == ERR_NONE );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: killprocess
+ * 
+ ***************************************************************************************/
+TResult *killprocess_9( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHostexecuteasync *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( KILLPROCESS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHostexecuteasync::SetError( KILLPROCESS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHostexecuteasync::GetInstanceKeyFromArgs( KILLPROCESS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHostexecuteasync::SetError( KILLPROCESS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->killprocess( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopprocess
+ * 
+ ***************************************************************************************/
+TResult *stopprocess_9( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHostexecuteasync *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( STOPPROCESS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHostexecuteasync::SetError( STOPPROCESS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHostexecuteasync::GetInstanceKeyFromArgs( STOPPROCESS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHostexecuteasync::SetError( STOPPROCESS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->stopprocess( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getprocessinfo
+ * 
+ ***************************************************************************************/
+THostExecuteAsyncProcessInfo *getprocessinfo_9( int *aArgs, CLIENT *aDutout )
+{
+	static THostExecuteAsyncProcessInfo rv;
+	int instance_key;
+	CSHostexecuteasync *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( GETPROCESSINFO, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHostexecuteasync::SetError( GETPROCESSINFO, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHostexecuteasync::GetInstanceKeyFromArgs( GETPROCESSINFO, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHostexecuteasync::SetError( GETPROCESSINFO, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getprocessinfo( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstandardoutput
+ * 
+ ***************************************************************************************/
+TVarData *getstandardoutput_9( int *aArgs, CLIENT *aDutout )
+{
+	static TVarData rv;
+	int instance_key;
+	CSHostexecuteasync *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( GETSTANDARDOUTPUT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHostexecuteasync::SetError( GETSTANDARDOUTPUT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHostexecuteasync::GetInstanceKeyFromArgs( GETSTANDARDOUTPUT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHostexecuteasync::SetError( GETSTANDARDOUTPUT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getstandardoutput( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstandarderror
+ * 
+ ***************************************************************************************/
+TVarData *getstandarderror_9( int *aArgs, CLIENT *aDutout )
+{
+	static TVarData rv;
+	int instance_key;
+	CSHostexecuteasync *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecuteasync::SetError( GETSTANDARDERROR, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHostexecuteasync::SetError( GETSTANDARDERROR, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHostexecuteasync::GetInstanceKeyFromArgs( GETSTANDARDERROR, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHostexecuteasync::SetError( GETSTANDARDERROR, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getstandarderror( *aArgs );
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hostexecuteasync.h"
+
+
+bool_t
+xdr_hostexecuteasync_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iStandardResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExtendedCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSystemError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_THostExecuteAsyncProcessInfo(xdrs, objp)
+	XDR *xdrs;
+	THostExecuteAsyncProcessInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iErrorCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iCommandLine, MAXCOMMANDLINE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExitCode)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iDummy)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/CSHostexecute.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Oct 28 11:38:50 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHostexecute.h"
+#include "CSHostexecute.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSHostexecute::CSHostexecute()
+{
+}
+
+CSHostexecute::~CSHostexecute()
+{
+}
+
+int CSHostexecute::GetKey()
+{
+	return iKey;
+}
+
+void CSHostexecute::SetKey( int aKey )
+{
+	iKey = aKey;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/CSHostexecute.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Oct 28 11:38:50 2003
+*
+*/
+
+
+
+
+#ifndef __CSHOSTEXECUTE_H__
+#define __CSHOSTEXECUTE_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "hostexecute.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSHostexecute
+ * 
+ ***************************************************************************************/
+class CSHostexecute
+{
+public:
+	// Standard Methods
+	CSHostexecute();
+	~CSHostexecute();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+
+private:
+	int iKey;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/CSvcHostexecute.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Oct 28 10:15:13 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <errno.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHostexecute.h"
+#include "hostexecute.h"
+#include "../ProcessLibrary/proclib.h"
+#include "../include/standard_service_manager.h"
+#include "../include/strncpynt.h"
+
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSHostexecute> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcHostexecute::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	// this method should never be called
+	assert( !"NOT IMPLEMENTED" );
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcHostexecute::SetError( int aMethod, void *aArgs, int aError )
+{
+	int rv = ERR_NONE;
+	TExecuteResult *rv_execute_result;
+	TComponentList *rv_component_list;
+
+	switch( aMethod ) {
+
+	// TComponentList
+	case LIST_DEVICES:
+		SET_LIST_ERROR_CODE( TComponentList, rv_component_list );
+		break;
+
+	// TExecuteResult
+	case ST_EXECUTECOMMAND:
+		rv_execute_result = (TExecuteResult*)aArgs;
+		if( (rv_execute_result->iStandardOut).TVarData_val != NULL ) {
+			free( (rv_execute_result->iStandardOut).TVarData_val );
+			(rv_execute_result->iStandardOut).TVarData_val = NULL;
+			(rv_execute_result->iStandardOut).TVarData_len = 0;
+		}
+		if( (rv_execute_result->iStandardError).TVarData_val != NULL ) {
+			free( (rv_execute_result->iStandardError).TVarData_val );
+			(rv_execute_result->iStandardError).TVarData_val = NULL;
+			(rv_execute_result->iStandardError).TVarData_len = 0;
+		}
+		memset( rv_execute_result, 0, sizeof(TExecuteResult) );
+		rv_execute_result->iResult = aError;
+		break;
+
+	// Error
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError
+ * 
+ ***************************************************************************************/
+int CSvcHostexecute::GetError( int aMethod, void *aArgs )
+{
+	// this method should never be called
+	assert( !"NOT IMPLEMENTED" );
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcHostexecute::StartRPCService( CComponentManager<CSHostexecute> *aComponentManager, TStartupInfo *aArg )
+{
+	assert( iComponentManager == NULL );
+	iComponentManager = aComponentManager;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcHostexecute::StopRPCService()
+{
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_executecommand
+ * 
+ ***************************************************************************************/
+TExecuteResult CSvcHostexecute::st_executecommand( TExecuteRequest aArgs )
+{
+	TExecuteResult rv;
+	int errcode;
+	CAProcess process;
+	TCAProcessError perr;
+	TProcessExitReason preason;
+	string *standardout = NULL, *standarderror = NULL;
+
+	// init the rv
+	memset( &rv, 0, sizeof(rv) );
+	rv.iResult = ERR_NONE;
+
+	// get the buffers
+	if( aArgs.iRecordStandardOut != 0 ) {
+		standardout = new string();
+		assert( standardout != NULL );
+	} 
+	if( aArgs.iRecordStandartError != 0 ) {
+		standarderror = new string();
+		assert( standarderror != NULL );
+	}
+
+	// execute the process - return any errors
+	perr = process.Execute( aArgs.iCommandLine, &errcode, aArgs.iTimeout, standardout, standarderror );
+	if( perr != CAE_NONE ) {
+		rv.iResult = ERR_EXECUTE_PROCESS_ERROR;
+		rv.iErrorCode = (int)perr;
+		rv.iErrorDetail = errno;
+	}
+
+	// save any output
+	if( (standardout != NULL) && (standardout->length() > 0) ) {
+		rv.iStandardOut.TVarData_val = (char*)malloc( standardout->length() + 1 );
+		rv.iStandardOut.TVarData_len = standardout->length() + 1;
+		STRNCPY_NULL_TERMINATE( rv.iStandardOut.TVarData_val, standardout->c_str(), standardout->length() + 1 );
+	}
+	if( (standarderror != NULL) && (standarderror->length() > 0) ) {
+		rv.iStandardError.TVarData_val = (char*)malloc( standarderror->length() + 1 );
+		rv.iStandardError.TVarData_len = standarderror->length() + 1;
+		STRNCPY_NULL_TERMINATE( rv.iStandardError.TVarData_val, standarderror->c_str(), standarderror->length() + 1 );
+	}
+
+	// if there was an error then return now
+	if( rv.iResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// save the status, exitreason, etc
+	perr = process.GetExitReason( &preason );
+	assert( perr == CAE_NONE );
+	rv.iProcessExitReason = (int)preason;
+	perr = process.GetExitCode( &errcode );
+	assert( perr == CAE_NONE );
+	rv.iProcessExitDetail = errcode;
+	return rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/CSvcHostexecute.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Tue Oct 28 10:15:13 2003
+*
+*/
+
+
+
+
+#ifndef __CSVCHOSTEXECUTE_H__
+#define __CSVCHOSTEXECUTE_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "hostexecute.h"
+#include "CSHostexecute.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcHostexecute
+ * 
+ ***************************************************************************************/
+class CSvcHostexecute
+{
+public:
+	/* standard methods */
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSHostexecute> *aComponentManager, TStartupInfo *aArg );
+	static int StopRPCService();
+
+	/* custom methods */
+	static TExecuteResult st_executecommand( TExecuteRequest aArgs );
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/HostExecute.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,187 @@
+# Microsoft Developer Studio Project File - Name="HostExecute" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=HostExecute - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "HostExecute.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "HostExecute.mak" CFG="HostExecute - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "HostExecute - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "HostExecute - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "HostExecute - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "HostExecute - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../include" /I "../../ExternalSource/modification_source/oncrpc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oncrpcms.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../ExternalSource/binaries"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "HostExecute - Win32 Release"
+# Name "HostExecute - Win32 Debug"
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hostexecute.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hostexecute_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hostexecute_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\hostexecute_xdr.c
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSHostexecute.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSHostexecute.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcHostexecute.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcHostexecute.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_service_manager.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_unix.h
+# End Source File
+# End Group
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hostexecute.x
+
+!IF  "$(CFG)" == "HostExecute - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "HostExecute - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\hostexecute.x
+
+"hostexecute.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BuildTools\rpcgen -server -component_mod_component_impl -component_base -wrapstring hostexecute.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib_linux.cpp
+
+!IF  "$(CFG)" == "HostExecute - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "HostExecute - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/HostExecute.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "HostExecute"=.\HostExecute.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../bin/hostexecute
+INCLUDES= 	-I../include
+OBJECTS=	CSHostexecute.o		\
+		CSvcHostexecute.o	\
+		hostexecute_svc.o	\
+		hostexecute_svc_stub_impl.o	\
+		hostexecute_xdr.o
+
+
+
+LIBS=		-L../../BinInternal -lproc
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) ../../BinInternal/libproc.a
+	g++ -gstabs -Wall -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ dyntmp*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __HOSTEXECUTE_H__
+#define __HOSTEXECUTE_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TComponentList(...);
+}
+#else
+bool_t xdr_hostexecute_TComponentList();
+#endif
+
+#define MAXCOMMANDLINE 1024
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_SET_SIGNAL_ERROR -120
+#define ERR_EXECUTE_PROCESS_ERROR -122
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TVarData(...);
+}
+#else
+bool_t xdr_hostexecute_TVarData();
+#endif
+
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TStartupInfo(...);
+}
+#else
+bool_t xdr_hostexecute_TStartupInfo();
+#endif
+
+
+struct TExecuteRequest {
+	char iCommandLine[MAXCOMMANDLINE];
+	int iRecordStandardOut;
+	int iRecordStandartError;
+	int iTimeout;
+};
+typedef struct TExecuteRequest TExecuteRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TExecuteRequest(...);
+}
+#else
+bool_t xdr_hostexecute_TExecuteRequest();
+#endif
+
+
+struct TExecuteResult {
+	int iResult;
+	int iErrorCode;
+	int iErrorDetail;
+	int iProcessExitReason;
+	int iProcessExitDetail;
+	TVarData iStandardOut;
+	TVarData iStandardError;
+};
+typedef struct TExecuteResult TExecuteResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TExecuteResult(...);
+}
+#else
+bool_t xdr_hostexecute_TExecuteResult();
+#endif
+
+
+#define HOSTEXECUTE ((u_long)0x34630203)
+#define HOSTEXECUTE_VERSION ((u_long)3)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_3( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_3();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_3( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_3();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_3( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_3();
+#endif /* __cplusplus */
+#define ST_EXECUTECOMMAND ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TExecuteResult *st_executecommand_3( TExecuteRequest * arg, CLIENT *cl );
+}
+#else
+extern TExecuteResult *st_executecommand_3();
+#endif /* __cplusplus */
+
+#endif /* __HOSTEXECUTE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+
+/*******************************************************************************
+ *
+ * Constants
+ *
+ ******************************************************************************/
+const MAXCOMMANDLINE		= 1024;
+
+
+/*******************************************************************************
+ *
+ * Error codes
+ *
+ ******************************************************************************/
+const ERR_WAIT_PROCESS_ERROR					= -103;
+const ERR_START_PROCESS_ERROR					= -105;
+const ERR_STOP_PROCESS_ERROR					= -106;
+const ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE		= -111;
+const ERR_SET_SIGNAL_ERROR						= -120;
+const ERR_EXECUTE_PROCESS_ERROR					= -122;
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef opaque TVarData<>;
+
+struct TStartupInfo {
+	int iEmpty;
+};
+
+struct TExecuteRequest {
+	char iCommandLine[MAXCOMMANDLINE];
+	int iRecordStandardOut;
+	int iRecordStandartError;
+	int iTimeout;
+};
+
+struct TExecuteResult {
+	int iResult;
+	int iErrorCode;
+	int iErrorDetail;
+	int iProcessExitReason;
+	int iProcessExitDetail;
+	TVarData iStandardOut;
+	TVarData iStandardError;	
+};
+
+
+/*******************************************************************************
+ *
+ * Interface
+ *
+ ******************************************************************************/
+program HOSTEXECUTE {
+	version HOSTEXECUTE_VERSION
+	{
+		/* Service Management */
+		int SS_STARTUPRPCSERVICE( TStartupInfo )		= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )				= 2;
+		TComponentList LIST_DEVICES( void )				= 30;
+
+		/* Custom Interface */
+		TExecuteResult ST_EXECUTECOMMAND( TExecuteRequest ) = 3;
+	} = 3;
+} =0x34630203;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "hostexecute.h"
+
+static void hostexecute_3();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+	(void)pmap_unset(HOSTEXECUTE, HOSTEXECUTE_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, HOSTEXECUTE, HOSTEXECUTE_VERSION, hostexecute_3, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (HOSTEXECUTE, HOSTEXECUTE_VERSION, udp).\n");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, HOSTEXECUTE, HOSTEXECUTE_VERSION, hostexecute_3, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (HOSTEXECUTE, HOSTEXECUTE_VERSION, tcp).\n");
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+	exit(1);
+}
+
+static void
+hostexecute_3(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		TStartupInfo ss_startuprpcservice_3_arg;
+		int sc_shutdownrpcservice_3_arg;
+		TExecuteRequest st_executecommand_3_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_hostexecute_TStartupInfo;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_3;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_3;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_hostexecute_TComponentList;
+		local = (char *(*)()) list_devices_3;
+		break;
+
+	case ST_EXECUTECOMMAND:
+		xdr_argument = xdr_hostexecute_TExecuteRequest;
+		xdr_result = xdr_hostexecute_TExecuteResult;
+		local = (char *(*)()) st_executecommand_3;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+		exit(1);
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Tue Oct 28 11:38:50 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHostexecute.h"
+#include "CSHostexecute.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSHostexecute> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_3( TStartupInfo *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSHostexecute>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcHostexecute::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_3( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcHostexecute::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_3( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecute::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHostexecute::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_executecommand
+ * 
+ ***************************************************************************************/
+TExecuteResult *st_executecommand_3( TExecuteRequest *aArgs, CLIENT *aDutout )
+{
+	static TExecuteResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHostexecute::SetError( ST_EXECUTECOMMAND, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcHostexecute::st_executecommand( *aArgs );
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hostexecute.h"
+
+
+bool_t
+xdr_hostexecute_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TExecuteRequest(xdrs, objp)
+	XDR *xdrs;
+	TExecuteRequest *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iCommandLine, MAXCOMMANDLINE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRecordStandardOut)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRecordStandartError)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TExecuteResult(xdrs, objp)
+	XDR *xdrs;
+	TExecuteResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_hostexecute_TVarData(xdrs, &objp->iStandardOut)) {
+		return (FALSE);
+	}
+	if (!xdr_hostexecute_TVarData(xdrs, &objp->iStandardError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/IntegerAllocatorLibrary/CIntegerAllocator.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CIntegerAllocator.h"
+
+
+/*******************************************************************************
+ *
+ * Implementation
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: AddToIntegerPool
+ *
+ ******************************************************************************/
+int CIntegerAllocator::AddToIntegerPool( int aStart, int aEnd )
+{
+	int i, err;
+
+	// numbers must be positive 
+	if( aStart > aEnd ) {
+	  return -1;
+	}
+	if( aStart < 0 ) {
+	  return -1;
+	}
+
+	// add each integer in the range, as long as it doesn't already
+	// exist in the list
+	for( i = aStart; i <= aEnd; i++ ) {
+		err = DoesIntegerAlreadyAppear( i );
+		if( err == 0 ) {
+			iList.push_back( i );
+		}
+	}
+
+	// done
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: AllocateInteger
+ *
+ ******************************************************************************/
+int CIntegerAllocator::AllocateInteger()
+{
+	int rv;
+	vector<int>::iterator iter;
+
+	// check that there is a free integer
+	if( iList.empty() ) {
+		return -1;
+	}
+
+	// get the integer and delete it
+	iter = iList.begin();
+	rv = *iter;
+	iList.erase( iter );
+
+	// return the allocated integer
+	return rv;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: FreeInteger
+ *
+ ******************************************************************************/
+int CIntegerAllocator::FreeInteger( int aFreeInteger )
+{
+	// check that the number isn't already there
+	assert( DoesIntegerAlreadyAppear(aFreeInteger) == 0 );
+
+	// add the integer back to the list
+	iList.push_back( aFreeInteger );
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE METHOD: DoesIntegerAlreadyAppear
+ *
+ ******************************************************************************/
+int CIntegerAllocator::DoesIntegerAlreadyAppear( int aInteger )
+{
+	vector<int>::iterator iter;
+
+	// search the vector for a match
+	for( iter = iList.begin(); iter != iList.end(); iter++ ) {
+		if( *iter == aInteger ) {
+			return 1;
+		}
+	}
+
+	// done - not found
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/IntegerAllocatorLibrary/CIntegerAllocator.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CIntegerAllocator
+*
+*/
+
+
+
+#ifndef __CINTEGERALLOCATOR_H__
+#define __CINTEGERALLOCATOR_H__
+
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <vector>
+using namespace std;
+
+
+/*******************************************************************************
+ *
+ * CIntegerAllocator
+ *
+ ******************************************************************************/
+class CIntegerAllocator
+{
+public:
+	int AddToIntegerPool( int aStart, int aEnd );
+	int AllocateInteger();
+	int FreeInteger( int aFreeInteger );
+
+private:
+	int DoesIntegerAlreadyAppear( int aInteger );
+
+	vector<int> iList;
+	int iListSize;
+};
+
+
+#endif //__CINTEGERALLOCATOR_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/IntegerAllocatorLibrary/IntegerAllocatorLibrary.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,100 @@
+# Microsoft Developer Studio Project File - Name="IntegerAllocatorLibrary" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=IntegerAllocatorLibrary - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "IntegerAllocatorLibrary.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "IntegerAllocatorLibrary.mak" CFG="IntegerAllocatorLibrary - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "IntegerAllocatorLibrary - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "IntegerAllocatorLibrary - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "IntegerAllocatorLibrary - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "IntegerAllocatorLibrary - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libintalloc.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "IntegerAllocatorLibrary - Win32 Release"
+# Name "IntegerAllocatorLibrary - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CIntegerAllocator.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CIntegerAllocator.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/IntegerAllocatorLibrary/IntegerAllocatorLibrary.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "IntegerAllocatorLibrary"=.\IntegerAllocatorLibrary.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/IntegerAllocatorLibrary/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../BinInternal/libintalloc.a
+INCLUDES=
+CFLAGS=		-Wall -gstabs #-ftest-coverage -fprofile-arcs
+OBJECTS=	CIntegerAllocator.o
+LIBS=
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS)
+	ar -rcs $(TARGET) $(OBJECTS)
+
+%.o:	%.c
+	gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ *.bbg *.bb *.gcov *.da 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CDatalinkNull.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "MTInterfaces.h"
+#include "CDatalinkNull.h"
+
+
+/*******************************************************************************
+ *
+ * Constructor - init state vars
+ *
+ ******************************************************************************/
+CDatalinkNull::CDatalinkNull( TPhoneData *aPhoneData, CLog *aLog )
+{
+	// check params
+	assert( aPhoneData != NULL );
+	assert( aLog != NULL );
+
+	// initialise members
+	iAirInterface = NULL;
+	iTEChannel = NULL;
+	iPhoneData = aPhoneData;
+	iLog = aLog;
+}
+
+
+CDatalinkNull::~CDatalinkNull()
+{
+//	assert( iAirInterface == NULL );
+//	assert( iTEChannel == NULL );
+}
+
+
+/*******************************************************************************
+ *
+ * Access methods
+ *
+ ******************************************************************************/
+void CDatalinkNull::SetAirInterface( IAirInterface *aAirInterface )
+{
+	iAirInterface = aAirInterface;
+}
+
+
+void CDatalinkNull::SetTEChannel( ITEChannel *aTEChannel )
+{
+	iTEChannel = aTEChannel;
+}
+
+
+/*******************************************************************************
+ *
+ * Process data from the TEChannel
+ *
+ ******************************************************************************/
+TDataPathError CDatalinkNull::ProcessTEData( char *data, int len, int *aErrCode )
+{
+	TDataPathError err;
+
+	// if no air-interface exists then return error
+	if( iAirInterface == NULL ) {
+		return DPE_NO_AIR_INTERFACE;
+	}
+
+	// otherwise forward the data
+	err = iAirInterface->SendPacket( data, len, aErrCode );
+	return err;
+}
+
+
+TDataPathError CDatalinkNull::ProcessUUData( char *data, int len, int *aErrCode )
+{
+	TDataPathError err; 
+
+	// if no te-channel exists then return an error
+	if( iTEChannel == NULL ) {
+		return DPE_NO_TE_CHANNEL;
+	}
+
+	// otherwise forward the data
+	err = iTEChannel->SendPacket( data, len, aErrCode );
+	return err;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CDatalinkNull.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CDatalinkNull
+* This datalink layer simply forwards data synchronously between the techannel
+* and the air interface with no buffering or processing (except maybe some 
+* filters attached to the module).
+*
+*/
+
+
+
+#ifndef __CDATALINKNULL_H__
+#define __CDATALINKNULL_H__
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "MTInterfaces.h"
+#include "CLog.h"
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CDatalinkNull : public IProcessData
+{
+public:
+	// Construction and Access
+	CDatalinkNull( TPhoneData *aPhoneData, CLog *aLog );
+	virtual ~CDatalinkNull();
+
+	// IProcessData
+	virtual TDataPathError ProcessTEData( char *data, int len, int *aErrCode );
+	virtual TDataPathError ProcessUUData( char *data, int len, int *aErrCode );
+	void SetAirInterface( IAirInterface *aAirInterface );
+	void SetTEChannel( ITEChannel *aTEChannel );
+
+private:
+	IAirInterface *iAirInterface;
+	ITEChannel *iTEChannel;
+	TPhoneData *iPhoneData;
+	CLog *iLog;
+};
+
+#endif //__CDATALINKNULL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CDatalinkPacketise.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CDatalinkPacketise.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * Constructor - init state vars
+ *
+ ******************************************************************************/
+CDatalinkPacketise::CDatalinkPacketise( TPhoneData *aPhoneData, CLog *aLog ) : iIncomingFrame("CDatalinkPacketise::IncomingFrame"), iOutgoingFrame("CDatalinkPacketise::OutgoingFrame")
+{
+	// check params
+	assert( aPhoneData != NULL );
+	assert( aLog != NULL );
+
+	// set state
+	iAirInterface = NULL;
+	iTEChannel = NULL;
+	iPhoneData = aPhoneData;
+	iLog = aLog;
+}
+
+
+CDatalinkPacketise::~CDatalinkPacketise()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * Access methods
+ *
+ ******************************************************************************/
+void CDatalinkPacketise::SetAirInterface( IAirInterface *aAirInterface )
+{
+	iAirInterface = aAirInterface;
+}
+
+void CDatalinkPacketise::SetTEChannel( ITEChannel *aTEChannel )
+{
+	iTEChannel = aTEChannel;
+}
+
+
+/*******************************************************************************
+ *
+ * Process data from the TEChannel
+ *
+ ******************************************************************************/
+TDataPathError CDatalinkPacketise::ProcessTEData( char *data, int len, int *aErrCode )
+{
+//	int i;
+	int errcode;
+//	int frame_size;
+//	char *frame_pointer;
+//	TFrameError ferr;
+//	TFrameStatus fstatus;
+	TDataPathError derr = DPE_NONE;
+
+	// check the params
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+		
+	// check that there is an air interface - not an error if not
+	if( iAirInterface == NULL ) {
+		return DPE_NONE;
+	}
+
+	// do not packetise the incoming interface
+	derr = iAirInterface->SendPacket( data, len, &errcode );
+	if( derr != DPE_NONE ) {
+		iLog->WriteLogEntry( SV_WARNING, "CDatalinkPacketise::ProcessTEData", "SendPacket returned error", derr, errcode );
+	}
+	return DPE_NONE;
+
+#if 0
+	// process each byte
+	for( i = 0; i < len; i++ ) {
+
+		// add the byte to the frame
+		ferr = iOutgoingFrame.AddByteToFrame( data[i] );
+
+		// if this overflows the buffer then we send whatever is in the frame and then add it again
+		if( ferr == FE_OVERFLOW ) {
+			frame_pointer = iOutgoingFrame.GetFrameBuffer( &frame_size );
+			derr = iAirInterface->SendPacket( frame_pointer, frame_size, &errcode );
+			if( derr != DPE_NONE ) {
+				iLog->WriteLogEntry( SV_WARNING, "CDatalinkPacketise::ProcessTEData", "SendPacket returned error", derr, errcode );
+			}
+			ferr = iOutgoingFrame.ClearFrameMemoryButNotState();
+			assert( ferr == FE_NONE );
+			ferr = iOutgoingFrame.AddByteToFrame( data[i] );
+			assert( ferr == FE_NONE );
+			continue;
+		}
+
+		// if the add was successful then check to see if the frame is complete and send it if it is
+		fstatus = iOutgoingFrame.GetFrameStatus();
+		if( fstatus == FS_COMPLETE ) {
+			frame_pointer = iOutgoingFrame.GetFrameBuffer( &frame_size );
+			derr = iAirInterface->SendPacket( frame_pointer, frame_size, &errcode );
+			if( derr != DPE_NONE ) {
+				iLog->WriteLogEntry( SV_WARNING, "CDatalinkPacketise::ProcessTEData", "SendPacket returned error", derr, errcode );
+			}
+			iOutgoingFrame.ClearFrame();
+		}
+	}
+#endif 
+	// done
+	return DPE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * Process data from the UU interface
+ *
+ ******************************************************************************/
+TDataPathError CDatalinkPacketise::ProcessUUData( char *data, int len, int *aErrCode )
+{
+	int i, errcode;
+	int frame_size;
+	char *frame_pointer;
+	TFrameError ferr;
+	TFrameStatus fstatus;
+	TDataPathError derr = DPE_NONE;
+
+	// check the params
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+		
+	// check that there is an air interface - it is not unexpected or problematic if the
+	// channel is not defined so this is not an error.
+	if( iTEChannel == NULL ) {
+		return DPE_NONE;
+	}
+
+	// process each byte 
+	for( i = 0; i < len; i++ ) {
+
+		// add the byte to the frame
+		ferr = iIncomingFrame.AddByteToFrame( data[i] );
+
+		// if this overflows the buffer then we send whatever is in the frame and then add it again
+		if( ferr == FE_OVERFLOW ) {
+			frame_pointer = iIncomingFrame.GetFrameBuffer( &frame_size );
+			derr = iTEChannel->SendPacket( frame_pointer, frame_size, &errcode );
+			if( derr != DPE_NONE ) {
+				iLog->WriteLogEntry( SV_WARNING, "CDatalinkPacketise::ProcessTEData", "SendPacket returned error", derr, errcode );
+			}
+			ferr = iIncomingFrame.ClearFrameMemoryButNotState();
+			assert( ferr == FE_NONE );
+			ferr = iIncomingFrame.AddByteToFrame( data[i] );
+			assert( ferr == FE_NONE );
+			continue;
+		}
+
+		// get the frame status -- if the frame is complete then send it
+		fstatus = iIncomingFrame.GetFrameStatus();
+		if( fstatus == FS_COMPLETE ) {
+			frame_pointer = iIncomingFrame.GetFrameBuffer( &frame_size );
+			derr = iTEChannel->SendPacket( frame_pointer, frame_size, &errcode );
+			if( derr != DPE_NONE ) {
+				iLog->WriteLogEntry( SV_WARNING, "CDatalinkPacketise::ProcessUUData", "SendPacket returned an error", derr, errcode );
+			}
+			iIncomingFrame.ClearFrame();
+		}
+	}
+
+	// done
+	return DPE_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CDatalinkPacketise.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CDatalinkPacketise
+* CDMA has no datalink protocol in the MT -- however -- since the incoming data 
+* is from a stream and I'd like to at least have the ability to force whole frames
+* to be lost -- I'm making a packetisation handler so that the outgoing UDP
+* packets can contain exactly one PPP frame. Incoming data is not altered.
+*
+*/
+
+
+
+#ifndef __CDATALINKPACKETISE_H__
+#define __CDATALINKPACKETISE_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "MTInterfaces.h"
+#include "CPppFrame.h"
+#include "CLog.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CDatalinkPacketise : public IProcessData
+{
+public:
+	// Construction and Access
+	CDatalinkPacketise( TPhoneData *aPhoneData, CLog *aLog );
+	virtual ~CDatalinkPacketise();
+
+	// IProcessData
+	virtual TDataPathError ProcessTEData( char *data, int len, int *aErrCode );
+	virtual TDataPathError ProcessUUData( char *data, int len, int *aErrCode );
+	virtual void SetAirInterface( IAirInterface *aAirInterface );
+	virtual void SetTEChannel( ITEChannel *aTEChannel );
+
+private:
+	IAirInterface *iAirInterface;
+	ITEChannel *iTEChannel;
+	TPhoneData *iPhoneData;
+	CLog *iLog;
+
+	CPppFrame iIncomingFrame;
+	CPppFrame iOutgoingFrame;
+};
+
+#endif //__CDATALINKPACKETISE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CLog.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CLog.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define  MIN(a,b)					(((a) < (b)) ? (a) : (b))
+#define  PRINT_ENTRY_PREFIX_LEN		16
+#define  PRINT_ENTRY_SEPARATOR		(" - ")
+#define  PRINT_ENTRY_SEPARATOR_LEN	3
+#define  MAXLINESIZE				(PRINT_ENTRY_PREFIX_LEN + PRINT_ENTRY_SEPARATOR_LEN + MAXWHOSIZE + MAXMSGSIZE)
+#ifndef WIN32
+#define _snprintf snprintf
+#endif
+
+/*******************************************************************************
+ *
+ * Statics
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * Implementation
+ *
+ ******************************************************************************/
+CLog::CLog( int aFileBacked )
+{
+	assert( aFileBacked == 0 );
+	iLogVector = 0xFFFFFFFF;
+}
+
+
+void CLog::WriteLogEntry( TSeverity aSeverity, char *aWho, char *aMsg )				 
+{
+	TLogEntry entry;
+	int slen;
+
+	// copy message into struct
+	memset( &entry, 0, sizeof(entry) );
+	entry.iSeverity = aSeverity;
+	slen = strlen(aWho);
+	slen = MIN( slen, (MAXWHOSIZE-1) );
+	memcpy( entry.iWho, aWho, slen );
+	slen = strlen(aMsg);
+	slen = MIN( slen, (MAXMSGSIZE-1) );
+	memcpy( entry.iMsg, aMsg, slen );
+
+	// now add it to the vector
+	iLogEntries.push_back( entry );
+}
+
+
+void CLog::WriteLogEntry( TSeverity aSeverity, char *aWho, char *aErrorLocation, int aErrorA, int aErrorB )
+{
+	char buff[MAXMSGSIZE];
+	_snprintf( buff, MAXMSGSIZE, "%s (%d, %d)", aErrorLocation, aErrorA, aErrorB );
+	WriteLogEntry( aSeverity, aWho, buff );
+}
+
+
+void CLog::SetLogLevel( int aLogVector )
+{
+	iLogVector = aLogVector;
+}
+
+
+char *CLog::GetSeverityString( TSeverity aSeverity )
+{
+	switch( aSeverity ) {
+
+	case SV_INFO:
+		return "Info: ";
+
+	case SV_WARNING:
+		return "Warning: ";
+
+	case SV_ERROR:
+		return "Error: ";
+
+	case SV_RESOURCE:
+		return "Resource: ";
+
+	case SV_STATE:
+		return "State: ";
+
+	default:
+		return "Unknown: ";
+	}
+
+	// should never get here
+	assert( !"INVALID CODE PATH" );
+	return NULL;
+}
+
+
+int CLog::CalculateLogSize()
+{
+	char *severity_string;
+	char cline[MAXLINESIZE];
+	int log_size = 0;
+
+	vector<TLogEntry>::iterator iter;
+	for( iter = iLogEntries.begin(); iter != iLogEntries.end(); iter++ ) {
+		severity_string = GetSeverityString( iter->iSeverity );
+		sprintf( cline, "%s%s%s%s\n", severity_string, iter->iWho, PRINT_ENTRY_SEPARATOR, iter->iMsg );
+		log_size += strlen(cline);
+	}
+	log_size++;
+	return log_size;
+}
+
+
+void CLog::PrintLogToBuffer( int aBufferSize, char *aBuffer )
+{
+	char cline[MAXLINESIZE];
+	vector<TLogEntry>::iterator iter;
+	int slen, remaining_space;
+	char *severity_string;
+
+	// init params
+	assert( aBufferSize > 0 );
+	assert( aBuffer != NULL );
+
+	// init
+	aBuffer[0] = 0;
+	remaining_space = aBufferSize;
+
+	// process each entry 
+	for( iter = iLogEntries.begin(); iter != iLogEntries.end(); iter++ ) {
+
+		// print the line to the temp buffer
+		severity_string = GetSeverityString( iter->iSeverity );
+		sprintf( cline, "%s%s%s%s\n", severity_string, iter->iWho, PRINT_ENTRY_SEPARATOR, iter->iMsg );
+	
+		// check there is room left in the passed buffer
+		slen = strlen(cline);
+		if( remaining_space <= slen ) {
+			break;
+		}
+
+		// otherwise 
+		strcat( aBuffer, cline );
+		remaining_space -= slen;
+	}
+
+	// done
+	return;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CLog.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CLog
+* Log class used by the MT. All objects use the same instance.
+*
+*/
+
+
+
+#ifndef __CLOG_H__
+#define __CLOG_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <stdio.h>
+#include <vector>
+using namespace std;
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXWHOSIZE	(128)
+#define MAXMSGSIZE	(256)
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef enum
+{
+	SV_INFO			= 1,
+	SV_WARNING		= 2,
+	SV_ERROR		= 4,
+	SV_RESOURCE		= 8,
+	SV_STATE		= 16,
+} TSeverity;
+
+typedef struct {
+	TSeverity iSeverity;
+	char iWho[MAXWHOSIZE];
+	char iMsg[MAXMSGSIZE];
+} TLogEntry;
+
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CLog
+{
+public:
+	CLog( int aFileBacked = 0 );
+	void WriteLogEntry( TSeverity aSeverity, char *aWho, char *aMsg );
+	void WriteLogEntry( TSeverity aSeverity, char *aWho, char *aErrorLocation, int aErrorA, int aErrorB );
+	void SetLogLevel( int aLogVector );
+	char *GetSeverityString( TSeverity aSeverity );
+	int CalculateLogSize();
+	void PrintLogToBuffer( int aBufferSize, char *aBuffer );
+
+private:
+	FILE *iLogFile;
+	int iLogVector;
+	vector<TLogEntry> iLogEntries;
+};
+
+#endif //__CLOG_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CLogPPPFilter.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,268 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CLOGPPPFILTER
+* Prints out the details of all PPP frames that pass through the MT.
+* System Includes
+*
+*/
+
+
+
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <netinet/in.h>
+#endif
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CLogPPPFilter.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAX_LCP_MESSAGE_ID		11
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+#define EXTRACT_SHORT(ptr)     (htons((*((short*)(ptr)))&0x0000FFFF))
+#define EXTRACT_CHAR(ptr)      ((0x000000FF)&(ptr))
+
+
+/*******************************************************************************
+ *
+ * Static vars
+ *
+ ******************************************************************************/
+static char *lcp_message_desc[] = { "(invalid)", "Configure-Request", "Configure-Ack", "Configure-Nack",
+									"Configure-Reject", "Terminate-Request", "Terminate-Ack", "Code-Reject", 
+									"Protocol-Reject", "Echo-Request", "Echo-Reply", "Discard-Request", NULL };
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: Constructor
+ *
+ ******************************************************************************/
+CLogPppFilter::CLogPppFilter( TPhoneData *aPhoneData, CLog *aLog ) : iOutgoingFrame("PPP-Log::OutgoingFrame",1), iIncomingFrame("PPP-Log::IncomingFrame",1)
+{
+	// check params
+	assert( aPhoneData != NULL );
+	assert( aLog != NULL );
+
+	//set state
+	iPhoneData = aPhoneData;
+	iLog = aLog;
+	iIncomingFrameOverflowFlag = 0;
+	iOutgoingFrameOverflowFlag = 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: Destructor
+ *
+ ******************************************************************************/
+CLogPppFilter::~CLogPppFilter()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: IFilter Interface Methods
+ *
+ ******************************************************************************/
+
+int CLogPppFilter::ProcessIncomingData( char *data, int len )
+{
+	int i;
+	for( i = 0; i < len; i++ ) {
+		ProcessByte( &iIncomingFrame, data[i], &iIncomingFrameOverflowFlag );
+	}
+	return 0;
+}
+
+
+int CLogPppFilter::ProcessOutgoingData( char *data, int len )
+{
+	int i;
+	for( i = 0; i < len; i++ ) {
+		ProcessByte( &iOutgoingFrame, data[i], &iOutgoingFrameOverflowFlag );
+	}
+	return 0;
+}
+
+
+void CLogPppFilter::ProcessByte( CPppFrame *aFrame, char c, int *iOverflowFlag )
+{
+	char *framedesc;
+	TFrameError ferr;
+	TFrameStatus fstatus;
+
+	// add the byte to the frame buffer
+	ferr = aFrame->AddByteToFrame( c );
+
+	// if this causes an overflow then log the warning and return
+	if( ferr == FE_OVERFLOW ) {
+		if( *iOverflowFlag == 0 ) {
+			iLog->WriteLogEntry( SV_WARNING, aFrame->GetFrameName(), "Frame overflow." );
+			*iOverflowFlag = 1;
+		}
+		return;
+	}
+	assert( ferr == FE_NONE );
+
+	// if the frame isn't completed then return
+	fstatus = aFrame->GetFrameStatus();
+	if( fstatus != FS_COMPLETE ) {
+		return;
+	}
+
+	// otherwise print a record about the frame and then clear it
+	framedesc = CreateFrameDescription( aFrame );
+	iLog->WriteLogEntry( SV_INFO, aFrame->GetFrameName(), framedesc );
+	aFrame->ClearFrame();
+	*iOverflowFlag = 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE METHOD: Create FrameDescription
+ *
+ * Protocol [Message Type] (Frame Size)
+ *   IPCP (21)
+ *   LCP Echo-Request (48)
+ *
+ ******************************************************************************/
+char *CLogPppFilter::CreateFrameDescription( CPppFrame *aFrame )
+{
+	char *frame_ptr;
+	int frame_size;
+	int protocol_id;
+	char *bptr;
+
+	// get the frame
+	frame_ptr = aFrame->GetFrameBuffer( &frame_size );
+
+	// clear the description buffer
+	iFrameDescription[0] = 0;
+
+	// now insert the protocol and message if appropriate
+	protocol_id = AddProtocolName( frame_ptr, frame_size );
+
+	// add the length
+	bptr = &(iFrameDescription[strlen(iFrameDescription)]);
+	sprintf( bptr, "(%d).", frame_size );
+
+	// done
+	return iFrameDescription;
+}
+
+
+/*****************************************************************************************
+ *
+ * PRIVATE METHOD: AddProtocolName 
+ *
+ ****************************************************************************************/
+int CLogPppFilter::AddProtocolName( char *aFrameBuffer, int aFrameSize )
+{
+	int protocol_id;
+	int datapos = 0;
+	char *ptr;
+	int message_type;
+
+	// find the position of the protocol field (packet format can change a fair bit)
+	if( aFrameBuffer[0] == 0x7E ) {
+		datapos++;
+	    if( aFrameBuffer[1] == ((char)0x000000FF) ) {
+			datapos++;
+			if( aFrameBuffer[2] == 0x03 ) {
+				datapos++;
+			}
+		}
+	} 
+
+	// get the protocol id and the target pointer
+	protocol_id = EXTRACT_SHORT(&aFrameBuffer[datapos]);
+	ptr = &(iFrameDescription[strlen(iFrameDescription)]);
+	message_type = EXTRACT_CHAR(aFrameBuffer[datapos+2]);
+
+	// now print the protocol name
+	switch( protocol_id ) {
+	case 0xc021:
+		sprintf( ptr, "LCP " );
+		AddLcpMessageTypeString( message_type );
+		break;
+
+	case 0xc023:
+		sprintf( ptr, "PAP " );
+	    break;
+
+	case 0x8021:
+		sprintf( ptr, "IPCP " );
+	    break;
+
+	case 0x80FD:
+		sprintf( ptr, "CCP " );
+	    break;
+
+	default:
+		sprintf( ptr, "0x%X ", protocol_id );
+		protocol_id = 0;
+	    break;
+	}
+
+	// return the protocol id
+	return protocol_id;
+}
+
+
+/*****************************************************************************************
+ *
+ * PRIVATE METHOD: AddLcpMessageTypeString
+ *
+ ****************************************************************************************/   
+void CLogPppFilter::AddLcpMessageTypeString( int aMessageType )
+{
+	char *bptr;
+
+	// get the ptr to the output buffer
+	bptr = &(iFrameDescription[strlen(iFrameDescription)]);
+
+	// make sure the message id is known
+	if( (aMessageType <= 0) || (aMessageType >=  MAX_LCP_MESSAGE_ID) ) {
+		sprintf( bptr, "0x%X ", aMessageType );
+		return;
+	}
+
+	// print the name of the 
+	sprintf( bptr, lcp_message_desc[aMessageType] );
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CLogPPPFilter.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CLOGPPPFILTER
+* Prints out the details of all PPP frames that pass through the MT.
+*
+*/
+
+
+
+#ifndef __CLOGPPPFILTER_H__
+#define __CLOGPPPFILTER_H__
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "MTInterfaces.h"
+#include "CLog.h"
+#include "CPppFrame.h"
+
+
+/*******************************************************************************
+ *
+ * Definition
+ *
+ ******************************************************************************/
+#define MAXFRAMEDESCRIPTION	1024
+
+
+ /*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CLogPppFilter : public IFilter
+{
+public:
+	CLogPppFilter( TPhoneData *aPhoneData, CLog *aLog );
+	virtual ~CLogPppFilter();
+	virtual int ProcessIncomingData( char *data, int len );
+	virtual int ProcessOutgoingData( char *data, int len );
+	
+private:
+	void ProcessByte( CPppFrame *aFrame, char c, int *iOverflowFlag );
+	char *CreateFrameDescription( CPppFrame *aFrame );
+	int AddProtocolName( char *aFrameBuffer, int aFrameSize );
+	void AddLcpMessageTypeString( int aMessageType );
+
+	TPhoneData *iPhoneData;
+	CLog *iLog;
+	CPppFrame iOutgoingFrame;
+	CPppFrame iIncomingFrame;
+	char iFrameDescription[MAXFRAMEDESCRIPTION];
+	int iOutgoingFrameOverflowFlag;
+	int iIncomingFrameOverflowFlag;
+};
+
+#endif //__CLOGPPPFILTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CPhone.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,593 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#ifndef WIN32
+#include <pthread.h>
+#include <unistd.h>
+#include <errno.h>
+#include <netinet/in.h>
+#else
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CPhone.h"
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define POLLINTERVAL 1000 
+
+#define CLEANUP_SOURCE_AIR_INTERFACE_START_FAILED	1
+#define CLEANUP_SOURCE_TE_CHANNEL_START_FAILED		2
+#define CLEANUP_SOURCE_INTERNAL_RUN_PHONE			3
+#define CLEANUP_SOURCE_MAIN_START_FAILED			4
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+#ifndef WIN32
+#define closesocket(x) (shutdown(x,SHUT_RDWR),close(x))
+#endif
+
+/*******************************************************************************
+ *
+ * Macro functions
+ *
+ ******************************************************************************/
+#ifndef WIN32
+#define Sleep(x) sleep(x/1000)
+#endif
+
+/*******************************************************************************
+ *
+ * Prototypes
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * Construction
+ *
+ ******************************************************************************/
+CPhone::CPhone() : iUdpAirInterface(&iPhoneData,&iLog), iTcpTeChannel(&iPhoneData,&iLog), iFilterPpp(&iPhoneData,&iLog), iMainThread("MainThread"), iAirInterfaceThread("AirInterfaceThread"), iTEChannelThread("TeChannelThread")
+{
+	// just need to set all the pointers to null
+	iFilter = NULL;
+	iDatalinkPacketise = NULL;
+	iDatalinkNull = NULL;
+	iProcessData = NULL;
+	iExitFlag = 0;
+	iStatus = MTS_INIT;
+
+	// clear the phone state
+	memset( &iPhoneData, 0, sizeof(iPhoneData) );
+}
+
+CPhone::~CPhone()
+{
+	// just need to check that all the pointers are freed
+	assert( iFilter == NULL );
+	assert( iDatalinkPacketise == NULL );
+	assert( iDatalinkNull == NULL );
+	assert( iProcessData == NULL );
+	assert( iStatus != MTS_RUNNING );
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE METHOD: MAIN-THREAD: InternalInitialisePhone - setup everything - if 
+ * this returns an error all resource MUST be cleaned up.
+ *
+ ******************************************************************************/
+MTError CPhone::InternalInitialisePhone( int aPhoneID, int aDatalinkConfig, int aFilterConfig, int *aErrCode )
+{
+	MTError merr;
+	TThreadError terr;
+
+	// check the params
+	assert( aPhoneID >= 0 );
+	assert( aErrCode != NULL );
+
+	// init the errors
+	*aErrCode = 0;
+
+	// setup the phone state 
+	iPhoneData.iPhoneID = aPhoneID;
+
+	// create the appropriate filters
+	merr = CreateFilters( aFilterConfig );
+	if( merr != MTL_SUCCESS ) {
+		return merr;
+	}
+
+	// create the data link object
+	merr = CreateDatalinkLayer( aDatalinkConfig );
+	if( merr != MTL_SUCCESS ) {
+		DeleteFilters();
+		return merr;
+	}
+
+	// give the datalink object pointers to the air interface and the uu interface
+	iProcessData->SetAirInterface( &iUdpAirInterface );
+	iProcessData->SetTEChannel( &iTcpTeChannel );
+
+	// give each channel a pointer to the datalink
+	iUdpAirInterface.SetDatalink( iProcessData );
+	iTcpTeChannel.SetDatalink( iProcessData );
+	iUdpAirInterface.SetFilter( iFilter );
+	iTcpTeChannel.SetFilter( iFilter );
+
+	// create a thread for the air interface to listen
+	terr = iAirInterfaceThread.StartThread( (void*)AirInterfaceThreadProc, this, aErrCode );
+	if( terr != TE_NONE ) {
+		CleanupState( CLEANUP_SOURCE_AIR_INTERFACE_START_FAILED );
+		return MTL_FAILED_TO_CREATE_AIR_INTERFACE_THREAD;
+	}
+
+	// create a thread for the te channel to listen
+	terr = iTEChannelThread.StartThread( (void*)TEChannelThreadProc, this, aErrCode );
+	if( terr != TE_NONE ) {
+		CleanupState( CLEANUP_SOURCE_TE_CHANNEL_START_FAILED );
+		return MTL_FAILED_TO_CREATE_TE_CHANNEL_THREAD;
+	}
+
+	// cool, we are setup and ready to go
+	return MTL_SUCCESS;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE METHOD: MAIN-THREAD: InternalRunPhone - the main execution loop for 
+ * the main thread of the phone - if this returns error then it MUST be cleaned 
+ * up.
+ *
+ ******************************************************************************/
+MTError CPhone::InternalRunPhone( int *aErrCode )
+{
+	TThreadError terr;
+	
+	// wait for the threads to complete or for a command to stop them
+	while( 1 ) {
+
+		// perform checks every X milliseconds
+		Sleep( POLLINTERVAL );
+
+		// check the state of the air_interface thread
+		terr = iAirInterfaceThread.WaitForThread( 0 );
+		if( terr == TE_NONE ) {
+		  break;
+		}
+		assert( terr == TE_TIMEOUT );
+
+		// check the state of the channel thread
+		terr = iTEChannelThread.WaitForThread( 0 );
+		if( terr == TE_NONE ) {
+			break;
+		}
+		assert( terr == TE_TIMEOUT );
+
+		// check whether the external program has requested that we shutdown
+		if( iExitFlag != 0 ) {
+			break;
+		}
+	}
+
+	// cleanup everything
+	CleanupState( CLEANUP_SOURCE_INTERNAL_RUN_PHONE );
+
+	// done
+	return MTL_SUCCESS;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD: StartPhone - this wraps up init phone and run phone
+ *
+ ******************************************************************************/
+MTError CPhone::StartPhone( int aPhoneID, int aDatalinkConfig, int aFilterConfig, int *aErrCode )
+{
+	MTError merr;
+	TThreadError terr;
+
+	// check params
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// check the state
+	if( iStatus != MTS_INIT ) {
+		return MTL_INVALID_STATE;
+	}
+
+	// initialise all the sub-components
+	merr = InternalInitialisePhone( aPhoneID, aDatalinkConfig, aFilterConfig, aErrCode );
+	if( merr != 0 ) {
+		return merr;
+	}
+
+	// set the state
+	iStatus = MTS_RUNNING;
+
+	// start up a new thread that calls InternalRunPhone
+	terr = iMainThread.StartThread( (void*)MainThreadProc, this, aErrCode );
+	if( terr != TE_NONE ) {
+		CleanupState( CLEANUP_SOURCE_MAIN_START_FAILED );
+		return MTL_FAILED_TO_CREATE_MAIN_THREAD;
+	}
+
+	// ok everything is running -- return ok
+	return MTL_SUCCESS;
+}	
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD: StopPhone - signal the main handler to stop 
+ * everything
+ *
+ ******************************************************************************/
+MTError CPhone::StopPhone()
+{
+	MTStatus mstatus;
+
+	// set the exit flag
+	iExitFlag = 1;
+
+	// depends on our state
+	switch( iStatus ) {
+	case MTS_INIT:
+		return MTL_SUCCESS;
+	
+	case MTS_RUNNING:
+	case MTS_SHUTDOWN_ALL_BUT_MAIN:
+
+		while( 1 ) {
+			mstatus = GetStatus();
+			if( mstatus == MTS_SHUTDOWN_ALL ) {
+				return MTL_SUCCESS;
+			}
+			Sleep( 500 );
+		}
+		break;
+
+	case MTS_SHUTDOWN_ALL:
+		return MTL_SUCCESS;
+	}
+
+	// should never get here
+	assert( !"INVALID CODE PATH" );
+	return MTL_SUCCESS;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD: Sets the remote address for the uu interface
+ *
+ ******************************************************************************/
+MTError CPhone::SetRemoteUUAddress( struct sockaddr_in sockaddr )
+{
+	iUdpAirInterface.SetRemoteAddress( sockaddr );
+	return MTL_SUCCESS;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD: Gets the remote address for the uu interface
+ *
+ ******************************************************************************/
+MTError CPhone::GetRemoteUUAddress( struct sockaddr_in *sockaddr )
+{
+	iUdpAirInterface.GetRemoteAddress( sockaddr );
+	return MTL_SUCCESS;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD: Gets the local address for the uu interface.
+ *
+ ******************************************************************************/
+MTError CPhone::GetLocalUUAddress( struct sockaddr_in *sockaddr )
+{
+	assert( sockaddr != NULL );
+	iUdpAirInterface.GetLocalAddress( sockaddr );
+	return MTL_SUCCESS;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: SERVER-THREAD: Sets the socket to be used by the TE channel.
+ *
+ ******************************************************************************/
+MTError CPhone::SetTeSocket( int aSock )
+{
+	TChannelError cerr;
+	cerr = iTcpTeChannel.SetSocket( aSock );
+	assert( (cerr == CE_NONE) || (cerr == CE_SOCKET_ALREADY_SET) );
+	return ((cerr == CE_NONE) ? MTL_SUCCESS : MTL_TE_CHANNEL_SOCKET_ALREADY_SET);
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD: Returns a pointer to the log.
+ *
+ ******************************************************************************/
+CLog *CPhone::GetLog()
+{
+	return &iLog;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD: Gets the current status of the MT.
+ *
+ ******************************************************************************/
+MTStatus CPhone::GetStatus()
+{
+	TThreadError terr;
+
+	// if the status is MTS_SHUTDOWN_ALL_BUT_MAIN then we check to see if the 
+	// main thread has exited and then we update it
+	if( iStatus == MTS_SHUTDOWN_ALL_BUT_MAIN ) {
+		terr = iMainThread.WaitForThread( 0 );
+		if( terr == TE_NONE ) {
+			iStatus = MTS_SHUTDOWN_ALL;
+		}
+	}
+
+	// return the status
+	return iStatus;
+}
+
+
+/*******************************************************************************
+ *
+ * Cleanupstate - cleans up everything
+ *
+ ******************************************************************************/
+void CPhone::CleanupState( int aRequestSource )
+{
+	int err;
+	TThreadState thread_state;
+	TThreadError terr;
+
+	// if the air interface thread is still listening then stop it
+	thread_state = iAirInterfaceThread.GetThreadState();
+	if( thread_state == TS_ACTIVE ) {
+		err = iUdpAirInterface.StopInterface();
+		assert( err == 0 );
+		terr = iAirInterfaceThread.WaitForThread( INFINITE );
+		assert( terr == TE_NONE );
+	}
+
+	// if the te channel thread is still listening then stop it
+	thread_state = iTEChannelThread.GetThreadState();
+	if( thread_state == TS_ACTIVE ) {
+		iTcpTeChannel.StopChannel();
+		terr = iTEChannelThread.WaitForThread( INFINITE );
+		assert( terr == TE_NONE );
+	}
+
+	// Remove the datalink layer
+	DeleteDatalinkLayer();
+
+	// Remove the fitler
+	DeleteFilters();
+
+	// update the status
+	thread_state = iMainThread.GetThreadState();
+	iStatus = ((thread_state == TS_ACTIVE) ? MTS_SHUTDOWN_ALL_BUT_MAIN : MTS_SHUTDOWN_ALL);
+
+	// verification
+	assert( (iStatus == MTS_SHUTDOWN_ALL) || (aRequestSource == CLEANUP_SOURCE_INTERNAL_RUN_PHONE) );
+}
+
+
+/*******************************************************************************
+ *
+ * SECTION: Helpers
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Create And Delete filters layers 
+ *
+ ******************************************************************************/
+MTError CPhone::CreateFilters( int aFilterConfig )
+{
+	// if the config isn't zero or one then we have an error
+	if( (aFilterConfig != 0) && (aFilterConfig != 1) ) {
+		return MTL_INVALID_FILTER_CONFIG;
+	}
+
+	// the only filter is the ppp logger filter
+	if( aFilterConfig == FILTER_PPP ) {
+		iFilter = &iFilterPpp;
+	}
+
+	// done
+	return MTL_SUCCESS;
+}
+
+void CPhone::DeleteFilters()
+{
+	// just set the pointer to NULL
+	iFilter = NULL;
+}
+
+
+/*******************************************************************************
+ *
+ * CreateAndDelete Datalink layers - these are the methods who know the class 
+ * (rather than the interface) of the datalink layer.
+ *
+ ******************************************************************************/
+MTError CPhone::CreateDatalinkLayer( int aDatalinkConfig )
+{
+	// create the appropriate datalink layer object and set the process data pointer
+	if( aDatalinkConfig == DL_NULL ) {
+		iDatalinkNull = new CDatalinkNull( &iPhoneData, &iLog );
+		assert( iDatalinkNull != NULL );
+		iProcessData = iDatalinkNull;
+	} else if( aDatalinkConfig == DL_PACKETISE ) {
+		iDatalinkPacketise = new CDatalinkPacketise( &iPhoneData, &iLog );
+		assert( iDatalinkPacketise != NULL );
+		iProcessData = iDatalinkPacketise;
+	} else {
+		return MTL_INVALID_DATALINK_LAYER;
+	}
+
+	// success
+	return MTL_SUCCESS;
+}
+
+void CPhone::DeleteDatalinkLayer()
+{
+	// delete whichever datalink layers are active 
+	if( iDatalinkNull != NULL ) {
+		delete iDatalinkNull;
+		iDatalinkNull = NULL;
+		iProcessData = NULL;
+	}
+
+	if( iDatalinkPacketise != NULL ) {
+		delete iDatalinkPacketise;
+		iDatalinkPacketise = NULL;
+		iProcessData = NULL;
+	}
+}
+
+
+/*******************************************************************************
+ *
+ * SECTION: Thread entry procedures
+ *
+ ******************************************************************************/
+	
+/*******************************************************************************
+ *
+ * Thread Entry Procedures
+ *
+ ******************************************************************************/
+int MainThreadProc( CPhone *aPhone )
+{
+	MTError merr;
+	CLog *log;
+	int errcode;
+
+	// check the param
+	assert( aPhone != NULL );
+
+	// log
+	log = &(aPhone->iLog);
+	log->WriteLogEntry( SV_INFO, "MainThreadProc", "Started" );
+
+	// now call startup
+	merr = aPhone->InternalRunPhone( &errcode );
+
+	// the result is logged
+	if( merr != MTL_SUCCESS ) {
+		log->WriteLogEntry( SV_WARNING, "MainThreadProc", "InternalRunPhone returned error", merr, errcode );
+	}
+
+	// log
+	log->WriteLogEntry( SV_INFO, "MainThreadProc", "Stopped" );
+	return MTL_SUCCESS;
+}
+
+
+int AirInterfaceThreadProc( CPhone *aPhone )
+{
+	TAirInterfaceError aerr;
+	int errcode;
+	CUDPAirInterface *air_interface;
+	CLog *log;
+
+	// check the param
+	assert( aPhone != NULL );
+
+	// log
+	log = &(aPhone->iLog);
+	log->WriteLogEntry( SV_INFO, "AirInterfaceThreadProc", "Started" );
+
+	// now recv from the air interface
+	air_interface = &(aPhone->iUdpAirInterface);
+	aerr = air_interface->ListenOnInterface( &errcode );
+
+	// the result is logged
+	if( aerr != AIE_NONE ) {
+		log->WriteLogEntry( SV_WARNING, "AirInterfaceThreadProc", "ListenOnInterface returned error", aerr, errcode );
+	}
+
+	// log
+	log->WriteLogEntry( SV_INFO, "AirInterfaceThreadProc", "Stopped" );
+	return MTL_SUCCESS;
+}
+
+int TEChannelThreadProc( CPhone *aPhone )
+{
+	TChannelError cerr;
+	int errcode;
+	CTcpTeChannel *te_channel;
+	CLog *log;
+
+	// check the param
+	assert( aPhone != NULL );
+
+	// log
+	log = &(aPhone->iLog);
+	log->WriteLogEntry( SV_INFO, "TEChannelThreadProc", "Started" );
+
+	// now recv from the channel
+	te_channel = &(aPhone->iTcpTeChannel);
+	cerr = te_channel->ListenOnChannel( &errcode );
+
+	// the result is logged
+	if( cerr != CE_NONE ) {
+		log->WriteLogEntry( SV_WARNING, "TEChannelThreadProc", "ListenOnChannel returned error", cerr, errcode );
+	}
+
+	// log
+	log->WriteLogEntry( SV_INFO, "TEChannelThreadProc", "Stopped" );
+	return MTL_SUCCESS;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CPhone.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CPhone
+* Stores the state of the phone.
+*
+*/
+
+
+
+#ifndef __CPHONE_H__
+#define __CPHONE_H__
+
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../ThreadLibrary/CAThread.h"
+#include "MTInterfaces.h"
+#include "CDatalinkNull.h"
+#include "CDatalinkPacketise.h"
+#include "CTCPTEChannel.h"
+#include "CUDPAirInterface.h"
+#include "CLogPPPFilter.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define FILTER_NONE  0
+#define FILTER_PPP   1
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef enum {
+	MTL_SUCCESS,
+	MTL_INVALID_FILTER_CONFIG,
+	MTL_INVALID_DATALINK_LAYER,	
+	MTL_FAILED_TO_CREATE_AIR_INTERFACE_THREAD,
+	MTL_FAILED_TO_CREATE_TE_CHANNEL_THREAD,
+	MTL_FAILED_TO_CREATE_MAIN_THREAD,
+	MTL_TE_CHANNEL_SOCKET_ALREADY_SET,
+	MTL_INVALID_STATE,
+} MTError;
+
+// This structure is defined in mobster.x 
+#ifndef __MOBSTER_H__
+typedef enum {
+	DL_INVALID,
+	DL_NULL,
+	DL_PACKETISE
+} TDatalinkLayer;
+#endif
+
+typedef enum {
+	MTS_INIT,
+	MTS_RUNNING,
+	MTS_SHUTDOWN_ALL_BUT_MAIN,
+	MTS_SHUTDOWN_ALL,
+} MTStatus;
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CPhone
+{
+public:
+	// Construction
+	CPhone();
+	~CPhone();
+
+	// Control interface
+	MTError StartPhone( int aPhoneID, int aDatalinkConfig, int aFilterConfig, int *aErrCode ); 
+	MTError StopPhone();
+	MTError GetLocalUUAddress( struct sockaddr_in *sockaddr );
+	MTError GetRemoteUUAddress( struct sockaddr_in *sockaddr );
+	MTError SetRemoteUUAddress( struct sockaddr_in sockaddr );
+	MTError SetTeSocket( int aSock );
+	MTStatus GetStatus();
+	CLog *GetLog();
+
+private:
+	MTError InternalInitialisePhone( int aPhoneID, int aDatalinkConfig, int aFilterConfig, int *aErrCode );
+	MTError InternalRunPhone( int *aErrCode );
+	void CleanupState( int aRequestSource );
+	MTError CreateDatalinkLayer( int aDatalinkConfig );
+	void DeleteDatalinkLayer();
+	MTError CreateFilters( int aFilterConfig );
+	void DeleteFilters();
+
+	// Thread entry point
+	friend int MainThreadProc( CPhone *aPhone );
+	friend int AirInterfaceThreadProc( CPhone *aPhone );
+	friend int TEChannelThreadProc( CPhone *aPhone );
+
+private:
+	// Device logfile
+	CLog iLog;
+
+	// All the data associated with the phone
+	TPhoneData iPhoneData;
+
+	// Air Interface
+	CUDPAirInterface iUdpAirInterface;
+
+	// TE Channel
+	CTcpTeChannel iTcpTeChannel;
+
+	// Flags
+	int iExitFlag;
+	MTStatus iStatus;
+
+	// Filters 
+	CLogPppFilter iFilterPpp;
+	IFilter *iFilter;
+
+	// Datalink Layer
+	CDatalinkNull *iDatalinkNull;
+	CDatalinkPacketise *iDatalinkPacketise;
+	IProcessData *iProcessData;
+
+	// Handles for each of the threads
+	CAThread iMainThread;
+	CAThread iAirInterfaceThread;
+	CAThread iTEChannelThread;
+};
+
+#endif //__CPHONE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CPppFrame.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <string.h>
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CPppFrame.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: Constructor / Destructor
+ *
+ ******************************************************************************/
+CPppFrame::CPppFrame( char *aFrameName, int aRemoveHDLCFraming )
+{	
+	int slen;
+
+	// check params
+	assert( aFrameName != NULL );
+	slen = strlen(aFrameName);
+	assert( slen < MAXFRAMENAME );
+
+	// init members
+	strcpy( iFrameName, aFrameName );
+	iCurrentFrameSize = 0;
+	iCurrentBufferSize = 0;
+	iFrameBufferStatus = FS_EMPTY;
+	iRemoveHDLCFraming = aRemoveHDLCFraming;
+	iEscapedChar = 0;
+}
+
+
+CPppFrame::~CPppFrame()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: AddByteToFrame
+ *
+ ******************************************************************************/
+TFrameError CPppFrame::AddByteToFrame( char c )
+{
+	int escaped_char_flag_on_entry;
+
+	// check state
+	assert( iFrameBufferStatus != FS_COMPLETE );
+
+	// save the escaped char flag in case we have to restore it 
+	escaped_char_flag_on_entry = iEscapedChar;
+
+	// (1)  undo hdlc frameing if configured to do so
+	if( iRemoveHDLCFraming != 0 ) {
+
+		// check to see if this is the escape char, if so we set a flag and stop processing this byte
+		if( (c == 0x7D) && (iEscapedChar == 0) ) {
+			iEscapedChar = 1;
+			return FE_NONE;
+		}
+
+		// if this byte was escaped then we have to XOR it with 0x20, then continue processesing
+		if( iEscapedChar == 1 ) {
+			iEscapedChar = 0;
+			c = c ^ 0x20;
+		}
+	}
+
+	// sanity checks between hdlc and non
+	assert( iEscapedChar == 0 );
+
+	// (2) process the byte as normal
+
+	// if this is the start of the frame then set the length, state, and copy the char. Note that PPP
+	// only requires one frame sequence (0x7e) between two adjacent frames. We take this flag as the
+	// end of the previous frame, which means that a frame may not have an openning frame sequence. The
+	// upshot of all this is that any byte may start a new frame.
+	if( iFrameBufferStatus == FS_EMPTY ) {
+	  assert( iCurrentFrameSize == 0 );
+	  assert( iCurrentBufferSize == 0 );
+	  (iFrameBuffer)[0] = c;
+	  iCurrentFrameSize = iCurrentBufferSize = 1;
+	  iFrameBufferStatus = FS_IN_PROGRESS;
+	  return FE_NONE;
+	} 
+
+	// If we are in a frame then buffer the byte. If there is no room then discard the byte and return 
+	// a warning. One byte is always kept for the end of frame sequence.
+	if( (iFrameBufferStatus == FS_IN_PROGRESS) && (c != 0x7E) ) {
+	  if( iCurrentBufferSize < (MAXFRAMESIZE-1) ) {
+	    (iFrameBuffer)[iCurrentBufferSize] = c;
+		iCurrentFrameSize++;
+		iCurrentBufferSize++;
+		return FE_NONE;
+	  } else {
+	    iEscapedChar = escaped_char_flag_on_entry;
+		return FE_OVERFLOW;
+	  }
+	}
+
+	// If we are in a frame and this is then buffer it and update the state
+	if( (iFrameBufferStatus == FS_IN_PROGRESS) && (c == 0x7E) ) {
+
+		// save the final byte
+		assert( iCurrentBufferSize < MAXFRAMESIZE );
+		(iFrameBuffer)[iCurrentBufferSize] = c;
+		iCurrentFrameSize++;
+		iCurrentBufferSize++;
+
+		// update the state
+		iFrameBufferStatus = FS_COMPLETE;
+		return FE_NONE;
+	}
+
+	// done (just to keep compiler happy)
+	return FE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: ClearFrame
+ *
+ ******************************************************************************/
+TFrameError CPppFrame::ClearFrame()
+{
+	iCurrentBufferSize = 0;
+	iCurrentFrameSize = 0;
+	iFrameBufferStatus = FS_EMPTY;
+	return FE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: ClearFrameMemoryButNotState
+ *
+ ******************************************************************************/
+TFrameError CPppFrame::ClearFrameMemoryButNotState()
+{
+	iCurrentBufferSize = 0;
+	return FE_NONE;
+}
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: GetFrameStatus
+ *
+ ******************************************************************************/
+TFrameStatus CPppFrame::GetFrameStatus()
+{
+	return iFrameBufferStatus;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: GetOverflowCount
+ *
+ ******************************************************************************/
+int CPppFrame::GetOverflowCount()
+{
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: GetFrameBuffer
+ *
+ ******************************************************************************/
+char *CPppFrame::GetFrameBuffer( int *aLen )
+{
+	assert( aLen != NULL );
+	*aLen = iCurrentBufferSize;
+	return (char*)iFrameBuffer;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHODS: GetFrameName
+ *
+ ******************************************************************************/
+char *CPppFrame::GetFrameName()
+{
+	return iFrameName;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CPppFrame.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CPPPFRAME_H__
+#define __CPPPFRAME_H__
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXFRAMESIZE (1024*4)
+#define MAXFRAMENAME (128)
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef enum {
+	FS_EMPTY,
+	FS_IN_PROGRESS,
+	FS_COMPLETE
+} TFrameStatus;
+
+typedef enum {
+	FE_NONE,
+	FE_OVERFLOW
+} TFrameError;
+
+/*******************************************************************************
+ *
+ * class CPppFrame
+ *
+ ******************************************************************************/
+class CPppFrame
+{
+public:
+	CPppFrame( char *aFrameName, int aRemoveHDLCFraming = 0 );
+	~CPppFrame();
+
+	TFrameError AddByteToFrame( char c );
+	TFrameError ClearFrame();
+	TFrameError ClearFrameMemoryButNotState();
+
+	TFrameStatus GetFrameStatus();
+	int GetOverflowCount();
+	char *GetFrameBuffer( int *aLen );
+	char *GetFrameName();
+
+private:
+	char iFrameName[MAXFRAMENAME];
+	int iRemoveHDLCFraming;
+
+	int iEscapedChar;
+
+	char iFrameBuffer[MAXFRAMESIZE];
+	int iCurrentFrameSize;
+	int iOverflowByteCount;
+	int iCurrentBufferSize;
+	TFrameStatus iFrameBufferStatus;
+};
+
+#endif //__CPPPFRAME_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CTCPTEChannel.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#ifndef WIN32
+#include <unistd.h>
+#include <errno.h>
+#endif
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CTCPTEChannel.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#ifndef WIN32
+#define SOCKET_ERROR (-1)
+#define INVALID_SOCKET (-1)
+#define Sleep(x) sleep(x/1000)
+#else
+#define SHUT_RDWR SD_BOTH
+#endif
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+#ifndef WIN32
+#define closesocket(x) (shutdown(x,SHUT_RDWR),close(x))
+#endif
+
+
+/*******************************************************************************
+ *
+ * Constructor -- initialise all state
+ *
+ ******************************************************************************/
+CTcpTeChannel::CTcpTeChannel( TPhoneData *aPhoneData, CLog *aLog )
+{
+	// verify args
+	assert( aPhoneData != NULL );
+	assert( aLog != NULL );
+
+	// initialise state
+	iPhoneData = aPhoneData;
+	iDatalink = NULL;
+	iFilter = NULL;
+	iLog = aLog;
+	iSock = INVALID_SOCKET;
+	iStreamBuffer[0] = 0;
+	iExitFlag = 0;
+	iSocketSetFlag = 0;
+}
+
+CTcpTeChannel::~CTcpTeChannel()
+{
+	assert( iSock == INVALID_SOCKET );
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD. SetDatalink, called by the main setup call in 
+ * cphone - links up all the bits.
+ *
+ ******************************************************************************/
+void CTcpTeChannel::SetDatalink( IProcessData *aDatalink )
+{
+	iDatalink = aDatalink;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD. SetFilter, called by the main setup call in 
+ * cphone - links up all the bits.
+ *
+ ******************************************************************************/
+void CTcpTeChannel::SetFilter( IFilter *aFilter )
+{
+	iFilter = aFilter;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: SERVER-THREAD: 
+ *
+ ******************************************************************************/
+TChannelError CTcpTeChannel::SetSocket( int aSocket )
+{
+	// check that the socket is sane
+	assert( aSocket >= 0 );
+
+	// check that we haven't already set if
+	if( iSocketSetFlag != 0 ) {
+		return CE_SOCKET_ALREADY_SET;
+	}
+
+	// ok - set the socket
+	iSock = aSocket;
+	iSocketSetFlag = 1;
+	return CE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: LISTEN-THREAD: ListenOnChannel. This is the entry point for 
+ * the listening thread. It sits in the loop below and passes all received data 
+ * to the datalink layer. 
+ *
+ ******************************************************************************/
+TChannelError CTcpTeChannel::ListenOnChannel( int *aErrCode )
+{
+	TDataPathError derr;
+	int err;
+	int errcode;
+
+	// check the params
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// listen on the socket until it closes
+	while( 1 ) {
+
+		// if the socket is not defined then just wait for it
+		if( iSock == INVALID_SOCKET ) {
+			Sleep( 1000 );
+			if( iExitFlag != 0 ) {
+				return CE_NONE;
+			}
+			continue;
+		}
+
+		// read from socket if it is defined
+		err = recv( iSock, iStreamBuffer, KBUFFSIZE, 0 );
+
+		// if the socket has been closed then cleanup and return
+		if( err == 0 ) {
+		  closesocket( iSock );
+		  iSock = INVALID_SOCKET;
+		  return CE_NONE;
+		}
+
+		// if an error has occured then report it and cleanup
+		if( err == SOCKET_ERROR ) {
+			*aErrCode = GetSocketError();
+			closesocket( iSock );
+			iSock = INVALID_SOCKET;
+			return CE_RECEIVE_FAILED;
+		}
+
+		// pass the data received through the filters. 
+		// : the control flow below allows the filter to analyse the data, and also change 
+		// the data in-place. However, it doesn't allow the interface to change the size of the 
+		// data (limiting the modifications it can make). This isn't a problem now since no 
+		// filters do this -- but when this is needed it should be implemented here, and in the same
+		// place in the uu interface.
+		if( iFilter != NULL ) {
+			iFilter->ProcessOutgoingData( iStreamBuffer, err );
+		}
+
+		// Now pass the data through to the datalink layer. A datalink layer MUST be
+		// defined if the socket is defined.
+		assert( iDatalink != NULL );
+		derr = iDatalink->ProcessTEData( iStreamBuffer, err, &errcode );
+		if( derr != DPE_NONE ) {	
+			iLog->WriteLogEntry( SV_WARNING, "CTcpTeChannel::ListenOnChannel", "ProcessTEData returned error", derr, errcode );
+		}
+	}
+
+	// should never get here
+	assert( !"INVALID CODE PATH" );
+	return CE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: MAIN-THREAD: StopChannel. This closes the socket (if open) 
+ * which will force the recv to return 0 and the listen-thread will return. It
+ * also sets the exit flag for when we want to stop the channel before it 
+ * really even started (poor thing).
+ *
+ ******************************************************************************/
+void CTcpTeChannel::StopChannel()
+{
+	// close the socket
+	if( iSock != INVALID_SOCKET ) {
+	  closesocket( iSock );
+	  iSock = INVALID_SOCKET;
+	}
+
+	// set the exit flag
+	iExitFlag = 1;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: AIR INTERFACE THREAD: SendPacket. This is called by the data
+ * link layer when it receives some data from the air interface that it now
+ * decides to forward on.
+ *
+ ******************************************************************************/
+TDataPathError CTcpTeChannel::SendPacket( char *data, int len, int *aErrCode )
+{
+	int err;
+	int bytes_to_send;
+	int bytes_sent;
+
+	// check params
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// if there is no connection then return. This is not unexpected or bad so
+	// no error is returned.
+	if( iSock == INVALID_SOCKET ) {
+		return DPE_NONE;
+	}
+
+	// otherwise send data
+	bytes_to_send = len;
+	bytes_sent = 0;
+	while( bytes_sent < bytes_to_send ) {
+		err = send( iSock, &(data[bytes_sent]), bytes_to_send - bytes_sent, 0 );
+		if( err == -1 ) {
+			*aErrCode = GetSocketError();
+			closesocket( iSock );
+			iSock = INVALID_SOCKET;
+			iSocketSetFlag = 0;
+			return DPE_SEND_FAILED;
+		}
+		bytes_sent += err;
+	}
+
+	// success
+	return DPE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE METHODS: HELPER FUNCTIONS
+ *
+ ******************************************************************************/
+int CTcpTeChannel::GetSocketError()
+{
+#ifdef WIN32
+  return WSAGetLastError();
+#else
+  return errno;
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CTCPTEChannel.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CTCPTEChannel
+* MSL Channel for the mobile termination. Sends and receives data over a TCP
+* socket. This end is the server and listens on a address / port. 
+*
+*/
+
+
+
+#ifndef __CTCPTECHANNEL_H__
+#define __CTCPTECHANNEL_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "MTInterfaces.h"
+#include "CLog.h"
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define KBUFFSIZE			4096
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef enum
+{
+	CE_NONE,
+	CE_RECEIVE_FAILED,
+	CE_SOCKET_ALREADY_SET
+} TChannelError;
+
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CTcpTeChannel : public ITEChannel
+{
+public:
+	// Construction
+	CTcpTeChannel( TPhoneData *aPhoneData, CLog *aLog );
+	virtual ~CTcpTeChannel();
+
+	// Set connections
+	void SetDatalink( IProcessData *aDatalink );
+	void SetFilter( IFilter *aFilter );
+	TChannelError SetSocket( int aSocket );
+
+	// Control
+	TChannelError ListenOnChannel( int *aErrCode );
+	void StopChannel();
+
+	// ITEChannel
+	virtual TDataPathError SendPacket( char *data, int len, int *aErrCode );
+
+private:
+	void CleanupChannel();
+	int GetSocketError();
+
+private:
+	TPhoneData *iPhoneData;
+	IProcessData *iDatalink;
+	IFilter *iFilter;
+	CLog *iLog;
+	int iSock;
+	int iExitFlag;
+	int iSocketSetFlag;
+	char iStreamBuffer[KBUFFSIZE];
+};
+
+#endif //__CTCPTECHANNEL_H__ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CUDPAirInterface.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <memory.h>
+#include <assert.h>
+#ifndef WIN32
+#include <errno.h>
+#include <unistd.h>
+#endif
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CUDPAirInterface.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#ifndef WIN32
+#define SOCKET_ERROR        (-1)
+#define INVALID_SOCKET      (-1)
+#define ADDRESS_INTEGER     s_addr
+#define closesocket(x)     (shutdown(x,SHUT_RDWR),close(x))
+#else
+typedef int socklen_t;
+#endif
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * Constructor - sets the passed pointers and sets the state to disabled
+ *
+ ******************************************************************************/
+CUDPAirInterface::CUDPAirInterface( TPhoneData *aPhoneData, CLog *aLog  )
+{
+	// verify parameters 
+	assert( aPhoneData != NULL );
+	assert( aLog != NULL );
+
+	// init state
+	iPhoneData = aPhoneData;
+	iProcessData = NULL;
+	iLog = aLog;
+	iFilter = NULL;
+	memset( &iRemoteAddress, 0, sizeof(iRemoteAddress) );
+	memset( &iLocalAddress, 0, sizeof(iLocalAddress) );
+	iSockIncoming = INVALID_SOCKET;
+	iSockOutgoing = INVALID_SOCKET;
+	iExitFlag = 0;
+	iRemoteAddressValid = 0;
+}
+
+CUDPAirInterface::~CUDPAirInterface( )
+{
+	// check the status of the sockets
+	assert( iSockIncoming == INVALID_SOCKET );
+	assert( iSockOutgoing == INVALID_SOCKET );
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: LISTEN-THREAD: ListenOnInterface. Binds to local port and 
+ * then starts listening on this port for more incoming data. Any incoming data
+ * is then sent to the datalink layer.
+ *
+ ******************************************************************************/
+TAirInterfaceError CUDPAirInterface::ListenOnInterface( int *aErrCode )
+{
+	TDataPathError derr;
+	int err, errcode;
+	struct sockaddr_in remote_recv_addr;
+	socklen_t addrlen;
+
+	// verify params
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// check that the local port is invalid
+	assert( iSockIncoming == INVALID_SOCKET );
+
+	// create the listening socket
+	iSockIncoming = socket( AF_INET, SOCK_DGRAM, 0 );
+	if( iSockIncoming == INVALID_SOCKET ) {
+		*aErrCode = GetSocketError();
+		return AIE_SOCKET_FAILED;
+	}
+
+	// if the exit flag is set then exit now
+	if( iExitFlag != 0 ) {
+	  closesocket( iSockIncoming );
+	  iSockIncoming = INVALID_SOCKET;
+	  return AIE_NONE;
+	}
+	
+
+	// bind the listening socket -- bind to an ephemeral port
+	iLocalAddress.sin_family = AF_INET;
+	iLocalAddress.sin_port = htons(0);
+	iLocalAddress.sin_addr.ADDRESS_INTEGER = INADDR_ANY;
+	err = bind( iSockIncoming, (struct sockaddr*)&iLocalAddress, sizeof(iLocalAddress) );
+
+	// get the allocated port info
+	addrlen = sizeof(iLocalAddress);
+	err = getsockname( iSockIncoming, (sockaddr*)&iLocalAddress, &addrlen );
+	assert( err == 0 );
+
+	// check for errors during the bind
+	if( err != 0 ) {
+	  closesocket( iSockIncoming );
+	  iSockIncoming = INVALID_SOCKET;
+	  *aErrCode = GetSocketError();
+	  return AIE_BIND_FAILED;
+	}
+
+	// use the listening socket as the outgoing socket -- no reason we can't do 
+	// this. It also means that we know the source port of the outgoing datagrams 
+	// and hence we can do some proper NISTNET stuff
+	iSockOutgoing = iSockIncoming;
+	
+	// read from the socket until an error occurs (this may be induced by another
+	// thread closing the socket)
+	while( 1 ) {
+		
+		// now read from the socket
+		memset( &remote_recv_addr, 0, sizeof(remote_recv_addr) );
+		addrlen = sizeof(remote_recv_addr);
+		err = recvfrom( iSockIncoming, iPacketBuffer, KPCKTBUFFSIZE, 0, (struct sockaddr*)&remote_recv_addr, &addrlen );
+
+		// check for errors
+		if( err == SOCKET_ERROR ) {
+		  closesocket( iSockIncoming );
+		  iSockIncoming = iSockOutgoing = INVALID_SOCKET;
+		  *aErrCode = GetSocketError();
+		  return AIE_RECEIVE_FAILED;
+		}
+
+		// send the data to the filters
+		if( iFilter != NULL ) {
+			iFilter->ProcessIncomingData( iPacketBuffer, err );
+		}
+
+		// otherwise we have data to send to the datalink layer
+		derr = iProcessData->ProcessUUData( iPacketBuffer, err, &errcode );
+		if( derr != DPE_NONE ) {	
+			iLog->WriteLogEntry( SV_WARNING, "CUDPAirInterface::ListenOnInterface", "ProcessUUData returned", derr, errcode );
+		}
+	}
+
+	// code should never get here
+	assert( !"INVALID CODE PATH" );
+	return AIE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: MAIN-THREAD: StopInterface. Closes the socket (if it is open)
+ * was called. We can't guarantee when the receiving thread will return. But it
+ * must before any other calls can be made.
+ *
+ ******************************************************************************/
+int CUDPAirInterface::StopInterface()
+{
+	// set the exit flag
+	iExitFlag = 1;
+
+	// close the socket if it is open
+	if( iSockIncoming != INVALID_SOCKET ) {
+	  closesocket( iSockIncoming );
+	  iSockIncoming = iSockOutgoing = INVALID_SOCKET;
+	}
+
+	// done 
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: GetLocalAddress 
+ *
+ ******************************************************************************/
+void CUDPAirInterface::GetLocalAddress( struct sockaddr_in *aLocalAddress )
+{
+	assert( aLocalAddress != NULL );
+	*aLocalAddress = iLocalAddress;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: SetRemoteAddress
+ *
+ ******************************************************************************/
+void CUDPAirInterface::GetRemoteAddress( struct sockaddr_in *aRemoteAddress )
+{
+	*aRemoteAddress = iRemoteAddress;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: SetRemoteAddress
+ *
+ ******************************************************************************/
+void CUDPAirInterface::SetRemoteAddress( struct sockaddr_in aRemoteAddress )
+{
+	iRemoteAddressValid = 1;
+	iRemoteAddress = aRemoteAddress;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: SetDatalink
+ *
+ ******************************************************************************/
+void CUDPAirInterface::SetDatalink( IProcessData *aProcessData )
+{
+	iProcessData = aProcessData;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: RPC-THREAD. SetFilter, called by the main setup call in 
+ * cphone - links up all the bits.
+ *
+ ******************************************************************************/
+void CUDPAirInterface::SetFilter( IFilter *aFilter )
+{
+	iFilter = aFilter;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: TE-THREAD: SendPacket, when data is received on the te 
+ * channel it eventually makes its way here (in its thread) to send the 
+ * data out the uu interface.
+ *
+ ******************************************************************************/
+TDataPathError CUDPAirInterface::SendPacket( char *data, int len, int *aErrCode )
+{
+	int err;
+
+	//verify the params
+	assert( data != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// make sure the remote address is set - not an error
+	if( iRemoteAddressValid == 0 ) {
+		return DPE_NONE;
+	}
+
+	// send the packet - send in 4k chunks to avoid system defined UDP packet size limit
+	err = sendto( iSockOutgoing, data, len, 0, (struct sockaddr*)&iRemoteAddress, sizeof(iRemoteAddress) );
+	if( err == SOCKET_ERROR ) {
+		*aErrCode = GetSocketError();
+		return DPE_SEND_FAILED;
+	}
+	
+	// done
+	return DPE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE METHODS: Helper functions
+ *
+ ******************************************************************************/
+int CUDPAirInterface::GetSocketError()
+{
+#ifdef WIN32
+	return WSAGetLastError();
+#else
+	return errno;
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/CUDPAirInterface.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CUDPAirInterface
+* Air Interface for the mobile termination. Sends and receives data over UDP
+* sockets using addresses and ports specified.
+*
+*/
+
+
+
+#ifndef __CUDPAIRINTERFACE_H__
+#define __CUDPAIRINTERFACE_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "MTInterfaces.h"
+#include "CLog.h"
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define KPCKTBUFFSIZE ((1024)*64)
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef enum
+{
+	AIE_NONE,
+	AIE_RECEIVE_FAILED,
+	AIE_SOCKET_FAILED,
+	AIE_BIND_FAILED,
+} TAirInterfaceError;
+
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CUDPAirInterface : public IAirInterface
+{
+public:
+	// Construction
+	CUDPAirInterface( TPhoneData *aPhoneData, CLog *aLog  );
+	virtual ~CUDPAirInterface();
+
+	// Control
+	TAirInterfaceError ListenOnInterface( int *aErrCode );
+	int StopInterface();
+	
+	// Accessors
+	void GetLocalAddress( struct sockaddr_in *aLocalAddress );
+	void GetRemoteAddress( struct sockaddr_in *aRemoteAddress );
+	void SetRemoteAddress( struct sockaddr_in aRemoteAddress );
+	void SetDatalink( IProcessData *aProcessData );
+	void SetFilter( IFilter *aFilter );
+
+	// IAirInterface
+	virtual TDataPathError SendPacket( char *data, int len, int *aErrCode );
+
+private:
+	int GetSocketError();
+
+private:
+	TPhoneData *iPhoneData;
+	IProcessData *iProcessData;
+	CLog *iLog;
+	IFilter *iFilter;
+
+	struct sockaddr_in iRemoteAddress;
+	struct sockaddr_in iLocalAddress;
+
+	char iPacketBuffer[KPCKTBUFFSIZE];
+
+	int iSockIncoming;
+	int iSockOutgoing;
+	int iExitFlag;
+	int iRemoteAddressValid;
+};
+
+#endif //__CUDPAIRINTERFACE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/MTInterfaces.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Contains the abstract interfaces for the MT components.
+*
+*/
+
+
+
+#ifndef __MTINTERFACES_H__
+#define __MTINTERFACES_H__
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef enum
+{
+	INTERFACE_DISABLED,
+	INTERFACE_CONNECTED
+} TInterfaceStatus;
+
+typedef struct {
+	int iPhoneID;
+} TPhoneData;
+
+typedef enum
+{
+	DPE_NONE,
+	DPE_NO_AIR_INTERFACE,
+	DPE_NO_TE_CHANNEL,
+	DPE_NO_TE_CHANNEL_CONNECTION,
+	DPE_SEND_FAILED,
+	DPE_NO_REMOTE_ADDRESS,
+} TDataPathError;
+
+/*******************************************************************************
+ *
+ * Interface on the Air Interface called by the DataLinkLayer (or whatever)
+ *
+ ******************************************************************************/
+class IAirInterface
+{
+public:
+	virtual TDataPathError SendPacket( char *data, int len, int *aErrCode ) = 0;
+};
+
+
+/*******************************************************************************
+ *
+ * Interface on the TE Channel -- called by the higher layer (demux/datalink)
+ *
+ ******************************************************************************/
+class ITEChannel
+{
+public:
+	virtual TDataPathError SendPacket( char *data, int len, int *aErrCode ) = 0;
+};
+
+
+/*******************************************************************************
+ *
+ * Interface on the datalink layer or signal stack, called by the demux and 
+ * the air interface
+ *
+ ******************************************************************************/
+class IProcessData
+{
+public:
+	virtual TDataPathError ProcessTEData( char *data, int len, int *aErrCode ) = 0;
+	virtual TDataPathError ProcessUUData( char *data, int len, int *aErrCode ) = 0;
+	virtual void SetAirInterface( IAirInterface *aAirInterface ) = 0;
+	virtual void SetTEChannel( ITEChannel *aTEChannel ) = 0;
+};
+
+
+/*******************************************************************************
+ *
+ * Interface on the filters called by the filter manager
+ *
+ ******************************************************************************/
+class IFilter
+{
+public:
+	virtual int ProcessIncomingData( char *data, int len ) = 0;
+	virtual int ProcessOutgoingData( char *data, int len ) = 0;
+};
+
+#endif //__MTINTERFACES_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=../../BinInternal/libmt.a
+INCLUDES=
+OBJECTS=	CDatalinkNull.o 		\
+		CDatalinkPacketise.o		\
+	 	CLog.o				\
+		CLogPPPFilter.o			\
+		CPhone.o			\
+		CPppFrame.o			\
+		CTCPTEChannel.o			\
+		CUDPAirInterface.o	
+LIBS=
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS)
+	ar -rcs $(TARGET) $(OBJECTS)
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/mt.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,169 @@
+# Microsoft Developer Studio Project File - Name="mt" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=mt - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "mt.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "mt.mak" CFG="mt - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "mt - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "mt - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "mt"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "mt - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libmt.lib"
+
+!ELSEIF  "$(CFG)" == "mt - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libmt.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "mt - Win32 Release"
+# Name "mt - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CDatalinkNull.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CDatalinkPacketise.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CLogPppFilter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CPhone.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CPppFrame.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CTCPTEChannel.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CUDPAirInterface.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CDatalinkNull.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CDatalinkPacketise.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CLogPppFilter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CPhone.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CPppFrame.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CTCPTEChannel.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CUDPAirInterface.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\MTInterfaces.h
+# End Source File
+# End Group
+# Begin Group "Imported Headers"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ThreadLibrary\CAThread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CLog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CLog.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobileTermination/mt.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "mt"=.\mt.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/CSMobster.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Sep 12 12:11:08 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcMobster.h"
+#include "CSMobster.h"
+
+
+/****************************************************************************************
+ * 
+ * Definitions
+ * 
+ ***************************************************************************************/
+#define MAXLOGNAME		64
+#ifndef WIN32
+#define _snprintf               snprintf
+#define ADDRESS_INTEGER         s_addr
+#endif
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSMobster::CSMobster()
+{
+}
+
+CSMobster::~CSMobster()
+{
+	stopdevice( 0 );
+}
+
+int CSMobster::GetKey()
+{
+	return iKey;
+}
+
+void CSMobster::SetKey( int aKey )
+{
+	iKey = aKey;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startdevice
+ * 
+ ***************************************************************************************/
+int CSMobster::cstr_startdevice( TDeviceDesc aDeviceDesc )
+{
+	int rv, err, errcode;
+
+	// set the state info for this object
+	memset( &iDeviceDesc, 0, sizeof(iDeviceDesc) );
+	iDeviceDesc.iDatalinkConfig = aDeviceDesc.iDatalinkConfig;
+	iDeviceDesc.iFilterConfig = aDeviceDesc.iFilterConfig;
+	iDeviceDesc.iMTID = iKey;
+	iDeviceDesc.iTEID = INVALID_DEVICE_ID;
+	iDeviceDesc.iDeviceStatus = CS_INACTIVE;
+	iDeviceDesc.iDeviceExitReason = DER_INVALID;
+
+	// start a phone in another thread, note that if it fails the call still succeeds, we
+	// treat this as the phone starting and then ending asynchronously. The main motivation
+	// for this is that it allows us to get all the debug info out.
+	err = iPhone.StartPhone( iKey, iDeviceDesc.iDatalinkConfig, iDeviceDesc.iFilterConfig, &errcode );
+	if( err != MTL_SUCCESS ) {
+		iDeviceDesc.iDeviceExitReason = DER_START_PHONE_FAILED;
+		iDeviceDesc.iDeviceExitSubReason = err;
+		iDeviceDesc.iDeviceExitDetail = errcode;
+		iDeviceDesc.iDeviceStatus = CS_CLOSED;
+	} else {
+		iDeviceDesc.iDeviceStatus = CS_ACTIVE;
+	}
+
+	// we now just wait for the other thread to get the channel connection
+	rv = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removedevice
+ * 
+ ***************************************************************************************/
+int CSMobster::dstr_removedevice( int aArgs, int *aDeleteInstance )
+{
+	int rv;
+	MTStatus mtstatus;
+
+	// if the phone was CS_ACTIVE last time then we have to check that it hasn't 
+	// change on its own accord.
+	if( iDeviceDesc.iDeviceStatus == CS_ACTIVE ) {
+		mtstatus = iPhone.GetStatus();
+		if( mtstatus == MTS_SHUTDOWN_ALL ) {
+			iDeviceDesc.iDeviceStatus = CS_CLOSED;
+		}
+	}
+
+	// cannot remove the device unless it is in the closed state
+	if( iDeviceDesc.iDeviceStatus != CS_CLOSED ) {
+		*aDeleteInstance = 0;
+		return ERR_INVALIDSTATE;
+	}
+
+	// otherwise let everything be cleaned up
+	*aDeleteInstance = 1;
+	rv = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getdeviceinfo
+ * 
+ ***************************************************************************************/
+TDeviceDesc CSMobster::getdeviceinfo( int aArgs )
+{
+	struct sockaddr_in sockaddr;
+	TDeviceDesc rv;
+	char *addr;
+	MTStatus mtstatus;
+
+	// if the phone was CS_ACTIVE last time then we have to check that it hasn't 
+	// change on its own accord.
+	if( iDeviceDesc.iDeviceStatus == CS_ACTIVE ) {
+		mtstatus = iPhone.GetStatus();
+		if( mtstatus == MTS_SHUTDOWN_ALL ) {
+			iDeviceDesc.iDeviceStatus = CS_CLOSED;
+		}
+	}
+
+	// copy the static values from the local version
+	rv = iDeviceDesc;
+
+	// update the addresses from the MT
+	iPhone.GetLocalUUAddress( &sockaddr );
+	sprintf( rv.iLocalAirInterfacePort, "%d", ntohs(sockaddr.sin_port) );
+	iPhone.GetRemoteUUAddress( &sockaddr );
+	sprintf( rv.iRemoteAirInterfacePort, "%d", ntohs(sockaddr.sin_port) );
+	addr = inet_ntoa( sockaddr.sin_addr );
+	_snprintf( rv.iRemoteAirInterfaceAddress, MAXADDRLEN, "%s", addr ); 
+
+	// done
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getdevicelog
+ * 
+ ***************************************************************************************/
+TVarData CSMobster::getdevicelog( int aArgs )
+{
+	TVarData rv;
+	CLog *log;
+	int logsize;
+
+	// init the rv
+	rv.TVarData_len = 0;
+	rv.TVarData_val = NULL;
+
+	// get the log from the device
+	log = iPhone.GetLog();
+
+	// get the size of the log and allocate the space
+	logsize = log->CalculateLogSize();
+	if( logsize == 0 ) {
+		return rv;
+	}
+	rv.TVarData_val = (char*)malloc( logsize );
+	rv.TVarData_len = logsize;
+
+	// copy the log into the buffer
+	log->PrintLogToBuffer( logsize, rv.TVarData_val );
+
+	// close up the file and return data
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopdevice
+ * 
+ ***************************************************************************************/
+int CSMobster::stopdevice( int aArgs )
+{
+	int rv, err;
+
+	// no phone should be in the ps_inactive state (non-atomically)
+	assert( iDeviceDesc.iDeviceStatus != CS_INACTIVE );
+
+	// if we are in the closed state already then return invalid state
+	if( iDeviceDesc.iDeviceStatus == CS_CLOSED ) {
+		rv = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// if we are in the active state then stop the phone -- if stop fails then we 
+	// return without changing the state -- this means that the phone should only
+	// return an error from StopPhone() if it is a transient error.
+	assert( iDeviceDesc.iDeviceStatus == CS_ACTIVE );
+	err = iPhone.StopPhone();
+	if( err != 0 ) {
+		rv = ERR_STOPFAILED;
+		return rv;
+	}
+	iDeviceDesc.iDeviceExitReason = DER_USER_REQUEST;
+	iDeviceDesc.iDeviceExitSubReason = 0;
+	iDeviceDesc.iDeviceExitDetail = 0;
+	iDeviceDesc.iDeviceStatus = CS_CLOSED;
+
+	// return success
+	rv = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setremoteuuaddress
+ * 
+ ***************************************************************************************/
+int CSMobster::setremoteuuaddress( TUUAddress aArgs )
+{
+	int rv, err;
+	struct sockaddr_in sockaddr;
+
+	// call the phone
+	sockaddr.sin_family = AF_INET;
+	sockaddr.sin_addr.ADDRESS_INTEGER = aArgs.iRemoteAddress;
+	sockaddr.sin_port = aArgs.iRemotePort;
+	err = iPhone.SetRemoteUUAddress( sockaddr );
+
+	// translate cphone error to mobster
+	assert( err == MTL_SUCCESS );
+	rv = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settesocket
+ * 
+ ***************************************************************************************/
+int CSMobster::settesocket( int aSock )
+{
+	MTError merr;
+
+	// pass the socket to the phone
+	merr = iPhone.SetTeSocket( aSock );
+
+	// 	translate the errors
+	return ((merr == MTL_SUCCESS) ? ERR_NONE : ERR_CHANNEL_SOCKET_ALREADY_SET);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/CSMobster.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Sep 12 12:11:08 2003
+*
+*/
+
+
+
+
+#ifndef __CSMOBSTER_H__
+#define __CSMOBSTER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "mobster.h"
+#include "../MobileTermination/CPhone.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSMobster
+ * 
+ ***************************************************************************************/
+class CSMobster
+{
+public:
+	// Standard Methods
+	CSMobster();
+	~CSMobster();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+	int cstr_startdevice( TDeviceDesc aArgs );
+	int dstr_removedevice( int aArgs, int *aDeleteInstance );
+	TDeviceDesc getdeviceinfo( int aArgs );
+	TVarData getdevicelog( int aArgs );
+	int stopdevice( int aArgs );
+	int setremoteuuaddress( TUUAddress aArgs );
+
+	// Added methods that the service accesses
+	int settesocket( int aSock );
+
+private:
+	int iKey;
+	TDeviceDesc iDeviceDesc;
+	CPhone iPhone;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/CSvcMobster.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Sep 19 13:14:28 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcMobster.h"
+#include "mobster.h"
+#include "../ThreadLibrary/CAThread.h"
+#include "mobster_client_server_protocol.h"
+
+
+/****************************************************************************************
+ * 
+ * Definitions
+ * 
+ ***************************************************************************************/
+#ifndef WIN32
+#define ADDRESS_INTEGER          s_addr
+#define closesocket(x)           (shutdown(x,SHUT_RDWR),close(x))
+#endif
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSMobster> *iComponentManager;
+static CAThread *iServerThread;
+static int iServerListenSocket, iStopRequestedFlag;
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcMobster::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	int rv;
+	int *ia;
+	TUUAddress *ua;
+
+	switch( aMethod ) {
+
+	case DSTR_REMOVEDEVICE:
+	case GETDEVICEINFO:
+	case GETDEVICELOG:
+	case STOPDEVICE:
+		ia = (int*)aArgs;
+		rv = *ia;
+		break;
+
+	case SETREMOTEUUADDRESS:
+		ua = (TUUAddress*)aArgs;
+		rv = ua->iDeviceID;
+		break;
+
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcMobster::SetError( int aMethod, void *aArgs, int aError )
+{
+	int rv;
+	TComponentList *cl;
+	TDeviceDesc *dd;
+	TVarData *vd;
+
+	switch( aMethod ) {
+
+	case LIST_DEVICES:
+		cl = (TComponentList*)aArgs;
+		if( aError != ERR_NONE ) {
+			if( cl->TComponentList_val != NULL ) {
+				free(cl->TComponentList_val);
+				cl->TComponentList_val = NULL;
+			}
+			cl->TComponentList_len = 0;
+		}
+		rv = ERR_NONE;
+		break;
+
+	case GETDEVICEINFO:
+		dd = (TDeviceDesc*)aArgs;
+		dd->iMTID = aError;
+		rv = ERR_NONE;
+		break;
+
+	case GETDEVICELOG:
+		vd = (TVarData*)aArgs;
+		if( aError != ERR_NONE ) {
+			if( vd->TVarData_val != NULL ) {
+				free(vd->TVarData_val);
+				vd->TVarData_val = NULL;
+			}
+			vd->TVarData_len = 0;
+		}
+		rv = ERR_NONE;
+		break;
+
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcMobster::StartRPCService( CComponentManager<CSMobster> *aComponentManager, TChannelAddress *aArg )
+{
+	TThreadError terr;
+	int err;
+	struct sockaddr_in local_address;
+
+	// prologue
+	assert( iComponentManager == NULL );
+	assert( iServerThread == NULL );
+
+	// create a socket to listen for connections
+	iServerListenSocket = socket( AF_INET, SOCK_STREAM, 0 );
+	if( iServerListenSocket == -1 ) {
+		return ERR_CREATE_SOCKET_FAILED;
+	}
+
+	// bind the specified port (ignore address)
+	local_address.sin_family = AF_INET;
+	local_address.sin_addr.ADDRESS_INTEGER = INADDR_ANY;
+	local_address.sin_port = htons(aArg->iPort);
+	err = bind( iServerListenSocket, (struct sockaddr *)&local_address, sizeof(local_address) );
+	if( err == -1 ) {
+		closesocket( iServerListenSocket );
+		return ERR_BIND_FAILED;
+	}
+
+	// listen
+	err = listen( iServerListenSocket, 5 );
+	if( err == -1 ) {
+		closesocket( iServerListenSocket );
+		return ERR_LISTEN_FAILED;
+	}
+
+	// ok the socket is all setup to do an accept - so we pass over to the other thread
+	// and let the main call continue
+	iStopRequestedFlag = 0;
+	iServerThread = new CAThread( "CSvcMobster::iServerThread" );
+	assert( iServerThread != NULL );
+	terr = iServerThread->StartThread( (void*)CSvcMobster::WaitForConnectionsFromTerminalEmulations, NULL, &err ); 
+	if( terr != TE_NONE ) {
+		closesocket( iServerListenSocket );
+		delete iServerThread;
+		iServerThread = NULL;
+		return ERR_CREATE_SERVER_THREAD_FAILED;
+	}
+
+	// done 
+	iComponentManager = aComponentManager;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcMobster::StopRPCService()
+{
+	TThreadError terr;
+
+	// close the socket to stop the thread
+	iStopRequestedFlag = 1;
+	closesocket( iServerListenSocket );
+	terr = iServerThread->WaitForThread( -1 );
+	if( terr != TE_NONE ) {
+		fprintf( stderr, "WARNING: CSvcMobster::StopRPCService - WaitForThread returned %d.\n", terr );
+	}
+
+	// clean up the thread
+	if( iServerThread != NULL ) {
+		delete iServerThread;
+		iServerThread = NULL;
+	}
+
+	// reset the component manager (though not responsible for delete)
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE: WaitForConnectionsFromTerminalEmulations
+ * 
+ ***************************************************************************************/
+void CSvcMobster::WaitForConnectionsFromTerminalEmulations( void )
+{
+	int client_sockfd;
+
+	// repeat until StopRPCService is called (or an error occurs)
+	while( 1 ) {
+
+		// wait for a connection
+		client_sockfd = accept( iServerListenSocket, NULL, NULL );
+		if( client_sockfd == -1 ) {
+		  if( ((errno != 0) && (errno != EINVAL)) || ((errno == EINVAL) && (iStopRequestedFlag == 0)) ) {
+		    fprintf( stderr, "WARNING: Accept has failed with errno = %d.\n", errno );
+		  }
+		  break;
+		}
+
+		// we have a socket -- now it has to do the c/s protocol so that we know which 
+		// MT to connect it to -- but if there is a problem then this could block 
+		// forever -- so I'm going to create a thread per connection to deal with this. 
+		// These threads are responsible for cleaning themselves up.
+#ifdef WIN32
+		{
+		  HANDLE client_thread;
+		  client_thread = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)CSvcMobster::ConnectClientToMobileTermination, (void*)client_sockfd, 0, NULL );
+		  if( client_thread == NULL ) {
+		    fprintf( stderr, "WARNING: Failed to create the client thread to connect to MobileTermination (%d).\n", GetLastError() );
+		  }
+		  client_thread = NULL;
+#else
+		{
+		  int err;
+		  pthread_t client_thread;
+		  err = pthread_create( &client_thread, NULL, (void*(*)(void*))(CSvcMobster::ConnectClientToMobileTermination), (void*)client_sockfd );
+		  if( err != 0 ) {
+		    fprintf( stderr, "WARNING: Failed to create the client thread to connect to MobileTermination (%d).\n", errno );
+		  }
+		  client_thread = 0;
+		}
+#endif
+
+		// this is all we have to do
+	}
+
+	// done
+	return;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE: ConnectClientToMobileTermination
+ * 
+ ***************************************************************************************/
+void CSvcMobster::ConnectClientToMobileTermination( int aSock )
+{
+	int mtid, err;
+	CSMobster *mt;
+
+	// do the csprotocol across the socket to get the config info
+	mtid = client_server_protocol( aSock );
+	if( mtid < 0 ) {
+		fprintf( stderr, "WARNING: Invalid MTID received (%d).\n", mtid );
+		closesocket( aSock );
+		return;
+	}
+
+	// try and get the instance
+	mt = iComponentManager->GetInstance( mtid );
+	if( mt == NULL ) {
+		fprintf( stderr, "WARNING: Client requested non-existant device %d.\n", mtid );
+		closesocket( aSock );
+		return;
+	}
+
+	// pass the new socket to the mt
+	err = mt->settesocket( aSock );
+	if( err != ERR_NONE ) {
+		fprintf( stderr, "WARNING: Failed to set the socket on device %d (%d).\n", mtid, err );
+		closesocket( aSock );
+		return;
+	}
+
+	// all done -- thread exit
+#ifdef WIN32
+	ExitThread( 0 );
+#else
+	pthread_exit( 0 );
+#endif
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/CSvcMobster.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Sep 19 13:14:28 2003
+*
+*/
+
+
+
+
+#ifndef __CSVCMOBSTER_H__
+#define __CSVCMOBSTER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "mobster.h"
+#include "CSMobster.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcMobster
+ * 
+ ***************************************************************************************/
+class CSvcMobster
+{
+public:
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int StartRPCService( CComponentManager<CSMobster> *aComponentManager, TChannelAddress *aArg );
+	static int StopRPCService();
+
+private:
+	static void WaitForConnectionsFromTerminalEmulations( void );
+	static void ConnectClientToMobileTermination( int aSock);
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../bin/mobster
+INCLUDES=	-I../MobileTermination/ -I../include/
+OBJECTS=	mobster_client_server_protocol.o
+
+RPCGENOBJECTS=	CSMobster.o 			\
+		CSvcMobster.o			\
+		mobster_svc.o			\
+		mobster_svc_stub_impl.o		\
+		mobster_xdr.o	
+
+LIBS=  		-L../../BinInternal -lthread -lmt -lrpcsvc -lpthread
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(RPCGENOBJECTS) $(OBJECTS) ../../BinInternal/libmt.a ../../BinInternal/libthread.a
+	g++ -gstabs -Wall $(INCLUDES) $(RPCGENOBJECTS) $(OBJECTS) $(LIBS) -o $(TARGET) 
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/MobsterRPCService.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,193 @@
+# Microsoft Developer Studio Project File - Name="MobsterRPCService" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=MobsterRPCService - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "MobsterRPCService.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "MobsterRPCService.mak" CFG="MobsterRPCService - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "MobsterRPCService - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "MobsterRPCService - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "MobsterRPCService"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "MobsterRPCService - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "MobsterRPCService - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\MobileTermination" /I "..\..\ExternalSource\modification_source\oncrpc\\" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libmt.lib libthread.lib ..\..\ExternalSource\binaries\oncrpcms.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\BinInternal"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "MobsterRPCService - Win32 Release"
+# Name "MobsterRPCService - Win32 Debug"
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\include\CComponentManager.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mobster.h
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSMobster.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSMobster.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcMobster.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcMobster.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\mobster_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mobster_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mobster_xdr.c
+# End Source File
+# End Group
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ThreadLibrary\CAThread.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\MobileTermination\CLog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\MobileTermination\CPhone.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mobster_client_server_protocol.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\penstd.x
+# End Source File
+# Begin Source File
+
+SOURCE=..\SocketLibrary\socket_helper.h
+# End Source File
+# End Group
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\mobster.x
+
+!IF  "$(CFG)" == "MobsterRPCService - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "MobsterRPCService - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\mobster.x
+
+"mobster.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BuildTools\rpcgen -server -component_base -wrapstring mobster.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\mobster_client_server_protocol.cpp
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/MobsterRPCService.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "MobsterRPCService"=.\MobsterRPCService.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/device0000.log.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,131 @@
+-----------------------------------------------------------------
+
+Resource  Device: 134590272, Source: CDatalinkNull.
+
+Object Created
+-----------------------------------------------------------------
+
+Resource  Device: 134609472, Source: CTCPTEChannel.
+
+Object Created
+-----------------------------------------------------------------
+
+Resource  Device: 134613600, Source: CUDPAirInterface.
+
+Object Created
+-----------------------------------------------------------------
+
+Resource  Device: 0, Source: AirInterfaceProc.
+
+AirInterfaceThread started
+-----------------------------------------------------------------
+
+Resource  Device: 0, Source: TEChannelProc.
+
+TEChannelThread started
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPHONE.
+
+MT Emulation Started
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Outgoing). Length = 28, Discarded = 0
+Protocol: LCP
+	Code: Configure-Request
+	ID: 1
+	Length: 20
+
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Incoming). Length = 28, Discarded = 0
+Protocol: LCP
+	Code: Configure-Request
+	ID: 1
+	Length: 20
+
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Incoming). Length = 28, Discarded = 0
+Protocol: LCP
+	Code: Configure-Ack
+	ID: 1
+	Length: 20
+
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Outgoing). Length = 28, Discarded = 0
+Protocol: LCP
+	Code: Configure-Ack
+	ID: 1
+	Length: 20
+
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Incoming). Length = 18, Discarded = 20
+Protocol: 0101
+
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Outgoing). Length = 18, Discarded = 20
+Protocol: 0101
+
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Outgoing). Length = 18, Discarded = 20
+Protocol: 0201
+
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPPPFrameBuffer.
+
+PPP Frame(Incoming). Length = 18, Discarded = 20
+Protocol: 0201
+
+-----------------------------------------------------------------
+
+Resource  Device: 0, Source: TEChannelProc.
+
+TEChannelThread finished
+-----------------------------------------------------------------
+
+Warning   Device: 0, Source: CUDPAirInterface, Error code: 1 (0).
+-----------------------------------------------------------------
+
+Warning   Device: 0, Source: AirInterfaceProc, Error code: 6 (9).
+
+AirInterfaceThread finished
+-----------------------------------------------------------------
+
+Resource  Device: 134609472, Source: CTCPTEChannel.
+
+Object Destroyed
+-----------------------------------------------------------------
+
+Resource  Device: 134613600, Source: CUDPAirInterface.
+
+Object Destroyed
+-----------------------------------------------------------------
+
+Resource  Device: 134590272, Source: CDatalinkNull.
+
+Object Destroyed
+-----------------------------------------------------------------
+
+Info      Device: 0, Source: CPHONE.
+
+MT Emulation Stopped
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/linux_conv.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file contains definitions to allow windows things to compile on Linux. This is
+* nothing major -- just (void*) for HANDLE etc.
+*
+*/
+
+
+
+
+#ifndef __LINUX_CONV_H__
+#define __LINUX_CONV_H__
+
+/****************************************************************************************
+ *
+ * Switches
+ *
+ ***************************************************************************************/
+#ifdef WIN32
+#error
+#endif
+
+/****************************************************************************************
+ *
+ * Definitions
+ *
+ ***************************************************************************************/
+#define HANDLE (void*)
+
+/****************************************************************************************
+ *
+ * Macro Functions
+ *
+ ***************************************************************************************/
+#define ReadFile(a,b,c,d,e)  (assert(0),1)
+#define WriteFile(a,b,c,d,e) (assert(0),1)
+
+
+#endif //__LINUX_CONV_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,268 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __MOBSTER_H__
+#define __MOBSTER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TComponentList(...);
+}
+#else
+bool_t xdr_mobster_TComponentList();
+#endif
+
+#define MAXADDRLEN 64
+#define MAXPORTLEN 16
+#define INVALID_DEVICE_ID 0xFFFFFFFF
+#define ERR_DEVICETHREADCREATIONFAILED -100
+#define ERR_DEVICENOTRUNNING -101
+#define ERR_STOPFAILED -102
+#define ERR_STARTUPFAILED -103
+#define ERR_CREATE_SOCKET_FAILED -104
+#define ERR_BIND_FAILED -105
+#define ERR_LISTEN_FAILED -106
+#define ERR_CREATE_SERVER_THREAD_FAILED -117
+#define ERR_ACCEPT_FAILED -107
+#define ERR_CSPROTOCOLFAILED -108
+#define ERR_CREATELOGFAILED -109
+#define ERR_STARTPHONEFAILED -110
+#define ERR_CONNECTSOCKETFAILED -111
+#define ERR_OPENSERIALPORTFAILED -112
+#define ERR_DEVICEINITIALISING -113
+#define ERR_STOPREQUESTED -114
+#define ERR_FAILEDTORESOLVEOUTGOINGAIRADDRESS -115
+#define ERR_FAILEDTORESETSTATE -116
+#define ERR_CHANNEL_SOCKET_ALREADY_SET -118
+#define FILTER_NONE 0
+#define FILTER_PPP 1
+
+enum TDatalinkLayer {
+	DL_INVALID = 0,
+	DL_NULL = 1,
+	DL_PACKETISE = 2,
+};
+typedef enum TDatalinkLayer TDatalinkLayer;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TDatalinkLayer(...);
+}
+#else
+bool_t xdr_mobster_TDatalinkLayer();
+#endif
+
+
+enum TChannelStatus {
+	CS_INACTIVE = 0,
+	CS_ACTIVE = 1,
+	CS_CLOSED = 2,
+};
+typedef enum TChannelStatus TChannelStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TChannelStatus(...);
+}
+#else
+bool_t xdr_mobster_TChannelStatus();
+#endif
+
+
+enum TDeviceExitReason {
+	DER_INVALID = 0,
+	DER_USER_REQUEST = 1,
+	DER_START_PHONE_FAILED = 2,
+	DER_UNKNOWN = 3,
+};
+typedef enum TDeviceExitReason TDeviceExitReason;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TDeviceExitReason(...);
+}
+#else
+bool_t xdr_mobster_TDeviceExitReason();
+#endif
+
+
+struct TChannelAddress {
+	int iPort;
+};
+typedef struct TChannelAddress TChannelAddress;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TChannelAddress(...);
+}
+#else
+bool_t xdr_mobster_TChannelAddress();
+#endif
+
+
+struct TUUAddress {
+	int iDeviceID;
+	int iRemoteAddress;
+	int iRemotePort;
+};
+typedef struct TUUAddress TUUAddress;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TUUAddress(...);
+}
+#else
+bool_t xdr_mobster_TUUAddress();
+#endif
+
+
+struct TDeviceDesc {
+	TDatalinkLayer iDatalinkConfig;
+	int iFilterConfig;
+	int iMTID;
+	int iTEID;
+	char iLocalAirInterfacePort[MAXPORTLEN];
+	char iRemoteAirInterfaceAddress[MAXADDRLEN];
+	char iRemoteAirInterfacePort[MAXPORTLEN];
+	TChannelStatus iDeviceStatus;
+	TDeviceExitReason iDeviceExitReason;
+	int iDeviceExitSubReason;
+	int iDeviceExitDetail;
+};
+typedef struct TDeviceDesc TDeviceDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TDeviceDesc(...);
+}
+#else
+bool_t xdr_mobster_TDeviceDesc();
+#endif
+
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TVarData(...);
+}
+#else
+bool_t xdr_mobster_TVarData();
+#endif
+
+
+#define MOBSTER ((u_long)0x34630201)
+#define MOBSTER_VERSION ((u_long)1)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_1( TChannelAddress * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_1();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_1();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_1( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_1();
+#endif /* __cplusplus */
+#define CSTR_STARTDEVICE ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern int *cstr_startdevice_1( TDeviceDesc * arg, CLIENT *cl );
+}
+#else
+extern int *cstr_startdevice_1();
+#endif /* __cplusplus */
+#define DSTR_REMOVEDEVICE ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removedevice_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removedevice_1();
+#endif /* __cplusplus */
+#define GETDEVICEINFO ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TDeviceDesc *getdeviceinfo_1( int * arg, CLIENT *cl );
+}
+#else
+extern TDeviceDesc *getdeviceinfo_1();
+#endif /* __cplusplus */
+#define GETDEVICELOG ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getdevicelog_1( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getdevicelog_1();
+#endif /* __cplusplus */
+#define STOPDEVICE ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern int *stopdevice_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *stopdevice_1();
+#endif /* __cplusplus */
+#define SETREMOTEUUADDRESS ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern int *setremoteuuaddress_1( TUUAddress * arg, CLIENT *cl );
+}
+#else
+extern int *setremoteuuaddress_1();
+#endif /* __cplusplus */
+
+#endif /* __MOBSTER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+/*******************************************************************************
+ *
+ * Mobster Specific Definitions
+ *
+ ******************************************************************************/
+const MAXADDRLEN			= 64;
+const MAXPORTLEN			= 16;
+const INVALID_DEVICE_ID		= 0xFFFFFFFF;
+
+/*******************************************************************************
+ *
+ * Error codes
+ *
+ ******************************************************************************/
+const ERR_DEVICETHREADCREATIONFAILED	= -100;
+const ERR_DEVICENOTRUNNING				= -101;
+const ERR_STOPFAILED					= -102;
+const ERR_STARTUPFAILED					= -103;
+const ERR_CREATE_SOCKET_FAILED			= -104;
+const ERR_BIND_FAILED					= -105;
+const ERR_LISTEN_FAILED					= -106;
+const ERR_CREATE_SERVER_THREAD_FAILED	= -117;
+const ERR_ACCEPT_FAILED					= -107;
+const ERR_CSPROTOCOLFAILED				= -108;
+const ERR_CREATELOGFAILED				= -109;
+const ERR_STARTPHONEFAILED				= -110;
+const ERR_CONNECTSOCKETFAILED			= -111;
+const ERR_OPENSERIALPORTFAILED			= -112;
+const ERR_DEVICEINITIALISING					= -113;
+const ERR_STOPREQUESTED							= -114;
+const ERR_FAILEDTORESOLVEOUTGOINGAIRADDRESS		= -115;
+const ERR_FAILEDTORESETSTATE					= -116;
+const ERR_CHANNEL_SOCKET_ALREADY_SET			= -118;
+
+/*******************************************************************************
+ *
+ * Values passed as parameters
+ *
+ ******************************************************************************/
+const FILTER_NONE						= 0;
+const FILTER_PPP						= 1;
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+enum TDatalinkLayer {
+	DL_INVALID,
+	DL_NULL,
+	DL_PACKETISE
+};
+
+enum TChannelStatus {
+	CS_INACTIVE,
+	CS_ACTIVE,
+	CS_CLOSED
+};
+
+enum TDeviceExitReason {
+	DER_INVALID,
+	DER_USER_REQUEST,
+	DER_START_PHONE_FAILED,
+	DER_UNKNOWN
+};
+
+struct TChannelAddress {
+	int iPort;
+};
+
+struct TUUAddress {
+	int iDeviceID;
+	int iRemoteAddress;
+	int iRemotePort;
+};
+
+struct TDeviceDesc {
+
+	/* Input Values */
+	TDatalinkLayer	iDatalinkConfig;
+	int				iFilterConfig;
+
+	/* Public State */
+	int					iMTID;
+	int					iTEID;
+	char				iLocalAirInterfacePort[MAXPORTLEN];
+	char				iRemoteAirInterfaceAddress[MAXADDRLEN];
+	char				iRemoteAirInterfacePort[MAXPORTLEN];
+	TChannelStatus		iDeviceStatus;
+	TDeviceExitReason	iDeviceExitReason;
+	int					iDeviceExitSubReason;
+	int					iDeviceExitDetail;
+};
+
+typedef opaque TVarData<>;
+
+/*******************************************************************************
+ *
+ * MOBSTER Interface
+ *
+ ******************************************************************************/
+program MOBSTER { 
+	version MOBSTER_VERSION {
+
+		int SS_STARTUPRPCSERVICE( struct TChannelAddress )				= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )								= 2;
+		TComponentList LIST_DEVICES( void )								= 9;
+
+		int CSTR_STARTDEVICE( TDeviceDesc )								= 3;
+		int DSTR_REMOVEDEVICE( int )									= 7;
+
+		TDeviceDesc GETDEVICEINFO( int )								= 4;
+		TVarData GETDEVICELOG( int )									= 5;
+		int STOPDEVICE( int )											= 6;
+		int SETREMOTEUUADDRESS( struct TUUAddress )						= 10;
+	} = 1; 
+} = 0x34630201;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster_client_server_protocol.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* Switches
+*
+*/
+
+
+
+
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <memory.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#include <windows.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "mobster_client_server_protocol.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXOPTIONLENGTH		64
+#define IDTAG				"ID="
+
+
+/*******************************************************************************
+ *
+ * Prototypes
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * client_server_protocol_socket -- waits for a ID=xx string from the client and 
+ * replies with a SERVER(xx) string.
+ *
+ ******************************************************************************/
+int client_server_protocol( int aSock )
+{
+	char c;
+	int len, err, phoneid, bufflen = 0;
+	char buff[MAXOPTIONLENGTH];
+
+	// init buffer
+	memset( buff, 0, MAXOPTIONLENGTH );
+	
+	// the client should send it's ID
+	while( 1 ) {
+		
+		// receive the next byte
+		err = recv( aSock, &c, 1, 0 );
+		if( err <= 0 ) {
+			return -1;
+		}
+
+		// if the buffer is full then we have an error
+		if( bufflen == (MAXOPTIONLENGTH-1) ) {
+			return -1;
+		}
+
+		// add the byte to the buffer
+		buff[bufflen++] = c;
+
+		// if this byte is a 0x0d then we have the complete string
+		if( c == 0xd ) {
+			break;
+		}
+	}
+
+	// make sure this is the ID string
+	err = strncmp( buff, IDTAG, strlen(IDTAG) );
+	if( err != 0 ) {
+		return -1;
+	}
+
+	// now extract the ID
+	phoneid = atoi( &(buff[3]) );
+
+#ifdef SYSTEM_TEST_MP4
+	assert( !"Test" );
+#endif
+
+	// send the reply string -- blocking socket should send all data before returning
+	sprintf( buff, "SERVER(%d)", phoneid );
+	len = strlen(buff);
+	err = send( aSock, buff, len, 0 );
+	if( err != len ) {
+		return -1;
+	}
+
+	// done
+	return phoneid;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster_client_server_protocol.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* Switches
+*
+*/
+
+
+
+
+#ifndef __MOBSTER_CLIENT_SERVER_PROTOCOL_H__
+#define __MOBSTER_CLIENT_SERVER_PROTOCOL_H__
+
+/*******************************************************************************
+ *
+ * Interface
+ *
+ ******************************************************************************/
+int client_server_protocol( int aSock );
+
+
+#endif //__MOBSTER_CLIENT_SERVER_PROTOCOL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "./../MobsterRPCService/mobster.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_1(argp, clnt)
+	struct TChannelAddress *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_TChannelAddress, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+cstr_startdevice_1(argp, clnt)
+	TDeviceDesc *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_STARTDEVICE, xdr_TDeviceDesc, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+dstr_removedevice_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEDEVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TDeviceDesc *
+getdeviceinfo_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TDeviceDesc res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETDEVICEINFO, xdr_int, argp, xdr_TDeviceDesc, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TVarData *
+getdevicelog_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TVarData res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETDEVICELOG, xdr_int, argp, xdr_TVarData, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+stopdevice_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPDEVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setremoteuuaddress_1(argp, clnt)
+	struct TUUAddress *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETREMOTEUUADDRESS, xdr_TUUAddress, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "mobster.h"
+
+static void mobster_1();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+#ifdef WIN32
+	rpc_nt_init();
+#endif
+
+	(void)pmap_unset(MOBSTER, MOBSTER_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+	if (!svc_register(transp, MOBSTER, MOBSTER_VERSION, mobster_1, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (MOBSTER, MOBSTER_VERSION, udp).\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+	if (!svc_register(transp, MOBSTER, MOBSTER_VERSION, mobster_1, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (MOBSTER, MOBSTER_VERSION, tcp).\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+#ifdef WIN32
+	rpc_nt_exit();
+#endif
+	exit(1);
+}
+
+#ifdef MULTITHREAD
+struct call_params {
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+	void *arg;
+	char *(*local)();
+	bool_t (*xdr_argument)(), (*xdr_result)();
+};
+static void mobster_1_a ();
+#endif
+
+static void
+mobster_1(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		struct TChannelAddress ss_startuprpcservice_1_arg;
+		int sc_shutdownrpcservice_1_arg;
+		TDeviceDesc cstr_startdevice_1_arg;
+		int dstr_removedevice_1_arg;
+		int getdeviceinfo_1_arg;
+		int getdevicelog_1_arg;
+		int stopdevice_1_arg;
+		struct TUUAddress setremoteuuaddress_1_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+
+#ifdef MULTITHREAD
+	DWORD TID = 0;
+	HANDLE threadHandle = NULL;
+	struct call_params	*params;
+#endif
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_mobster_TChannelAddress;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_1;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_1;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_mobster_TComponentList;
+		local = (char *(*)()) list_devices_1;
+		break;
+
+	case CSTR_STARTDEVICE:
+		xdr_argument = xdr_mobster_TDeviceDesc;
+		xdr_result = xdr_int;
+		local = (char *(*)()) cstr_startdevice_1;
+		break;
+
+	case DSTR_REMOVEDEVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) dstr_removedevice_1;
+		break;
+
+	case GETDEVICEINFO:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mobster_TDeviceDesc;
+		local = (char *(*)()) getdeviceinfo_1;
+		break;
+
+	case GETDEVICELOG:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mobster_TVarData;
+		local = (char *(*)()) getdevicelog_1;
+		break;
+
+	case STOPDEVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) stopdevice_1;
+		break;
+
+	case SETREMOTEUUADDRESS:
+		xdr_argument = xdr_mobster_TUUAddress;
+		xdr_result = xdr_int;
+		local = (char *(*)()) setremoteuuaddress_1;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+
+#ifdef MULTITHREAD
+	params = (struct call_params*) malloc (sizeof(struct call_params));
+
+	params->rqstp = (struct svc_req*) malloc (sizeof(struct svc_req));
+	bcopy(rqstp, params->rqstp, sizeof(struct svc_req));
+
+	params->transp = transp;
+
+	params->arg = malloc (sizeof(argument));
+	bcopy(&argument, params->arg, sizeof(argument));
+
+	params->local = local;
+
+	params->xdr_argument = xdr_argument;
+	params->xdr_result = xdr_result;
+
+	threadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)mobster_1_a, params, 0, &TID);
+	if (!threadHandle)
+		mobster_1_a(&params);
+}
+
+static void
+mobster_1_a(params)
+struct call_params *params;
+{
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+	void *argument;
+	void (*destroy_proc)();
+
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+
+	argument = params->arg;
+	rqstp = params->rqstp;
+	transp = params->transp;
+	xdr_argument = params->xdr_argument;
+	xdr_result = params->xdr_result;
+	local = params->local;
+	destroy_proc = transp->xp_ops->xp_destroy;
+	transp->xp_ops->xp_destroy = xprt_unregister;
+#endif
+
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+#ifdef MULTITHREAD
+	free(params->rqstp);
+	free(params);
+#endif
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+#ifdef WIN32
+		rpc_nt_exit();
+#endif
+		exit(1);
+	}
+#ifdef MULTITHREAD
+	free(argument);
+	transp->xp_ops->xp_destroy = destroy_proc;
+#endif
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,447 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Mon Oct 06 10:55:15 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcMobster.h"
+#include "CSMobster.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSMobster> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_1( struct TChannelAddress *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSMobster>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcMobster::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_1( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcMobster::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_1( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMobster::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMobster::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	CSvcMobster::SetError( LIST_DEVICES, (void*)&rv, ERR_NONE );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startdevice
+ * 
+ ***************************************************************************************/
+int *cstr_startdevice_1( TDeviceDesc *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	CSMobster *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// create a new component instance
+	instance_key = iComponentManager->CreateInstance();
+	if( instance_key < 0 ) {
+		rv = instance_key;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->cstr_startdevice( *aArgs );
+	result = rv;
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	if( result != ERR_NONE ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == 0 );
+	} else { 
+		rv = instance_key;
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removedevice
+ * 
+ ***************************************************************************************/
+int *dstr_removedevice_1( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int internal_err;
+	int instance_key;
+	int should_delete = 1;
+	CSMobster *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// get the key for the instance from the args
+	instance_key = CSvcMobster::GetInstanceKeyFromArgs( DSTR_REMOVEDEVICE, (void*)aArgs );
+	if( instance_key < 0 ) {
+		rv = instance_key;
+		return &rv;
+	}
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->dstr_removedevice( *aArgs, &should_delete );
+
+	// it is illegal for the method to succeed but not delete the instance
+	assert( (rv != ERR_NONE) || (should_delete == 1) );
+
+	// delete the instance if requested
+	if( should_delete != 0 ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == ERR_NONE );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getdeviceinfo
+ * 
+ ***************************************************************************************/
+TDeviceDesc *getdeviceinfo_1( int *aArgs, CLIENT *aDutout )
+{
+	static TDeviceDesc rv;
+	int instance_key;
+	CSMobster *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMobster::SetError( GETDEVICEINFO, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMobster::SetError( GETDEVICEINFO, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMobster::GetInstanceKeyFromArgs( GETDEVICEINFO, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMobster::SetError( GETDEVICEINFO, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getdeviceinfo( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getdevicelog
+ * 
+ ***************************************************************************************/
+TVarData *getdevicelog_1( int *aArgs, CLIENT *aDutout )
+{
+	static TVarData rv;
+	int instance_key;
+	CSMobster *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMobster::SetError( GETDEVICELOG, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMobster::SetError( GETDEVICELOG, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMobster::GetInstanceKeyFromArgs( GETDEVICELOG, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMobster::SetError( GETDEVICELOG, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getdevicelog( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopdevice
+ * 
+ ***************************************************************************************/
+int *stopdevice_1( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_key;
+	CSMobster *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// set the return value to generic error
+	rv = ERR_FAILED_TO_RETRIEVE_KEY;
+
+	// get the key for the instance from the args
+	instance_key = CSvcMobster::GetInstanceKeyFromArgs( STOPDEVICE, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->stopdevice( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setremoteuuaddress
+ * 
+ ***************************************************************************************/
+int *setremoteuuaddress_1( struct TUUAddress *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_key;
+	CSMobster *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// set the return value to generic error
+	rv = ERR_FAILED_TO_RETRIEVE_KEY;
+
+	// get the key for the instance from the args
+	instance_key = CSvcMobster::GetInstanceKeyFromArgs( SETREMOTEUUADDRESS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->setremoteuuaddress( *aArgs );
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/MobsterRPCService/mobster_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "mobster.h"
+
+
+bool_t
+xdr_mobster_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TDatalinkLayer(xdrs, objp)
+	XDR *xdrs;
+	TDatalinkLayer *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TChannelStatus(xdrs, objp)
+	XDR *xdrs;
+	TChannelStatus *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TDeviceExitReason(xdrs, objp)
+	XDR *xdrs;
+	TDeviceExitReason *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TChannelAddress(xdrs, objp)
+	XDR *xdrs;
+	TChannelAddress *objp;
+{
+	if (!xdr_int(xdrs, &objp->iPort)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TUUAddress(xdrs, objp)
+	XDR *xdrs;
+	TUUAddress *objp;
+{
+	if (!xdr_int(xdrs, &objp->iDeviceID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRemoteAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRemotePort)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TDeviceDesc(xdrs, objp)
+	XDR *xdrs;
+	TDeviceDesc *objp;
+{
+	if (!xdr_mobster_TDatalinkLayer(xdrs, &objp->iDatalinkConfig)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iFilterConfig)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMTID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTEID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iLocalAirInterfacePort, MAXPORTLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iRemoteAirInterfaceAddress, MAXADDRLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iRemoteAirInterfacePort, MAXPORTLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_mobster_TChannelStatus(xdrs, &objp->iDeviceStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_mobster_TDeviceExitReason(xdrs, &objp->iDeviceExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDeviceExitSubReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDeviceExitDetail)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/PppdGateway/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,32 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../bin/pppdgateway
+INCLUDES=
+OBJECTS=	pppdgateway.o socket_helper.o
+LIBS= 		-lpthread
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS)
+	gcc -gstabs -Wall -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/PppdGateway/pppdgateway.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,336 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+//#define SYSTEM_TEST_MP5
+
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <assert.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <signal.h>
+#include <string.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "socket_helper.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define RECVBUFFSIZE      (4096*4)
+#define MAXIDSTR          64
+
+
+/*******************************************************************************
+ *
+ * Prototypes
+ *
+ ******************************************************************************/
+void *receive_ppp_frames( void *x );
+void *send_ppp_frames( void * );
+void closesocket( int sockfd );
+int do_client_server_protocol( int aMobsterDeviceID );
+
+
+/*******************************************************************************
+ *
+ * File-scope
+ *
+ ******************************************************************************/
+int sockfd;
+
+
+/*******************************************************************************
+ *
+ * Signal Handler
+ *
+ ******************************************************************************/
+void sigterm( int signum )
+{
+  pid_t mp = getpid();
+  fprintf( stderr, "PG: pppdgateway(%d) received a SIGTERM -- ignoring\n", mp );
+}
+
+
+/*******************************************************************************
+ *
+ * Main()
+ *
+ ******************************************************************************/
+int main( int argc, char *argv[] )
+{
+  int err;
+  int mobster_device_id = 0;
+  pthread_t threadhandle_send, threadhandle_recv;
+  struct sockaddr_in mobster_addr;
+  __sighandler_t oh;
+
+  // check args
+  if( argc != 4 ) {
+    fprintf( stderr, "usage: %s mobster_address mobster_port mobster_device_id\n", argv[0] );
+    return -1;
+  }
+  mobster_device_id = atoi(argv[3]);
+  fprintf( stderr, "PG: pppdgateway starting\n" );
+
+  // setup the signal handler -- note that we ignore SIGTERM! This is because if we shutdown on a SIGTERM we don't
+  // output the TERMREQ -- or receive the TERMACK. Therefore, we rely on the fact that when pppd wants to stop
+  // it will close stdin -- this will cause the output thread to stop -- it will also close the socket which
+  // will cause the input thread to stop -- then the main thread will exit
+  oh = signal( SIGTERM, sigterm );
+  if( oh == SIG_ERR ) {
+    fprintf( stderr, "PG: error registering signal handler (SIGTERM)\n" );
+    return -1;
+  }
+  oh = signal( SIGHUP, sigterm );
+  if( oh == SIG_ERR ) {
+    fprintf( stderr, "PG: error registering signal handler (SIGHUP)\n" );
+    return -1;
+  }
+
+  // create a TCP socket
+  sockfd = socket( AF_INET, SOCK_STREAM, 0 );
+  if( sockfd == -1 ) {
+    fprintf( stderr, "PG: failed to create socket, exiting.\n" );
+    return -1;
+  }
+
+  // create the address
+  mobster_addr = getsockaddr( argv[1], argv[2] );
+  if( mobster_addr.sin_addr.s_addr == 0 ) {
+    fprintf( stderr, "PG: invalid address (zero or couldn't resolve hostname), exiting.\n" );
+    closesocket( sockfd );
+    return -1;
+  }
+
+  // connect to mobster
+  err = connect( sockfd, (struct sockaddr*)&mobster_addr, sizeof(mobster_addr) );
+  if( err != 0 ) {
+    perror( "PG: connect() to server failed\n" );
+    closesocket( sockfd );
+    return -1;
+  }
+
+  // do the client server protocol - if there is an error the exit
+  err = do_client_server_protocol( mobster_device_id );
+  if( err != 0 ) {
+    fprintf( stderr, "PG: client/server protocol failed.\n" );
+    closesocket( sockfd );
+    return -1;
+  }
+    
+  // change the streams to unbuffered so that this exe doesn't add latency
+  err = setvbuf( stdout, NULL, _IONBF, 0 );
+  if( err != 0 ) {
+    fprintf( stderr, "PG: failed to set buffering on stdout (%d)\n", err );
+    closesocket( sockfd );
+    return -1;
+  }
+  err = setvbuf( stdin, NULL, _IONBF, 0 );
+  if( err != 0 ) {
+    fprintf( stderr, "PG: failed to set buffering on stdout (%d)\n", err );
+    closesocket( sockfd );
+    return -1;
+  }
+  err = setvbuf( stderr, NULL, _IONBF, 0 );
+  if( err != 0 ) {
+    fprintf( stderr, "PG: failed to set buffering on stdout (%d)\n", err );
+    closesocket( sockfd );
+    return -1;
+  }
+
+  // all the setup is done -- create the threads and let them do their stuff
+  err = pthread_create( &threadhandle_send, NULL, send_ppp_frames, 0 );
+  assert( err == 0 );
+  err = pthread_create( &threadhandle_recv, NULL, receive_ppp_frames, 0 );
+  assert( err == 0 );
+
+
+  // wait for them to exit
+  pthread_join( threadhandle_send, NULL );
+  pthread_join( threadhandle_recv, NULL );
+
+
+  // return
+  fprintf( stderr, "PG: pppdgateway has completed.\n" );
+  return 0;
+}
+
+  
+/*******************************************************************************
+ *
+ * receive_ppp_frames
+ *
+ ******************************************************************************/
+void *receive_ppp_frames( void *x )
+{
+  int recvcount, writecount;
+  char recvbuff[RECVBUFFSIZE];
+
+  // listen on the udp socket and send anything received to stdout -- no framing is ever done on the input channel
+  while( 1 ) {
+
+    // wait for some data -- on error print error, close the socket, and exit. Closing the socket means that the other thread will clean up and exit
+    recvcount = recv( sockfd, recvbuff, RECVBUFFSIZE, 0 );
+    if( recvcount == -1 ) {
+      fprintf( stderr, "PG: error occured while reading socket.\n" );
+      closesocket( sockfd );
+      pthread_exit( NULL );
+    }
+    //    fprintf( stderr, "PG: %d bytes incoming\n", recvcount );
+
+    // send the data to the pppd server    
+    writecount = fwrite( recvbuff, 1, recvcount, stdout );
+    if( writecount != recvcount ) {
+      fprintf( stderr, "PG: error occured while writing to stdout.\n" );
+      closesocket( sockfd );
+      pthread_exit( NULL );
+    }
+  }
+
+  // done
+  return NULL;
+}   
+
+
+/*******************************************************************************
+ *
+ * send_ppp_frames
+ *
+ ******************************************************************************/
+void *send_ppp_frames( void *x ) 
+{
+  int err;
+  int sendcount;
+  int c = 0;
+  
+  // listen on stdin for data and write it to the socket -- on error print an error, closesocket, and exit. 
+  while( 1 ) {
+
+    // read the next char
+    err = fread( &c, 1, 1, stdin );
+    if( err != 1 ) {
+      fprintf( stderr, "PG: error occured while reading from stdin.\n" );
+      closesocket( sockfd );
+      pthread_exit( NULL );
+    }
+    //    fprintf( stderr, "PG: %d bytes outgoing\n", err );
+
+    // write it to the socket
+    sendcount = send( sockfd, &c, 1, 0 );
+    if( sendcount != 1 ) {
+      fprintf( stderr, "PG: error occured while writing to the socket.\n" );
+      closesocket( sockfd );
+      pthread_exit( NULL );
+    }
+  }
+
+  // done 
+  return NULL;
+}
+
+
+/*******************************************************************************
+ *
+ * closesocket
+ *
+ ******************************************************************************/
+void closesocket( int sockfd )
+{
+  shutdown( sockfd, SHUT_RDWR );
+  close( sockfd );
+}
+
+
+/*******************************************************************************
+ *
+ * do_client_server_protocol()
+ *
+ ******************************************************************************/
+int do_client_server_protocol( int aMobsterDeviceID )
+{
+  char c;
+  int len, expected_length, i, err;
+  char idstr[MAXIDSTR];
+  char rpstr[MAXIDSTR];
+
+  // construct the client string for the csprotocol
+  snprintf( idstr, MAXIDSTR, "ID=%d", aMobsterDeviceID );
+  len = strlen(idstr);
+  idstr[len] = 0x0d;
+  idstr[len+1] = 0;
+
+#ifdef SYSTEM_TEST_MP5
+  assert( !"TEST" );
+#endif
+
+  // send the string
+  err = send( sockfd, idstr, len+1, 0 );
+  if( err != (len+1) ) {
+    fprintf( stderr, "PG: failed to write id string, exiting.\n" );
+    return -1;
+  }
+  
+  // construct the expected reply string to get the expected length
+  snprintf( rpstr, MAXIDSTR, "SERVER(%d)", aMobsterDeviceID );
+  expected_length = strlen(rpstr);
+
+  // now read until there 
+  for( i = 0; ; i++ ) {
+
+    // read a byte
+    err = recv( sockfd, &c, 1, 0 );
+    if( err == -1 ) {
+      fprintf( stderr, "PG: failed to read reply string (%d, %d).\n", err, errno );
+      return -1;
+    }
+
+    // check for a mismatch
+    if( c != rpstr[i] ) {
+      fprintf( stderr, "PG: unexpected character from server.\n" );
+      return -1;
+    }
+
+    // see if we've matched all chars
+    if( (i+1) == expected_length ) {
+      break;
+    }
+  }
+
+  // done - success
+  return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/PppdGateway/socket_helper.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "socket_helper.h"
+
+/*******************************************************************************
+ *
+ * Definition
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Implementation
+ *
+ ******************************************************************************/
+struct sockaddr_in getsockaddr( const char* ip, const char* port)
+{	
+	int isip;
+	struct sockaddr_in sockaddr;
+	int b1, b2, b3, b4;
+	unsigned long addr = 0;
+
+	// set the basics
+	sockaddr.sin_family = AF_INET;		
+	sockaddr.sin_port = htons(atoi(port));
+
+	// if IP is NULL then set to INADDR_ANY otherwise work it out
+	if( ip == NULL ) {
+#ifdef WIN32
+		sockaddr.sin_addr.S_un.S_addr = INADDR_ANY;
+#else
+		sockaddr.sin_addr.s_addr = INADDR_ANY;
+#endif
+		return sockaddr;
+	} 
+
+	// otherwise we see if this is an IP address
+	isip = is_ip_address( ip );
+	if( isip ) {
+		sscanf( ip, "%d.%d.%d.%d", &b1, &b2, &b3,&b4 );
+		addr = ((b1<<24)&0xFF000000);
+		addr |= ((b2<<16)&0x00FF0000);
+		addr |= ((b3<<8)&0x0000FF00);
+		addr |= ((b4)&0x000000FF);
+#ifdef WIN32
+		sockaddr.sin_addr.S_un.S_addr = htonl(addr);
+#else
+		sockaddr.sin_addr.s_addr = htonl(addr);
+#endif
+
+	} else {
+		struct hostent *hp = gethostbyname(ip);
+		memcpy(&sockaddr.sin_addr,hp->h_addr,hp->h_length); 	
+	}
+
+	return sockaddr;
+}
+
+int is_ip_address( const char* aAddr )
+{
+  int i;
+  int dot_count = 0;
+
+  // Our method for checking whether this is an IP address is to check that
+  // we have digits and points (3 to be precise).
+  for( i = 0; aAddr[i] != 0; i++ ) {
+    if( (aAddr[i] != '.') && (isdigit(aAddr[i]) == 0) ) {
+      return 0;
+    }
+    if( aAddr[i] == '.' ) {
+      dot_count++;
+      if( dot_count > 3 ) {
+	return 0;
+      }
+    }
+  }
+  return 1;
+}
+
+/*******************************************************************************
+ *
+ * GetSocketError - gets the last socket error - for xdev
+ *
+ ******************************************************************************/
+int GetSocketError()
+{
+#ifdef WIN32
+	return WSAGetLastError();
+#else
+	return errno;
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/PppdGateway/socket_helper.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+#ifndef __SOCKET_HELPER_H__
+#define __SOCKET_HELPER_H__
+
+/*******************************************************************************
+ *
+ * Interface
+ *
+ ******************************************************************************/
+struct sockaddr_in getsockaddr( const char* ip, const char* port);
+int is_ip_address( const char* aAddr );
+int GetSocketError();
+
+#endif // __SOCKET_HELPER_H__
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ProcessLibrary/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=		../../BinInternal/libproc.a
+INCLUDES=
+CFLAGS=		-Wall -gstabs #-ftest-coverage -fprofile-arcs
+
+OBJECTS=	proclib_linux.o
+
+LIBS=
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS)
+	ar -rcs $(TARGET) $(OBJECTS)
+
+%.o:	%.c
+	gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ *.bbg *.bb *.gcov *.da 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ProcessLibrary/ProcessLibrary.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,113 @@
+# Microsoft Developer Studio Project File - Name="ProcessLibrary" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=ProcessLibrary - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "ProcessLibrary.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "ProcessLibrary.mak" CFG="ProcessLibrary - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "ProcessLibrary - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "ProcessLibrary - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "ProcessLibrary - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "ProcessLibrary - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libproc.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "ProcessLibrary - Win32 Release"
+# Name "ProcessLibrary - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\proclib_linux.cpp
+
+!IF  "$(CFG)" == "ProcessLibrary - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "ProcessLibrary - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\proclib_windows.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\proclib.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ProcessLibrary/ProcessLibrary.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "ProcessLibrary"=.\ProcessLibrary.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ProcessLibrary/proclib.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* procexec.h
+* Process execution class which can be used to execute a process and
+* optionally record all the processes output.
+*
+*/
+
+
+#ifndef __CAPROCESS_H__
+#define __CAPROCESS_H__
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+//
+// System Includes
+//
+/////////////////////////////////////////////////////////////////////////////////////////////
+#include <string>
+using namespace std;
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Definitions
+//
+/////////////////////////////////////////////////////////////////////////////////////////////
+typedef enum { 
+  CAE_NONE,
+  CAE_INVALID_STATE,
+  CAE_FAILED_TO_CREATE_PIPE,
+  CAE_FORK_FAILED,
+  CAE_FAILED_TO_SET_NONBLOCKING,
+  CAE_SIGNAL_FAILED,
+  CAE_TIMEOUT,
+  CAE_WAITPID_FAILED,
+  CAE_SELECT_FAILED,
+  CAE_READ_FAILED,
+} TCAProcessError;
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Types
+//
+/////////////////////////////////////////////////////////////////////////////////////////////
+typedef enum {
+  PS_INVALID,
+  PS_INIT,
+  PS_STARTED,
+  PS_STOPPED,
+  PS_ABANDONNED
+} TProcessStatus;
+
+typedef enum {
+  // If process is in PS_INIT or PS_STARTED state then the value is invalid
+  ER_INVALID,
+
+  // If process is in PS_STOPPED state then it must be one of the 
+  ER_UNKNOWN,
+  ER_EXITED,
+  ER_SIGNALLED,
+
+  // If process is PS_ABANDONED state then it must be one of the following. Processes 
+  // are abandonned if something goes wrong that we can't recover from.
+  ER_SIGNALFAILED,
+  ER_STOPFAILED,
+  ER_WAITPIDFAILED
+} TProcessExitReason;
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+//
+// CAProcess definition
+//
+/////////////////////////////////////////////////////////////////////////////////////////////
+class CAProcess
+{
+ public:
+
+  CAProcess();
+  ~CAProcess();
+  
+  // This function will run the process and wait for it to finish. It is intended as a single call 
+  // function.  Use the other functions for more control of the process. Do not mix the two.
+  // Result:
+  //          CAE_FORK_FAILED / CAE_FAILED_TO_CREATE_PIPE / CAE_FAILED_TO_SET_NON_BLOCKING - PS_INIT
+  TCAProcessError Execute( const char *aCommand, int *aErrorCode, int aTimeoutInMilliseconds = -1, 
+			   string *aStandardOutput = NULL, string *aStandardError = NULL );
+
+  // The basic process control functions
+  TCAProcessError StartProcess( const char *aCommand, int *aErrorCode, bool aRecordStdOut = true, 
+				bool aRecordStdErr = true, bool aMakeNewProcessGroup = false );
+  TCAProcessError RequestStop( int aSignal );
+  TCAProcessError GetProcessStatus( TProcessStatus *aProcessStatus );
+  TCAProcessError WaitForProcessToTerminate( int aMaxWait );
+
+  // Poll for new output on either stdout or stdin. If there is no new data then the method will
+  // wait up to aMaxWait seconds for new data to show up. The Get- methods will return all data
+  // received since the last call. This data will then be removed from the object's buffers.
+  TCAProcessError PollProcessForNewOutput( int aMaxWait, int *aStandardOutputRead, int *aStandardErrorRead );
+  int GetRecordedStandardOutput( string *aStdout, int *aReadError );
+  int GetRecordedStandardError( string *aStdout, int *aReadError );
+
+  // Accessor methods
+  string GetCommandString();
+  TCAProcessError GetExitReason( TProcessExitReason *aExitReason );
+  TCAProcessError GetExitCode( int *aExitCode );
+  
+ private:
+  // help methods
+  TCAProcessError CreatePipes( int *aErrorCode );  
+  void ClosePipes();
+  void ClosePipePair( int *aPipes );
+  void ClosePipeDesc( int *aPipeDescriptor );
+  TProcessExitReason GetExitReasonFromStatus( int aStatus, int *aExitCode );
+  TCAProcessError ReadOutput( int *aFileDes, string *aBuffer, bool aStoreFlag, int *aReadError );
+  TCAProcessError InternalPollProcessForNewOutput( int aMaxWait, int *aStandardOutputRead, int *aStandardErrorRead );
+
+  // state variables
+  TProcessStatus iProcessStatus;
+
+  // information variables
+  string *iCommand;
+  int  iPID;
+  bool iRecordStdOut;
+  bool iRecordStdErr;
+  TProcessExitReason iProcessExitReason;
+  int iProcessExitCode;
+  int iReadStdoutError;
+  int iReadStderrError;
+
+  // File descriptors for process output
+  int iStdInPipe[2];
+  int iStdOutPipe[2];
+  int iStdErrPipe[2];
+
+  // Current output of the process.
+  string iRecordedStdOut;
+  string iRecordedStdErr;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ProcessLibrary/proclib_linux.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,835 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <time.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "proclib.h"
+#include "../include/standard_unix.h"
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+#ifdef UT10
+#undef fork
+#define fork() (-1)
+#endif
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define INVALID_PIPE_DESC           (-1)
+#define INVALID_PID                 (0)
+#define READ_BUFFER_SIZE            (128)
+#define EXECUTE_PAUSE_PERIOD        (100000)
+
+
+/*******************************************************************************
+ *
+ * PUBLIC: Constructor
+ *
+ ******************************************************************************/
+CAProcess::CAProcess( void )
+{
+  // initialise all variables
+  iCommand = NULL;
+  iProcessStatus = PS_INIT;
+  iProcessExitReason = ER_INVALID;
+  iProcessExitCode = 0;
+  iPID = INVALID_PID;
+  iRecordStdOut = false;
+  iRecordStdErr = false;
+  iStdInPipe[0] = iStdInPipe[1] = INVALID_PIPE_DESC;
+  iStdOutPipe[0] = iStdOutPipe[1] = INVALID_PIPE_DESC;
+  iStdErrPipe[0] = iStdErrPipe[1] = INVALID_PIPE_DESC;
+  iReadStdoutError = 0;
+  iReadStderrError = 0;
+}
+
+/*******************************************************************************
+ *
+ * PUBLIC: Destructor 
+ *
+ ******************************************************************************/
+CAProcess::~CAProcess()
+{
+  // I don't allow the object to be destroyed in the PS_STARTED state
+  assert( iProcessStatus != PS_STARTED );
+
+  // clean up any handles
+  if( iCommand != NULL ) {
+    delete iCommand;
+    iCommand = NULL;
+  }
+  ClosePipes();
+} 
+
+/*******************************************************************************
+ *
+ * SECTION-1: PROCESS CONTROL 
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * PUBLIC: StartProcess 
+ *
+ ******************************************************************************/
+TCAProcessError CAProcess::StartProcess( const char *aCommand, int *aErrorCode, bool aRecordStdOut, 
+					 bool aRecordStdErr, bool aMakeNewProcessGroup )
+{
+  int err;
+
+  // check params 
+  assert( aCommand != NULL );
+  assert( aErrorCode != NULL );
+  *aErrorCode = 0;
+
+  // make sure the process is in the init state
+  if( iProcessStatus != PS_INIT ) {
+    return CAE_INVALID_STATE;
+  }
+
+  // verify that the recorded output is empty -- just checking no silly buggers
+  assert( iRecordedStdOut.empty() == true );
+  assert( iRecordedStdErr.empty() == true );
+
+  // create the pipes that will be setup as the child process's input and output channels. Make the reading 
+  err = CreatePipes( aErrorCode );
+  if( err != CAE_NONE ) {
+    return (TCAProcessError)err;
+  }
+
+  // flush all stream before forking (AE: why???)
+  fflush( NULL );
+
+  // fork now
+  iPID = fork();
+
+  // if an error occurred then return failed
+  if( iPID == -1 ) {
+    ClosePipes();
+    iPID = INVALID_PID;
+    *aErrorCode = errno;
+    return CAE_FORK_FAILED;
+  }
+
+  // if success and we are the parent then...
+  if( iPID > 0 ) { 
+
+    // Close the write end of the output pipes and the read end of the input pipe
+  	ClosePipeDesc( &(iStdInPipe[0]) );
+  	ClosePipeDesc( &(iStdOutPipe[1]) );
+  	ClosePipeDesc( &(iStdErrPipe[1]) );
+
+    // Update the state
+    iProcessStatus = PS_STARTED;
+    iCommand = new string( aCommand );
+    iRecordStdOut = aRecordStdOut;
+    iRecordStdErr = aRecordStdErr;
+    
+    // done
+    return CAE_NONE;
+  }
+
+  // if success and we are the child then...
+  if( iPID == 0 ) {
+
+    // if requested - put the process in it's own process group
+    if( aMakeNewProcessGroup ) {
+      err = setpgid( 0, 0 );
+      if( err != 0 ) {
+        fprintf( stderr, "WARNING: failed to setpgid for process %d - %s (%d).\n", getpid(), strerror(errno), errno );
+      }
+    } 
+
+    // close the write end of stdin and make the read end desc 0
+  	ClosePipeDesc( &(iStdInPipe[1]) );
+    close( stdin->_fileno );
+    err = dup( iStdInPipe[0] );
+    assert( err == (stdin->_fileno) );
+
+    // close the read end of stdout and make the write end desc 1
+    if( aRecordStdOut ) {
+      ClosePipeDesc( &(iStdOutPipe[0]) );
+      close( stdout->_fileno );
+      err = dup( iStdOutPipe[1] );
+      assert( err == (stdout->_fileno) );
+    }
+
+    // close the read end of stderr and make the write end desc 2
+    if( aRecordStdErr ) {
+      ClosePipeDesc( &(iStdErrPipe[0]) );
+      close( stderr->_fileno );
+      err = dup( iStdErrPipe[1] );
+      assert( err == (stderr->_fileno) );
+    }
+
+    // NOTE: A problem exists that because we have inherited all the descriptors
+    // form our parent, any descriptors that are subsequently closed by the
+    // parent will still be open until the child exits.
+    
+    // exec the target image. There is a choice here of whether to exec the target
+    // directly or to use /bin/sh. The tradeoff is that /bin/sh gives you argument
+    // parsing -- but exec will not fail with an invalid target because /bin/sh
+    // is always available to exec. Currently I'm choosing the former but you 
+    // should be aware of the tradeoff.m
+    execl("/bin/sh", "csh", "-c", aCommand, NULL);
+    //execl( aCommand, NULL );
+
+    // The call to execl() failed.  The following error message will be
+    // sent back as if it came from the process (on stderr). The process
+    // then exits.
+    fprintf( stderr, "ERROR: execl() failed with error '%s' (%d)\n", strerror(errno), errno );
+    ClosePipeDesc( &(iStdInPipe[0]) );
+    ClosePipeDesc( &(iStdOutPipe[1]) );
+    ClosePipeDesc( &(iStdErrPipe[1]) );
+    exit( -1 );
+  }
+
+  // should never get here
+  assert( !"Invalid code path" );
+  return CAE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC: RequestStop 
+ *
+ ******************************************************************************/
+TCAProcessError CAProcess::RequestStop( int aSignal )
+{
+  int err;
+
+  // get the state
+  err = GetProcessStatus( NULL );
+  assert( err == CAE_NONE );
+
+  // check the state
+  if( iProcessStatus != PS_STARTED ) {
+    return CAE_INVALID_STATE;
+  }
+
+  // send the specified signal to the process
+  err = kill( iPID, aSignal );
+  
+  // if kill() fails then we abandon the process -- STATE TRANSITION
+  if( err != 0 ) {
+    iProcessStatus = PS_ABANDONNED;
+    iProcessExitReason = ER_SIGNALFAILED;
+    iProcessExitCode = errno;
+    ClosePipes();
+    return CAE_SIGNAL_FAILED;
+  }
+
+  // otherwise all is ok
+  return CAE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC: GetProcessStatus
+ *
+ ******************************************************************************/
+TCAProcessError CAProcess::GetProcessStatus( TProcessStatus *aProcessStatus )
+{
+  int err;
+  int status;
+
+  // if the process is in the PS_STARTED state then we have to verify that it is still running
+  if( iProcessStatus == PS_STARTED ) {
+
+    // see if the process is still running 
+    assert( iPID > 0 );
+    err = waitpid( iPID, &status, WNOHANG );
+
+    // if an error occured then transition from started to abandonned state
+    if( err == -1 ) {
+      iProcessStatus = PS_ABANDONNED;
+      iProcessExitReason = ER_WAITPIDFAILED;
+      iProcessExitCode = errno;
+    }
+
+    // if the process is still running then no change
+    if( err == 0 ) {
+    }
+
+    // if the process has finished then transition from started to stopped state
+    if( err > 0 ) {
+      iProcessStatus = PS_STOPPED;
+      iProcessExitReason = GetExitReasonFromStatus( status, &iProcessExitCode );
+    }
+  }      
+    
+  // if the passed pointer is non-null then we return the status
+  if( aProcessStatus != NULL ) {
+    *aProcessStatus = iProcessStatus;
+  }
+
+  // done
+  return CAE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC: WaitForProcessToTerminate
+ *
+ ******************************************************************************/
+TCAProcessError CAProcess::WaitForProcessToTerminate( int aMaxWait )
+{
+  int err;
+  int status;
+  int i;
+
+  // if the process isn't in the PS_STARTED state then this call is invalid -- note
+  // that GetProcessStatus is not used to update the status here since if the 
+  // process has stopped we want this to be caught in the waitpid below, not here.
+  if( iProcessStatus != PS_STARTED ) {
+    return CAE_INVALID_STATE;
+  }
+
+  // Wait for the process. We can't just do a blocking wait since the stdout/stderr
+  // pipes would overflow and people wouldn't be able to read the output as 
+  // expected when the process has terminated. So we do a non-blocking wait in a loop.
+  for( i = 0; (aMaxWait == -1) || (i < aMaxWait); i++ ) {
+    
+    // see if the process has finished
+    err = waitpid( iPID, &status, WNOHANG );
+    if( err != 0 ) {
+      break;
+    }
+
+    // see if there is any data to read in from the pipes -- this will transfer the data 
+    // from the pipes to the internal buffers
+    InternalPollProcessForNewOutput( 0, NULL, NULL );
+  }
+
+  // see if we've timedout
+  if( err == 0 ) {
+    assert( i == aMaxWait );
+    return CAE_TIMEOUT;
+  }
+   
+  // if the call failed otherwise we abandon the process
+  if( err == -1 ) {
+    iProcessStatus = PS_ABANDONNED;
+    iProcessExitReason = ER_WAITPIDFAILED;
+    iProcessExitCode = errno;
+    return CAE_WAITPID_FAILED;
+  }
+
+  // otherwise everything is good and we have stopped the process
+  assert( err > 0 );
+  iProcessStatus = PS_STOPPED;
+  iProcessExitReason = GetExitReasonFromStatus( status, &iProcessExitCode );
+  return CAE_NONE;
+}
+
+/*******************************************************************************
+ *
+ * PUBLIC: Execute() 
+ *
+ ******************************************************************************/
+TCAProcessError CAProcess::Execute( const char *aCommand, int *aErrorCode, int aTimeoutInMilliseconds, string *aStandardOutput, 
+				    string *aStandardError )
+{
+	TCAProcessError err;
+	int i, stdout_bytes_read, stderr_bytes_read, errcode, max_iterations, timeout_in_microseconds;
+	TProcessStatus pstatus;
+	bool record_std_out, record_std_err;
+	struct timespec pause_period = { 0, EXECUTE_PAUSE_PERIOD };
+
+	// validate params
+	assert( aCommand != NULL );
+	assert( aErrorCode != NULL );
+	record_std_out = (aStandardOutput != NULL);
+	record_std_err = (aStandardError != NULL);
+	
+	// start the process
+	err = StartProcess( aCommand, aErrorCode, record_std_out, record_std_err, false );
+	if( err != CAE_NONE ) {
+		return err;
+	}
+
+	// work out the maximum number of iterations
+	timeout_in_microseconds = aTimeoutInMilliseconds * 1000;
+	max_iterations = (timeout_in_microseconds / EXECUTE_PAUSE_PERIOD);
+	//	fprintf( stderr, "DEBUG: timeout_in_micro = %d, pause_period = %d, timeout = %d, max_iterations = %d\n", 
+	//		 timeout_in_microseconds, EXECUTE_PAUSE_PERIOD, aTimeoutInMilliseconds, max_iterations );
+
+	// wait for the process to exit - store the output
+	for( i = 0; (i < max_iterations) || (aTimeoutInMilliseconds == -1); i++ ) {
+
+		// check the status of the process 
+		err = GetProcessStatus( &pstatus );
+		assert( err == CAE_NONE );
+
+		// sanity check on the status
+		assert( (pstatus != PS_INVALID) && (pstatus != PS_INIT) );
+
+		// if the status isn't PS_STARTED then we exit
+		if( pstatus != PS_STARTED ) {
+			break;
+		}
+
+		// get any new output - errors are ignored
+		if( record_std_out || record_std_err ) {
+			PollProcessForNewOutput( 0, &stdout_bytes_read, &stderr_bytes_read );
+			GetRecordedStandardOutput( aStandardOutput, &errcode );
+			GetRecordedStandardError( aStandardError, &errcode );
+		}
+
+		// now wait for one second and then lets do it all again!!
+		nanosleep( &pause_period, NULL );
+	}
+
+	// get the current status
+	err = GetProcessStatus( &pstatus );
+	assert( err == CAE_NONE );
+
+	// if we are still running then send a kill signal and wait to exit
+	if( pstatus == PS_STARTED ) {
+		err = RequestStop( SIGKILL );
+		if( (err != CAE_NONE) && (err != CAE_INVALID_STATE) ) {
+			return err;
+		}
+		err = WaitForProcessToTerminate( -1 );
+		if( err != CAE_NONE ) {
+			return err;
+		}
+	}
+
+	// get any last minute output
+	if( record_std_out || record_std_err ) {
+	  PollProcessForNewOutput( 0, &stdout_bytes_read, &stderr_bytes_read );
+	  GetRecordedStandardOutput( aStandardOutput, &errcode );
+	  GetRecordedStandardError( aStandardError, &errcode );
+	}
+	
+	// we have to return an indication of whether the process timed out
+	return ((i == max_iterations) ? CAE_TIMEOUT : CAE_NONE);
+}
+
+
+/*******************************************************************************
+ *
+ * SECTION-2: DATA CONTROL 
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * PUBLIC: PollProcessForNewOutput. Polls the executing process for new output.
+ * Any output is then transferred to the internal buffers.
+ *
+ ******************************************************************************/
+TCAProcessError CAProcess::PollProcessForNewOutput( int aMaxWait, int *aStandardOutputRead, int *aStandardErrorRead )
+{
+  GetProcessStatus( NULL );
+  if( iProcessStatus == PS_INIT ) {
+    return CAE_INVALID_STATE;
+  }
+  return InternalPollProcessForNewOutput( aMaxWait, aStandardOutputRead, aStandardErrorRead );
+}
+
+TCAProcessError CAProcess::InternalPollProcessForNewOutput( int aMaxWait, int *aStandardOutputRead, int *aStandardErrorRead )
+{
+    struct timeval maxWait;
+    fd_set readset;
+    int fdsToProcess;
+    int is_set;
+    int err_stdout = 0;
+    int err_stderr = 0;
+
+    // initialise the out params
+    if( aStandardOutputRead != NULL ) {
+      *aStandardOutputRead = 0;
+    }
+    if( aStandardErrorRead != NULL ) {
+      *aStandardErrorRead = 0;
+    }
+
+	// make sure one of the pipes is still open
+	if( (iStdOutPipe[0] == INVALID_PIPE_DESC) && (iStdErrPipe[0] == INVALID_PIPE_DESC) ) {
+		return CAE_NONE;
+	}
+
+	// Perform a select (of upto the maximum allowed time) and read in the available data.
+    FD_ZERO( &readset );
+	if( iStdOutPipe[0] != INVALID_PIPE_DESC ) {
+	    FD_SET( iStdOutPipe[0], &readset );
+	}
+	if( iStdErrPipe[0] != INVALID_PIPE_DESC ) {
+	    FD_SET( iStdErrPipe[0], &readset );
+	}
+    maxWait.tv_sec = aMaxWait;
+    maxWait.tv_usec = 0;
+    fdsToProcess = select( FD_SETSIZE, &readset, NULL, NULL, &maxWait );
+    if( fdsToProcess < 0 ) {
+      iReadStdoutError = iReadStderrError = errno;
+      return CAE_SELECT_FAILED;
+    }
+
+    // If there is no data to read then exit
+    if( fdsToProcess == 0 ) {
+      return CAE_NONE;
+    }
+
+    // Read the stdout pipe
+	if( iStdOutPipe[0] != INVALID_PIPE_DESC ) {
+	    is_set = FD_ISSET( iStdOutPipe[0], &readset );
+		if( is_set != 0 ) {
+			err_stdout = ReadOutput( &(iStdOutPipe[0]), &iRecordedStdOut, iRecordStdOut, &iReadStdoutError );
+			if( aStandardOutputRead != NULL ) {
+				*aStandardOutputRead = iRecordedStdOut.length();
+			}
+		}
+    }
+
+    // Read the stderr pipe
+	if( iStdErrPipe[0] != INVALID_PIPE_DESC ) {
+	    is_set = FD_ISSET( iStdErrPipe[0], &readset );
+		if( is_set != 0 ) { 
+			err_stderr = ReadOutput( &(iStdErrPipe[0]), &iRecordedStdErr, iRecordStdErr, &iReadStderrError );
+			if( aStandardErrorRead != NULL ) {
+				*aStandardErrorRead = iRecordedStdErr.length();
+			}
+		}
+    }
+    
+    // If one of the reads returned an error then return this
+    if( (err_stdout != 0) || (err_stderr != 0) ) {
+      return CAE_READ_FAILED;
+    }
+    return CAE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC: GetRecordedStandardOutput
+ *
+ ******************************************************************************/
+int CAProcess::GetRecordedStandardOutput( string *aStdout, int *aReadError )
+{
+  // validate params
+  assert( aReadError != NULL );
+  if( aStdout == NULL ) {
+    return 0;
+  }
+
+  // append a copy of the stored data to the passed string
+  (*aStdout) += iRecordedStdOut;
+
+  // clear the current string
+  iRecordedStdOut.erase( 0, iRecordedStdOut.length() );
+
+  // set the read error 
+  *aReadError = iReadStdoutError;
+  iReadStdoutError = 0;
+
+  // return the number of bytes read
+  return aStdout->size();
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC: GetRecordedStandardError
+ *
+ ******************************************************************************/
+int CAProcess::GetRecordedStandardError( string *aStdErr, int *aReadError )
+{
+  // validate params
+  assert( aReadError != NULL );
+  if( aStdErr == NULL ) {
+    return 0;
+  }
+  
+  // append a copy of the stored data to the passed string
+  (*aStdErr) += iRecordedStdErr;
+
+  // clear the current string
+  iRecordedStdErr.erase( 0, iRecordedStdErr.length() );
+
+  // set the read error 
+  *aReadError = iReadStderrError;
+  iReadStderrError = 0;
+
+  // return the number of bytes read
+  return aStdErr->size();
+}
+
+
+/*******************************************************************************
+ *
+ * SECTION-3: General Accessors
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * PUBLIC: GetCommandString
+ *
+ ******************************************************************************/
+string CAProcess::GetCommandString()
+{
+  string cmd;
+  if( iProcessStatus == PS_INIT ) {
+    return cmd;
+  }
+  cmd = *iCommand;
+  return cmd;
+}
+
+/*******************************************************************************
+ *
+ * PUBLIC: GetExitReason
+ *
+ ******************************************************************************/  
+TCAProcessError CAProcess::GetExitReason( TProcessExitReason *aExitReason )
+{
+  // check the state -- otherwise this is not valid
+  if( (iProcessStatus != PS_STOPPED) && (iProcessStatus != PS_ABANDONNED) ) {
+    return CAE_INVALID_STATE;
+  }
+
+  // set the value
+  if( aExitReason != NULL ) {
+    *aExitReason = iProcessExitReason;
+  }
+ 
+  // done
+  return CAE_NONE;
+}
+
+/*******************************************************************************
+ *
+ * PUBLIC: GetExitCode
+ *
+ ******************************************************************************/  
+TCAProcessError CAProcess::GetExitCode( int *aExitCode )
+{
+  // check the state -- otherwise this is not valid
+  if( (iProcessStatus != PS_STOPPED) && (iProcessStatus != PS_ABANDONNED) ) {
+    return CAE_INVALID_STATE;
+  }
+
+  // set the value
+  if( aExitCode != NULL ) {
+    *aExitCode = iProcessExitCode;
+  }
+ 
+  // done
+  return CAE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * SECTION-4: Helpers
+ *
+ ******************************************************************************/  
+
+/*******************************************************************************
+ *
+ * PRIVATE: GetExitReasonFromStatus
+ *
+ ******************************************************************************/
+TProcessExitReason CAProcess::GetExitReasonFromStatus( int aStatus, int *aExitCode )
+{
+  assert( aExitCode != NULL );
+  if( WIFEXITED(aStatus) ) {
+    *aExitCode = WEXITSTATUS(aStatus);
+    return ER_EXITED;
+  }
+  if( WIFSIGNALED(aStatus) ) {
+    *aExitCode = WTERMSIG(aStatus);
+    return ER_SIGNALLED;
+  }
+  return ER_UNKNOWN;
+}
+
+/*******************************************************************************
+ *
+ * PRIVATE: ReadOutput
+ *
+ ******************************************************************************/  
+TCAProcessError CAProcess::ReadOutput( int *aFileDes, string *aBuffer, bool aStoreFlag, int *aReadError )
+{
+    char buff[READ_BUFFER_SIZE];
+    int bytesRead;
+
+    // check params
+    assert( aBuffer != NULL );
+    assert( aReadError != NULL );
+    assert( aFileDes != NULL );
+
+    // read until there is nothing left to read
+    while( true ) {
+
+      // read
+      bytesRead = read( (*aFileDes), &buff, READ_BUFFER_SIZE-1 );
+      
+      // null-terminate the buffer
+      if( bytesRead > 0 ) {
+	buff[bytesRead] = 0;
+      }
+
+      // temporarily unavailable resource is not an error 
+      if( (bytesRead == -1) && (errno == EAGAIN) ) {
+	return CAE_NONE;
+      }
+
+      // check for error 
+      if( bytesRead == -1 ) {
+	fprintf( stderr, "DEBUG: read() returned error %s\n", strerror(errno) );
+	*aReadError = errno;
+	return CAE_READ_FAILED;
+      }
+
+      // check for no more data -- if this is the case then close the pipe
+      if( bytesRead == 0 ) {
+	ClosePipeDesc( aFileDes );
+	return CAE_NONE;
+      }
+
+      // store the data in the object if requested 
+      if( aStoreFlag ) {
+	fflush( stderr );
+	(*aBuffer) += buff;
+      }
+    }
+ 
+    // should never get here
+    assert( !"Invalid code path" );
+    return CAE_NONE;
+}
+
+/*******************************************************************************
+ *
+ * PRIVATE: CreatePipes / ClosePipes / ClosePipePair
+ *
+ ******************************************************************************/
+TCAProcessError CAProcess::CreatePipes( int *aErrorCode )
+{
+  int err;
+  int flags;
+
+  // check params
+  assert( aErrorCode != NULL );
+
+  // create the stdin pipe
+  err = pipe( iStdInPipe );
+  if( err != 0 ) {
+    *aErrorCode = errno;
+    return CAE_FAILED_TO_CREATE_PIPE;
+  }
+
+  // create the stdout pipe
+  err = pipe( iStdOutPipe );
+  if( err != 0 ) {
+    ClosePipes();
+    *aErrorCode = errno;
+    return CAE_FAILED_TO_CREATE_PIPE;
+  }
+
+  // create the stderr pipe
+  err = pipe( iStdErrPipe );
+  if( err != 0 ) {
+    ClosePipes();
+    *aErrorCode = errno;
+    return CAE_FAILED_TO_CREATE_PIPE;
+  }
+
+  // make the read end of the stdout pipe non-blocking
+  flags = fcntl( iStdOutPipe[0], F_GETFL, 0 );
+  flags |= O_NONBLOCK;
+  err = fcntl( iStdOutPipe[0], F_SETFL, flags );
+  if( err != 0 ) {
+    ClosePipes();
+    *aErrorCode = errno;
+    return CAE_FAILED_TO_SET_NONBLOCKING;
+  }
+
+  // make the read end of the stderr pipe non-blocking    
+  flags = fcntl( iStdErrPipe[0], F_GETFL, 0 );
+  flags |= O_NONBLOCK;
+  err = fcntl( iStdErrPipe[0], F_SETFL, flags );
+  if( err != 0 ) {
+    ClosePipes();
+    *aErrorCode = errno;
+    return CAE_FAILED_TO_SET_NONBLOCKING;
+  }
+
+  // OK
+  return CAE_NONE;
+}
+
+void CAProcess::ClosePipes()
+{
+  ClosePipePair( iStdInPipe );
+  ClosePipePair( iStdOutPipe );
+  ClosePipePair( iStdErrPipe );
+}
+
+
+void CAProcess::ClosePipePair( int *aPipes )
+{
+	assert( aPipes != NULL );
+	ClosePipeDesc( &(aPipes[0]) );
+	ClosePipeDesc( &(aPipes[1]) );
+}
+
+
+void CAProcess::ClosePipeDesc( int *aPipeDescriptor )
+{
+	assert( aPipeDescriptor != NULL );
+	close( *aPipeDescriptor );
+	*aPipeDescriptor = INVALID_PIPE_DESC;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ProcessLibrary/proclib_windows.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <windows.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "proclib.h"
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * CAProcess
+ *
+ ******************************************************************************/
+CAProcess::CAProcess()
+{
+	memset( &iProcessInfo, 0, sizeof(iProcessInfo) );
+	iProcessState = PS_INIT;
+}
+
+CAProcess::~CAProcess()
+{
+//	assert( (iProcessState == PS_INIT) || (iProcessState == PS_REMOVED) );
+}
+
+
+/*******************************************************************************
+ *
+ * StartProcess()
+ *
+ ******************************************************************************/
+int CAProcess::StartProcess( char *aCommandLine )
+{
+	int err;
+	STARTUPINFO info;
+
+	// check that the commandline is valid
+	assert( aCommandLine != NULL );
+
+	// verify the state
+	assert( iProcessState == PS_INIT );
+
+	// set the startup info to zero (required even though empty)
+	memset( &info, 0, sizeof(info) );
+	info.cb = sizeof(info);
+
+	// create the process
+	err = CreateProcess( NULL, aCommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &info, &iProcessInfo );
+	if( err == 0 ) {
+		assert( iProcessInfo.hProcess == NULL );
+		return GetLastError();
+	}
+
+	// update the state
+	iProcessState = PS_STARTED;
+
+	// done
+	return 0;
+}
+
+/*******************************************************************************
+ *
+ * StopProcess()
+ *
+ ******************************************************************************/
+int CAProcess::StopProcess( ) 
+{
+	int err, rv = 0;
+
+	// check the state
+	assert( iProcessState == PS_STARTED );
+		
+	// terminate the process
+	err = TerminateProcess( iProcessInfo.hProcess, -1 );
+	if( err == 0 ) {
+		rv = GetLastError();
+	}
+
+	// update the state
+	iProcessState = PS_STOPPED;
+	return rv;
+}
+
+/*******************************************************************************
+ *
+ * WaitForProcess()
+ *
+ ******************************************************************************/
+int CAProcess::WaitForProcess()
+{
+	int err, rv = 0;
+
+	// check the state
+	assert( (iProcessState == PS_STOPPED) || (iProcessState == PS_STARTED) );
+
+	// now wait
+	err = WaitForSingleObject( iProcessInfo.hProcess, INFINITE );
+	if( err != WAIT_OBJECT_0 ) {
+		rv = err;
+	}
+
+	// update the state
+	iProcessState = PS_REMOVED;
+	return rv;
+}
+
+
+/*******************************************************************************
+ *
+ * GetProcessStatus()
+ *
+ ******************************************************************************/
+TProcessStatus CAProcess::GetProcessStatus()
+{
+	int err;
+
+	// if the state is not started then return
+	if( iProcessState != PS_STARTED ) {
+		return iProcessState;
+	}
+
+	// otherwise see if the process is still running or has stopped itself
+	err = WaitForSingleObject( iProcessInfo.hProcess, 0 );
+	if( err != WAIT_TIMEOUT ) {
+		iProcessState = PS_STOPPED;
+	}
+
+	// return the status
+	return iProcessState;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SerialTcpRelay/CSerialPort.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSerialPort -- encapsulates the details of using the serial port as 
+* a communications channel
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+/*********************************************************************
+ *
+ * Local Includes
+ *
+ ********************************************************************/
+#include "CSerialPort.h"
+
+
+/*********************************************************************
+ *
+ * Definitions
+ *
+ ********************************************************************/
+#define READ_TIMEOUT	(1000)
+
+
+/*********************************************************************
+ *
+ * Construction
+ *
+ ********************************************************************/
+CSerialPort::CSerialPort()
+{
+	iComPort = INVALID_HANDLE_VALUE;
+	iMutex =  CreateMutex( NULL, false, NULL );
+	assert (iMutex != NULL);
+}
+
+
+CSerialPort::~CSerialPort()
+{
+	assert( iComPort == INVALID_HANDLE_VALUE );
+	CloseHandle( iMutex );
+	iMutex = NULL;
+}
+
+
+/*********************************************************************
+ *
+ * OpenComPort() -- open a com port, set the timeouts, set the config
+ *
+ ********************************************************************/
+int CSerialPort::OpenPort( char *aComPort )
+{
+	int err;
+
+	// Open the COM Port
+	iComPort = CreateFile( aComPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH, NULL );
+	if( iComPort == INVALID_HANDLE_VALUE ) {
+		err = GetLastError();
+		return err;
+	}
+
+	// Set the timeouts (see msdn for the meaning of these carefully chosen values)
+	COMMTIMEOUTS CommTimeOuts;
+	CommTimeOuts.ReadIntervalTimeout = MAXDWORD;
+	CommTimeOuts.ReadTotalTimeoutMultiplier = MAXDWORD;
+    CommTimeOuts.ReadTotalTimeoutConstant = READ_TIMEOUT;
+	CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
+	CommTimeOuts.WriteTotalTimeoutConstant = 0;
+	err = SetCommTimeouts( iComPort, &CommTimeOuts );
+	if( err == 0 ) {
+		err = GetLastError();
+		CloseHandle( iComPort );
+		iComPort = INVALID_HANDLE_VALUE;
+		return err;
+	}
+
+	// Configure the COM port - NO FLOW CONTROL
+	DCB dcb;
+	GetCommState(iComPort, &dcb);
+	dcb.DCBlength			= sizeof(dcb); 
+	dcb.BaudRate			= CBR_115200;
+//	dcb.fBinary				= TRUE;
+	dcb.fBinary				= FALSE;
+	dcb.fParity				= NOPARITY;
+	dcb.fOutxCtsFlow		= TRUE;
+	dcb.fOutxDsrFlow		= FALSE;
+	dcb.fDtrControl			= DTR_CONTROL_ENABLE;	
+	dcb.fDsrSensitivity		= FALSE;
+	dcb.fTXContinueOnXoff	= TRUE;
+	dcb.fOutX				= FALSE;
+	dcb.fInX				= FALSE;
+	dcb.fErrorChar			= FALSE;
+	dcb.fNull				= FALSE;
+//	dcb.fRtsControl			= RTS_CONTROL_HANDSHAKE;
+	dcb.fRtsControl			= RTS_CONTROL_ENABLE;
+	dcb.fAbortOnError		= TRUE;
+	dcb.XonLim				= 100;
+	dcb.XoffLim				= 100;
+	dcb.ByteSize			= 8;
+	dcb.Parity				= NOPARITY;
+	dcb.StopBits			= ONESTOPBIT;
+	dcb.XonChar				= 17;
+	dcb.XoffChar			= 19;
+	err = SetCommState( iComPort, &dcb );	
+	if( err == 0 ) {
+		err = GetLastError();
+		CloseHandle( iComPort );
+		iComPort = INVALID_HANDLE_VALUE;
+		return err;
+	}
+
+	// raise RTS and DTR so the other end won't block (it can use whatever hw flow control it wants)
+	err = EscapeCommFunction( iComPort, SETDTR );
+	assert( err != 0 );
+	err = EscapeCommFunction( iComPort, SETRTS );
+	assert( err != 0 );
+
+	// Success
+	return 0;
+}
+
+
+/*********************************************************************
+ *
+ * CloseComPort() -- close an open com port.
+ *
+ ********************************************************************/
+void CSerialPort::ClosePort()
+{
+	// if the port isn't open then just return
+	if( iComPort == INVALID_HANDLE_VALUE ) 
+		return;
+	
+	// close the port
+	CloseHandle( iComPort );
+	iComPort = INVALID_HANDLE_VALUE;
+}
+
+
+/*********************************************************************
+ *
+ *  ReceiveBytes() -- read specified number of bytes from the comport
+ *
+ ********************************************************************/
+int CSerialPort::ReceiveBytes( char* aBuff, int *aSize )
+{
+	int err, mutex_err;
+	int original_size;
+	unsigned long iBytesRead;
+
+	// check the state and the params
+	assert( iComPort != INVALID_HANDLE_VALUE );
+	assert( aBuff != NULL );
+	assert( aSize != NULL );
+
+	// acquire the port mutex
+	mutex_err = WaitForSingleObject( iMutex, INFINITE );
+	assert( mutex_err == WAIT_OBJECT_0 );
+
+	// receive bytes
+	original_size = *aSize;
+	err = ReadFile( iComPort, aBuff, *aSize, &iBytesRead, NULL );
+
+	// give the mutex back 
+	mutex_err = ReleaseMutex( iMutex );
+	assert( mutex_err != 0 );
+
+	// set aSize to the number actually read
+	*aSize = iBytesRead;
+
+	// check for errors
+	if( err == 0 )  {
+		err = GetLastError();
+		return err;
+	}
+
+	// done
+	return 0;
+}
+
+
+/*********************************************************************
+ *
+ *  SendBytes() -- write the specified number of bytes to the COMport
+ *
+ ********************************************************************/
+int CSerialPort::SendBytes( char *aBuff, int *aSize )
+{
+	int err, mutex_err;
+	DWORD dwModemStatus, dwBytes = 0;
+
+	// check state and params
+	assert( iComPort != INVALID_HANDLE_VALUE );
+	assert( aBuff != NULL );
+	assert( aSize != NULL );
+
+	// acquire the port mutex
+	mutex_err = WaitForSingleObject(iMutex, INFINITE);
+	assert( mutex_err == WAIT_OBJECT_0 );
+
+	// write bytes to the port
+	err = GetCommModemStatus( iComPort, &dwModemStatus );
+	err = WriteFile( iComPort, (LPVOID)aBuff, *aSize, &dwBytes, NULL );
+
+	// give the mutex back 
+	mutex_err = ReleaseMutex( iMutex );
+	assert( mutex_err != 0 );
+
+	// set aSize to the number actually written
+	*aSize = dwBytes;
+
+	// check for errors
+	if( err == 0 ) {
+		err = GetLastError();
+		return err;
+	}
+	
+	// done	
+	return 0;	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SerialTcpRelay/CSerialPort.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSerialPort
+*
+*/
+
+
+
+#ifndef __CSERIALPORT_H__
+#define __CSERIALPORT_H__
+
+
+/*************************************************************************************
+ *
+ * Includes
+ *
+ ************************************************************************************/
+#include <windows.h>
+
+
+/*************************************************************************************
+ *
+ * CSerialPort Definition
+ *
+ ************************************************************************************/
+class CSerialPort
+{
+public:
+	CSerialPort();
+	~CSerialPort();
+
+	int OpenPort( char *aComPort );
+	void ClosePort();
+	int ReceiveBytes( char *aBuff, int *aLength );
+	int SendBytes( char *aBuff, int *aLength );
+	HANDLE Handle() { return iComPort; }
+
+private:
+	HANDLE iComPort;
+	HANDLE iMutex;
+};
+
+#endif //__MUCCSCONTROL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SerialTcpRelay/CSerialTcpRelay.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,280 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+
+/*************************************************************************************
+ *
+ * LocalIncludes
+ *
+ ************************************************************************************/
+#include "CSerialTcpRelay.h"
+
+
+/*************************************************************************************
+ *
+ * Definitions
+ *
+ ************************************************************************************/
+#define SOCKET_TIMEOUT (1000)
+
+
+/*************************************************************************************
+ *
+ * PUBLIC METHOD: CSerialTcpRelay
+ *
+ ************************************************************************************/
+CSerialTcpRelay::CSerialTcpRelay() : iSerialThread("SerialThread"), iSocketThread("SocketThread")
+{
+	iSerialPort = NULL;
+	iSocket = INVALID_SOCKET;
+	iState = iSerialState = iSocketState = RS_NEW;
+}
+
+
+/*************************************************************************************
+ *
+ * PUBLIC METHOD: ~CSerialTcpRelay
+ *
+ ************************************************************************************/
+CSerialTcpRelay::~CSerialTcpRelay()
+{
+	assert( iSocket == INVALID_SOCKET );
+	assert( iState != RS_ACTIVE );
+	assert( iSerialState != RS_ACTIVE );
+	assert( iSocketState != RS_ACTIVE );
+}
+
+
+/*************************************************************************************
+ *
+ * PUBLIC METHOD: InitialiseRelay
+ *
+ ************************************************************************************/
+TRelayError CSerialTcpRelay::InitialiseRelay( CSerialPort *aSerialPort, SOCKADDR_IN aRemoteAddress, char *aInitialBuffer, int aBufferLength, int *aErrCode )
+{
+	int err;
+
+	// check params
+	assert( aSerialPort != NULL );
+	assert( aErrCode != NULL );
+
+	// save the state vars
+	*aErrCode = 0;
+	iSerialPort = aSerialPort;
+	iRemoteAddress = aRemoteAddress;
+
+	// open the socket
+	iSocket = socket( AF_INET, SOCK_STREAM, 0 );
+	if( iSocket == INVALID_SOCKET ){
+		*aErrCode = WSAGetLastError();
+		return RE_SOCKET_FAILED;
+	}
+	err = connect( iSocket, (struct sockaddr*)&iRemoteAddress, sizeof(iRemoteAddress) );
+	if( err == SOCKET_ERROR ) {
+		*aErrCode = WSAGetLastError();
+		closesocket( iSocket );
+		iSocket = INVALID_SOCKET;
+		return RE_CONNECT_FAILED;
+	}
+
+	// if there is some initial data then send it
+	if( (aInitialBuffer != NULL) && (aBufferLength > 0) ) {
+		err = send( iSocket, aInitialBuffer, aBufferLength, 0 );
+		if( err != aBufferLength ) {
+			*aErrCode = WSAGetLastError();
+			closesocket( iSocket );
+			iSocket = INVALID_SOCKET;
+			return RE_INITIAL_SEND_FAILED;
+		}
+	}
+
+	// update the state
+	iState = iSerialState = iSocketState = RS_ACTIVE;
+
+	// ok we are ready to go
+	return RE_SUCCESS;
+}
+
+
+/*************************************************************************************
+ *
+ * PUBLIC METHOD: ExecuteRelay
+ *
+ ************************************************************************************/
+TRelayError CSerialTcpRelay::ExecuteRelay()
+{
+	TThreadError terr;
+	int errcode;
+
+	// create the serial thread
+	terr = iSerialThread.StartThread( CSerialTcpRelay::SerialThreadProc, this, &errcode );
+	assert( terr == TE_NONE );
+
+	// create the socket thread
+	terr = iSocketThread.StartThread( CSerialTcpRelay::SocketThreadProc, this, &errcode );
+	assert( terr == TE_NONE );
+
+	// wait for the serial thread to exit
+	terr = iSerialThread.WaitForThread( INFINITE );
+	assert( terr == TE_NONE );
+
+	// wait for the socket thread to exit
+	terr = iSocketThread.WaitForThread( INFINITE );
+	assert( terr == TE_NONE );
+
+	// done
+	iState = RS_CLOSED;
+	return RE_SUCCESS;
+}
+
+
+/*************************************************************************************
+ *
+ * PRIVATE METHOD: ExecuteSerialThread
+ *
+ ************************************************************************************/
+TRelayError CSerialTcpRelay::ExecuteSerialThread()
+{
+	int err, bytes_read;
+	DWORD dwModemStatus;
+
+	// repeat...
+	while( 1 ) {
+
+		// read from the serial port
+		bytes_read = SERIALREADBUFFSIZE;
+		err = iSerialPort->ReceiveBytes( iSerialReadBuffer, &bytes_read );
+
+		// if there was an error other than timeout then break
+		if( err != 0 ) {
+			break;
+		}
+
+		// write any received data to the socket - break on error
+		if( bytes_read > 0 ) {
+//			fprintf( stderr, "DEBUG: serial <-> socket (%d)\n", bytes_read );
+			err = send( iSocket, iSerialReadBuffer, bytes_read, 0 );
+			if( err != bytes_read ) {
+				break;
+			}
+		}
+
+		// check the serial line flags - if the peer has lowered cts or dsr then
+		// we take this as meaning that they have closed the port
+		err = GetCommModemStatus( iSerialPort->Handle(), &dwModemStatus );
+		assert( err != 0 );
+		if( ((dwModemStatus & MS_CTS_ON) == 0) ) {
+			break;
+		}
+
+		// if the socket thread has exited then exit
+		if( iSocketState == RS_CLOSED ) {
+			break;
+		}
+	}
+		
+	// set my status to closed 
+	iSerialState = RS_CLOSED;
+	return RE_SUCCESS;
+}
+
+
+/*************************************************************************************
+ *
+ * PRIVATE METHOD: ExecuteSerialThread
+ *
+ ************************************************************************************/
+TRelayError CSerialTcpRelay::ExecuteSocketThread()
+{
+	int err, bytes_read, bytes_written;
+	struct timeval read_timeout;
+	fd_set read_fds;
+
+	// repeat...
+	while( 1 ) {
+
+		// setup things
+		read_timeout.tv_sec = 0;
+		read_timeout.tv_usec = (SOCKET_TIMEOUT*1000);
+		FD_ZERO( &read_fds );
+		FD_SET( iSocket, &read_fds );
+
+		// see if data is available
+		err = select( 1, &read_fds, NULL, NULL, &read_timeout );
+
+		// break on errors
+		if( err == SOCKET_ERROR ) {
+			break;
+		}
+
+		// if there is data available then read it - break on error
+		if( err != 0 ) {
+			bytes_read = recv( iSocket, iSocketReadBuffer, SOCKETREADBUFFSIZE, 0 );
+			if( bytes_read <= 0 ) {
+				break;
+			}
+		}
+
+		// write any received data to the serial port - break on error
+		if( bytes_read > 0 ) {
+			bytes_written = bytes_read;
+//			fprintf( stderr, "DEBUG: socket <-> serial (%d)\n", bytes_read );
+			err = iSerialPort->SendBytes( iSocketReadBuffer, &bytes_written );
+			if( err != 0 ) {
+				break;
+			}
+		}
+
+		// if the serial thread has exited then exit
+		if( iSerialState == RS_CLOSED ) {
+			break;
+		}
+
+	}
+	
+	// close the socket
+	closesocket( iSocket );
+	iSocket = INVALID_SOCKET;
+
+	// set my status to closed 
+	iSocketState = RS_CLOSED;
+	return RE_SUCCESS;
+}
+
+
+/*************************************************************************************
+ *
+ * PRIVATE METHOD: Thread Entry Procs
+ *
+ ************************************************************************************/
+int CSerialTcpRelay::SerialThreadProc( CSerialTcpRelay *aRelay )
+{
+	return (int)aRelay->ExecuteSerialThread();
+}
+
+
+int CSerialTcpRelay::SocketThreadProc( CSerialTcpRelay *aRelay )
+{
+	return (int)aRelay->ExecuteSocketThread();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SerialTcpRelay/CSerialTcpRelay.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSerialTcpRelay
+*
+*/
+
+
+
+#ifndef __CSERIALTCPRELAY_H__
+#define __CSERIALTCPRELAY_H__
+
+
+/*************************************************************************************
+ *
+ * Local Includes
+ *
+ ************************************************************************************/
+#include "CSerialPort.h"
+#include "../ThreadLibrary/CAThread.h"
+
+
+/*************************************************************************************
+ *
+ * Definitions
+ *
+ ************************************************************************************/
+#define SERIALREADBUFFSIZE	(1024)
+#define SOCKETREADBUFFSIZE	(1024)
+
+
+/*************************************************************************************
+ *
+ * Types
+ *
+ ************************************************************************************/
+typedef enum {
+	RE_SUCCESS,	
+	RE_SOCKET_FAILED,
+	RE_CONNECT_FAILED,
+	RE_INITIAL_SEND_FAILED
+} TRelayError;
+
+
+typedef enum {
+	RS_NEW,
+	RS_ACTIVE,
+	RS_CLOSED,
+} TRelayState;
+
+/*************************************************************************************
+ *
+ * CSerialTcpRelay Definition
+ *
+ ************************************************************************************/
+class CSerialTcpRelay
+{
+public:
+	CSerialTcpRelay();
+	~CSerialTcpRelay();
+	TRelayError InitialiseRelay( CSerialPort *aSerialPort, SOCKADDR_IN aRemoteAddress, char *aInitialBuffer, int aBufferLength, int *aErrCode );
+	TRelayError	ExecuteRelay();
+
+private:
+	TRelayError ExecuteSerialThread();
+	TRelayError ExecuteSocketThread();
+
+	static int SerialThreadProc( CSerialTcpRelay *aRelay );
+	static int SocketThreadProc( CSerialTcpRelay *aRelay );
+
+	CSerialPort *iSerialPort;
+	SOCKET iSocket;
+	SOCKADDR_IN iRemoteAddress;
+	char iSerialReadBuffer[SERIALREADBUFFSIZE];
+	char iSocketReadBuffer[SOCKETREADBUFFSIZE];
+	TRelayState iState;
+	TRelayState iSerialState;
+	TRelayState iSocketState;
+	CAThread iSerialThread;
+	CAThread iSocketThread;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+/*************************************************************************************
+ *
+ * Local Includes
+ *
+ ************************************************************************************/
+#include "CSerialTcpRelay.h"
+
+
+/*************************************************************************************
+ *
+ * Definitions
+ *
+ ************************************************************************************/
+#define TO_RETRY					(1000)
+#define TO_TIMEWAIT					(3000)
+#define INITIALSTRINGBUFFERSIZE		(64)
+
+
+/*************************************************************************************
+ *
+ * Prototypes
+ *
+ ************************************************************************************/
+void Relay( SOCKADDR_IN aSocketAddress, char *aSerialPortName );
+void RelaySession( SOCKADDR_IN aSocketAddress, CSerialPort *aSerialPort );
+void PrintRelayError( TRelayError aRelayError, int aErrCode );
+
+
+/*************************************************************************************
+ *
+ * main()
+ *
+ ************************************************************************************/
+int main( int argc, char *argv[] )
+{
+	char *serial_port_name;
+	SOCKADDR_IN socket_address;
+	WORD version;
+	WSADATA wsaData;
+	int err;
+
+	// check params
+	if( argc < 3 ) {
+		fprintf( stderr, "usage: %s <tcp_host> <tcp_port> <serial_port>\n", argv[0] );
+		return -1;
+	}
+
+	// process the params
+	memset( &socket_address, 0, sizeof(socket_address) );
+	socket_address.sin_family = AF_INET;
+	socket_address.sin_port = htons( atoi(argv[2]) );
+	socket_address.sin_addr.S_un.S_addr = inet_addr( argv[1] );
+	serial_port_name = argv[3];
+
+	// start the socket subsystem
+	version = MAKEWORD( 2, 2 );
+	err = WSAStartup( version, &wsaData );
+	assert( err == 0 );
+
+	// start the relay
+	Relay( socket_address, serial_port_name );
+
+	// done
+	WSACleanup();
+	return 0;
+}
+
+
+/*************************************************************************************
+ *
+ * Relay()
+ *
+ ************************************************************************************/
+void Relay( SOCKADDR_IN aSocketAddress, char *aSerialPortName )
+{
+	int err;
+	CSerialPort serial_port;
+
+	// repeat...
+	while( 1 ) {
+
+		// open the serial port - if this fails then pause and retry
+		err = serial_port.OpenPort( aSerialPortName );
+		if( err != 0 ) {
+			fprintf( stderr, "Failed to open serial port %s (%d)\n", aSerialPortName, err );
+			Sleep( TO_RETRY );
+			continue;
+		}
+
+		// try and establish a session (might succeed, might fail, makes no difference here)
+		RelaySession( aSocketAddress, &serial_port );
+
+		// close the port
+		serial_port.ClosePort();
+	}
+
+	// done
+	return;
+}
+
+
+/*************************************************************************************
+ *
+ * RelaySession()
+ *
+ ************************************************************************************/
+void RelaySession( SOCKADDR_IN aSocketAddress, CSerialPort *aSerialPort )
+{
+	char recv_buffer;
+	int err, errcode, bytes_read = 0, slen, initial_string_buffer_length;
+	CSerialTcpRelay relay;
+	TRelayError rerr;
+
+	int current_at_state = 0;
+	char expected_at_char[] = { 'A', 'T', 0x0d, 0 };
+	char initial_string_buffer[INITIALSTRINGBUFFERSIZE] = { 0 };
+
+	// wait for some bytes to arrive on the port
+	fprintf( stdout, "Waiting for new session\n" );
+	while( 1 ) {
+
+		// read from the serial port - if there is an error then exit
+		bytes_read = 1;
+		err = aSerialPort->ReceiveBytes( &recv_buffer, &bytes_read );
+		if( err != 0 ) {
+			fprintf( stderr, "Error reading from the serial port (%s)\n", strerror(err) );
+			break;
+		}
+
+		// if nothing was read then just continue
+		if( bytes_read == 0 ) {
+			continue;
+		}
+
+		// if we read a char that does not match the ignore string then try and
+		// create a session
+		if( recv_buffer != expected_at_char[current_at_state] ) {
+			strncpy( initial_string_buffer, expected_at_char, INITIALSTRINGBUFFERSIZE );
+			initial_string_buffer[current_at_state] = 0;
+			slen = strlen( initial_string_buffer );
+			assert( slen < (INITIALSTRINGBUFFERSIZE-2) );
+			initial_string_buffer[slen] = recv_buffer;
+			initial_string_buffer[slen+1] = 0;
+			initial_string_buffer_length = strlen( initial_string_buffer );
+			break;
+		}
+
+		// otherwise update the at_state
+		current_at_state += 1;
+		current_at_state = ((expected_at_char[current_at_state] == 0) ? 0 : current_at_state);
+	}
+	
+	// some data was received - try and start a session
+	rerr = relay.InitialiseRelay( aSerialPort, aSocketAddress, initial_string_buffer, initial_string_buffer_length, &errcode );
+	if( rerr != RE_SUCCESS ) {
+		PrintRelayError( rerr, errcode );
+		return;
+	}
+	fprintf( stdout, "Session established\n" );
+
+	// session established - execute
+	rerr = relay.ExecuteRelay();
+	if( rerr != RE_SUCCESS ) {
+		fprintf( stderr, "ExecuteRelay returned %d\n", rerr );
+	}
+	fprintf( stdout, "Session closed\n" );
+	
+	// do time-wait 
+	Sleep( TO_TIMEWAIT );
+}
+
+
+/*************************************************************************************
+ *
+ * PrintRelayError()
+ *
+ ************************************************************************************/
+void PrintRelayError( TRelayError aRelayError, int aErrCode )
+{
+	char *relay_error_string[] = { NULL, "socket() failed", "connect() failed", "initial send() failed" };
+	fprintf( stderr, "Failed to initialise the relay - %s - %d\n", relay_error_string[aRelayError], aErrCode );
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,119 @@
+# Microsoft Developer Studio Project File - Name="SerialTcpRelay" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SerialTcpRelay - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SerialTcpRelay.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SerialTcpRelay.mak" CFG="SerialTcpRelay - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SerialTcpRelay - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "SerialTcpRelay - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "SerialTcpRelay - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ws2_32.lib libthread.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\..\bin\SerialTcpRelay.exe" /libpath:"../../BinInternal"
+
+!ELSEIF  "$(CFG)" == "SerialTcpRelay - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libthread.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\..\bin\SerialTcpRelay.exe" /pdbtype:sept /libpath:"../../BinInternal"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "SerialTcpRelay - Win32 Release"
+# Name "SerialTcpRelay - Win32 Debug"
+# Begin Group "inc"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ThreadLibrary\CAThread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSerialPort.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSerialTcpRelay.h
+# End Source File
+# End Group
+# Begin Group "src"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSerialPort.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSerialTcpRelay.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\SerialTcpRelay.cpp
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SerialTcpRelay"=.\SerialTcpRelay.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name ThreadLibrary
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ThreadLibrary"=..\ThreadLibrary\ThreadLibrary.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SocketLibrary/SocketLibrary.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,126 @@
+# Microsoft Developer Studio Project File - Name="SocketLibrary" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=SocketLibrary - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SocketLibrary.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SocketLibrary.mak" CFG="SocketLibrary - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SocketLibrary - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "SocketLibrary - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "SocketLibrary - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\SocketLibrary.lib"
+
+!ELSEIF  "$(CFG)" == "SocketLibrary - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\SocketLibrary.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "SocketLibrary - Win32 Release"
+# Name "SocketLibrary - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\socket_helper.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\socket_helper.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\SocketLibrary.dep
+
+!IF  "$(CFG)" == "SocketLibrary - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "SocketLibrary - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\SocketLibrary.mak
+
+!IF  "$(CFG)" == "SocketLibrary - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "SocketLibrary - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SocketLibrary/SocketLibrary.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SocketLibrary"=.\SocketLibrary.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SocketLibrary/socket_helper.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#endif
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "socket_helper.h"
+
+/*******************************************************************************
+ *
+ * Definition
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Implementation
+ *
+ ******************************************************************************/
+struct sockaddr_in getsockaddr( const char* ip, const char* port)
+{	
+	int isip;
+	struct sockaddr_in sockaddr;
+	int b1, b2, b3, b4;
+	unsigned long addr = 0;
+
+	// set the basics
+	sockaddr.sin_family = AF_INET;		
+	sockaddr.sin_port = htons(atoi(port));
+
+	// if IP is NULL then set to INADDR_ANY otherwise work it out
+	if( ip == NULL ) {
+#ifdef WIN32
+		sockaddr.sin_addr.S_un.S_addr = INADDR_ANY;
+#else
+		sockaddr.sin_addr.s_addr = INADDR_ANY;
+#endif
+		return sockaddr;
+	} 
+
+	// otherwise we see if this is an IP address
+	isip = is_ip_address( ip );
+	if( isip ) {
+		sscanf( ip, "%d.%d.%d.%d", &b1, &b2, &b3,&b4 );
+		addr = ((b1<<24)&0xFF000000);
+		addr |= ((b2<<16)&0x00FF0000);
+		addr |= ((b3<<8)&0x0000FF00);
+		addr |= ((b4)&0x000000FF);
+#ifdef WIN32
+		sockaddr.sin_addr.S_un.S_addr = htonl(addr);
+#else
+		sockaddr.sin_addr.s_addr = htonl(addr);
+#endif
+
+	} else {
+		struct hostent *hp = gethostbyname(ip);
+		if( hp != NULL ) {
+		  memcpy(&sockaddr.sin_addr,hp->h_addr,hp->h_length); 	
+		} else {
+		  sockaddr.sin_addr.s_addr = 0;
+		}
+	}
+
+	return sockaddr;
+}
+
+int is_ip_address( const char* aAddr )
+{
+  int i;
+  int dot_count = 0;
+
+  // Our method for checking whether this is an IP address is to check that
+  // we have digits and points (3 to be precise).
+  for( i = 0; aAddr[i] != 0; i++ ) {
+    if( (aAddr[i] != '.') && (isdigit(aAddr[i]) == 0) ) {
+      return false;
+    }
+    if( aAddr[i] == '.' ) {
+      dot_count++;
+      if( dot_count > 3 ) {
+	return false;
+      }
+    }
+  }
+  return true;
+}
+
+/*******************************************************************************
+ *
+ * GetSocketError - gets the last socket error - for xdev
+ *
+ ******************************************************************************/
+int GetSocketError()
+{
+#ifdef WIN32
+	return WSAGetLastError();
+#else
+	return errno;
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/SocketLibrary/socket_helper.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+#ifndef __SOCKET_HELPER_H__
+#define __SOCKET_HELPER_H__
+
+/*******************************************************************************
+ *
+ * Interface
+ *
+ ******************************************************************************/
+struct sockaddr_in getsockaddr( const char* ip, const char* port);
+int is_ip_address( const char* aAddr );
+int GetSocketError();
+
+#endif // __SOCKET_HELPER_H__
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCServer.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+/**
+ @file CUCCServer.cpp
+*/
+
+#include "CUCCServer.h"
+#include "CUCCTest.h"
+
+_LIT(KServerName,"UCCControlTE");
+
+CUCCServer* CUCCServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CUCCServer * server = new (ELeave) CUCCServer();
+	CleanupStack::PushL(server);
+	
+	// Either use a StartL or ConstructL, the latter will permit
+	// Server Logging.
+
+	//server->StartL(KServerName); 
+	server-> ConstructL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+// EKA2 much simpler
+// Just an E32Main and a MainL()
+LOCAL_C void MainL()
+/**
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+	// Leave the hooks in for platform security
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CUCCServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CUCCServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+// Only a DLL on emulator for  and earlier
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on exit
+ */
+	{
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAP_IGNORE(MainL());
+	delete cleanup;
+	return KErrNone;
+    }
+
+// Create a thread in the calling process
+// Emulator  and earlier
+
+CTestStep* CUCCServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep* testStep = NULL;
+
+	if(aStepName == KTestStartUseCase)
+		testStep = new CUCCTestStartUseCase();
+	if(aStepName == KTestSignal)
+		testStep = new CUCCTestSignal();
+	if(aStepName == KTestRendezvous)
+		testStep = new CUCCTestRendezvous();
+	if(aStepName == KTestWaitfor)
+		testStep = new CUCCTestWaitfor();
+	if(aStepName == KTestEndUseCase)
+		testStep = new CUCCTestEndUseCase();
+	if(aStepName == KTestGetVariableName)
+		testStep = new CUCCTestGetVariableName();
+	if(aStepName == KTestSetDeviceID)
+		testStep = new CUCCTestSetDeviceID();
+	if(aStepName == KTestRunCommand )
+		testStep = new CUCCTestRunCommand();
+
+	return testStep;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCServer.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+/**
+ @file CUCCServer.h
+*/
+
+#ifndef __UCC_SERVER_H__
+#define __UCC_SERVER_H__
+
+#include <testexecuteserverbase.h>
+
+class CUCCServer : public CTestServer
+	{
+public:
+	static CUCCServer* NewL();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs(){return iFs;};
+
+private:
+	RFs iFs;
+	};
+
+#endif // __UCC_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTest.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,537 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+/**
+ @file CUCCTest.cpp
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <testexecutelog.h>
+#include "CUCCTest.h"
+#include "CNetworkEmulatorSetupCommdb.h"
+#include "uccs_errorcodes.h"
+
+#define RECORD_ID			"RECORD_ID"
+#define COMMDB_VALUE		"VALUETOSET"
+#define BUFFERSIZE			256	
+#define MAXLOGINSCRIPT		512
+#define MAXVARLEN			64
+
+const TInt KMaxCommandLineLength	= 4096;
+const TInt KMaxParamNameLength		= 128;
+const TInt KMaxParamValueLength		= 1024;
+
+
+CUCCTestStartUseCase::CUCCTestStartUseCase()
+	{
+	SetTestStepName(KTestStartUseCase);
+	}
+
+CUCCTestStartUseCase::~CUCCTestStartUseCase()
+	{
+	}
+
+TVerdict CUCCTestStartUseCase::doTestStepL()
+	{	
+	int ret, uid;
+	int err = 0;
+	CUCCSDeviceControl *app;
+
+	// get the application control instance and use-case id
+	app = CreateApplicationControlInstance( &uid );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	// start the usecase
+	ret = app->startUseCase(uid, &err);
+
+	// cleanup the app control instance
+	delete app;
+
+	// return success / failure
+	SetTestStepResult( (ret == UCCS_OK) ? EPass : EFail );
+	return TestStepResult();
+	}
+
+CUCCTestSignal::CUCCTestSignal()
+	{
+	SetTestStepName(KTestSignal);
+	}
+
+CUCCTestSignal::~CUCCTestSignal()
+	{
+	}
+
+TVerdict CUCCTestSignal::doTestStepL()
+	{
+	int ret, uid;
+	int err = 0;
+	CUCCSDeviceControl *app;
+
+	// get the application control instance and use-case id
+	app = CreateApplicationControlInstance( &uid );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();	
+		}
+
+	// call signal
+	ret = app->signal(uid, &err);
+
+	// cleanup the app control instance
+	delete app;
+
+	// return success / failure
+	SetTestStepResult( (ret == UCCS_OK) ? EPass : EFail );
+	return TestStepResult();
+	}
+
+CUCCTestRendezvous::CUCCTestRendezvous()
+	{
+	SetTestStepName(KTestRendezvous);
+	}
+
+CUCCTestRendezvous::~CUCCTestRendezvous()
+	{
+	}
+
+TVerdict CUCCTestRendezvous::doTestStepL()
+	{
+	int ret, uid;
+	int err = 0;
+	CUCCSDeviceControl *app;
+
+	// get the application control instance and use-case id
+	app = CreateApplicationControlInstance( &uid );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	// call rendezvous
+	ret = app->rendezvous(uid, &err);
+
+	// cleanup the app control instance
+	delete app;
+
+	// return success / failure
+	SetTestStepResult( (ret == UCCS_OK) ? EPass : EFail );
+	return TestStepResult();
+	}
+
+CUCCTestEndUseCase::CUCCTestEndUseCase()
+	{
+	SetTestStepName(KTestEndUseCase);
+	}
+
+CUCCTestEndUseCase::~CUCCTestEndUseCase()
+	{
+	}
+
+TVerdict CUCCTestEndUseCase::doTestStepL()
+	{
+	int ret, uid;
+	int err = 0;
+	CUCCSDeviceControl *app;
+
+	// get the application control instance and use-case id
+	app = CreateApplicationControlInstance( &uid );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+	
+	// call endusecase
+	TVerdict tmpVerdict = EFail;
+	ret = app->endUseCase(uid, tmpVerdict, &err);
+	SetTestStepResult( tmpVerdict );
+
+	// cleanup the app control instance
+	delete app;
+
+	// return success / failure
+	SetTestStepResult( (ret == UCCS_OK) ? EPass : EFail );
+	return TestStepResult();
+	}
+
+CUCCTestWaitfor::CUCCTestWaitfor()
+	{
+	SetTestStepName(KTestWaitfor);
+	}
+
+CUCCTestWaitfor::~CUCCTestWaitfor()
+	{
+	}
+
+TVerdict CUCCTestWaitfor::doTestStepL()
+	{
+	int ret, uid;
+	int err = 0;
+	CUCCSDeviceControl *app;
+
+	// get the application control instance and use-case id
+	app = CreateApplicationControlInstance( &uid );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	// call waitfor
+	ret = app->waitfor(uid, &err);
+
+	// cleanup the app control instance
+	delete app;
+
+	// return success / failure
+	SetTestStepResult( (ret == UCCS_OK) ? EPass : EFail );
+	return TestStepResult();
+	}
+
+CUCCTestGetVariableName::CUCCTestGetVariableName()
+	{
+	SetTestStepName(KTestGetVariableName);
+	}
+
+CUCCTestGetVariableName::~CUCCTestGetVariableName()
+	{
+	}
+
+TVerdict CUCCTestGetVariableName::doTestStepL()
+	{
+	int ret, uid;
+	int err = 0;
+	CUCCSDeviceControl *app;
+	char variableValue[64];
+	char* variableName = "ENV";
+
+	// get the application control instance and use-case id
+	app = CreateApplicationControlInstance( &uid );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	// call getVariableName
+	ret = app->getVariableName( variableName, variableValue, 64, &err );
+
+	// cleanup the app control instance
+	delete app;
+
+	// return success / failure
+	SetTestStepResult( (ret == UCCS_OK) ? EPass : EFail );
+	return TestStepResult();
+	}
+
+CUCCTestRunCommand::CUCCTestRunCommand()
+	{
+	SetTestStepName(KTestRunCommand);
+	}
+
+CUCCTestRunCommand::~CUCCTestRunCommand()
+	{
+	}
+
+// Ini file parameter names and standard values
+_LIT(KEquals, "=");
+_LIT(KSpace, " ");
+_LIT(KQuote, "\"");
+_LIT(KRunCmd, "runcmd");
+_LIT(KServiceName, "svcname");
+_LIT(KCall, "call");
+_LIT(KMethodID, "methodid");
+_LIT(KDefaultMethodID, "10");
+
+TVerdict CUCCTestRunCommand::doTestStepL()
+	{
+	TInt ret, uid;
+	TInt err = 0;
+	CUCCSDeviceControl *app;
+	HBufC* commandLine = HBufC::NewLC(KMaxCommandLineLength);
+	TPtr commandLinePtr(commandLine->Des());
+	
+	// Specific ini file parameter names and standard values
+	_LIT(KServiceID, "svcid");
+	_LIT(KServiceHost, "svchost");
+	_LIT(KNumParams, "num_params" );
+	_LIT(KParamNameStr,"param_name_");
+	_LIT(KParamValueStr,"param_value_");
+	_LIT(KExpectPositiveReturnCodeStr,"expect_positive_return_code");
+
+	commandLinePtr.Append( KRunCmd );
+
+	// Retrieve the service name
+	TPtrC svcname;
+	TInt rv = GetStringFromConfig( ConfigSection(), KServiceName, svcname );
+	if( rv )
+		{
+		// Append the service_name to the command line
+		commandLinePtr.Append( KSpace );
+		commandLinePtr.Append( KServiceName );
+		commandLinePtr.Append( KEquals );
+		commandLinePtr.Append( KQuote );
+		commandLinePtr.Append( svcname );
+		commandLinePtr.Append( KQuote );
+		}
+	else
+		{
+		// Otherwise revert to the legacy svcid and svchost
+		TPtrC svcid;
+		TPtrC svchost;
+		rv = GetStringFromConfig( ConfigSection(), KServiceID, svcid );
+		if( rv )
+			{
+			rv = GetStringFromConfig( ConfigSection(), KServiceHost, svchost );
+			}
+		if( rv )
+			{
+			// Append the svcid command line
+			commandLinePtr.Append( KSpace );
+			commandLinePtr.Append( KServiceID );
+			commandLinePtr.Append( KEquals );
+			commandLinePtr.Append( svcid );
+			// Append the svchost command line
+			commandLinePtr.Append( KSpace );
+			commandLinePtr.Append( KServiceHost );
+			commandLinePtr.Append( KEquals );
+			commandLinePtr.Append( KQuote );
+			commandLinePtr.Append( svchost );
+			commandLinePtr.Append( KQuote );
+			}
+		}
+
+	if( rv )
+		{
+		// Look up the call name
+		TPtrC call;
+		rv = GetStringFromConfig( ConfigSection(), KCall, call );
+		if( rv )
+			{
+			// Append the default methodid (10) to the command line
+			commandLinePtr.Append( KSpace );
+			commandLinePtr.Append( KMethodID );
+			commandLinePtr.Append( KEquals );
+			commandLinePtr.Append( KDefaultMethodID );
+			// Append the call name to the command line
+			commandLinePtr.Append( KSpace );
+			commandLinePtr.Append( KCall );
+			commandLinePtr.Append( KEquals );
+			commandLinePtr.Append( KQuote );
+			commandLinePtr.Append( call );
+			commandLinePtr.Append( KQuote );
+			}
+		else
+			{
+			// If it is not there look up the method id
+			TPtrC methodid;
+			rv = GetStringFromConfig( ConfigSection(), KMethodID, methodid );
+			if( rv )
+				{
+				// Append the methodid command line
+				commandLinePtr.Append( KSpace );
+				commandLinePtr.Append( KMethodID );
+				commandLinePtr.Append( KEquals );
+				commandLinePtr.Append( methodid );
+				}
+			}
+		}
+
+	// Iterate through the parameters adding them to the command line as we go
+	TInt num_params = 0;
+	rv = GetIntFromConfig( ConfigSection(), KNumParams, num_params );
+	if( num_params > 0 )
+		{
+		HBufC* param_name_str = HBufC::NewLC(KMaxParamNameLength);
+		HBufC* param_value_str = HBufC::NewLC(KMaxParamValueLength);
+		TPtr param_name_str_ptr(param_name_str->Des());
+		TPtr param_value_str_ptr(param_value_str->Des());
+
+		for( int i=1 ; i<=num_params && rv ; i++ )
+			{
+			TPtrC param_name;
+			TPtrC param_value;
+
+			param_name_str_ptr.Copy( KParamNameStr );
+			// Append the parameter number to the end of the ini string
+			param_name_str_ptr.AppendNum( i );
+			rv = GetStringFromConfig( ConfigSection(), param_name_str_ptr, param_name );
+			if( rv )
+				{
+				param_value_str_ptr.Copy( KParamValueStr );
+				// Append the parameter number to the end of the ini string
+				param_value_str_ptr.AppendNum( i );
+				rv = GetStringFromConfig( ConfigSection(), param_value_str_ptr, param_value );
+				}
+			if( rv )
+				{
+				// Append the parameter name/value to the command line
+				commandLinePtr.Append( KSpace );
+				commandLinePtr.Append( param_name );
+				commandLinePtr.Append( KEquals );
+				commandLinePtr.Append( KQuote );
+				commandLinePtr.Append( param_value );
+				commandLinePtr.Append( KQuote );
+				}
+			}
+
+		// Cleanup
+		CleanupStack::PopAndDestroy(param_value_str);
+		CleanupStack::PopAndDestroy(param_name_str);
+		}
+
+	// get the application control instance
+	app = CreateApplicationControlInstance( &uid, EFalse );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		CleanupStack::PopAndDestroy(commandLine);
+		return TestStepResult();
+		}
+
+	// Call runCommand
+	HBufC8* commandLine8 = HBufC8::NewLC(commandLinePtr.Length()+1);
+	TPtr8 ptr8(commandLine8->Des());
+	ptr8.Copy(commandLinePtr);
+	ret = app->runCommandL( (char*)ptr8.PtrZ(), &err );
+
+	// Log the UCC/Service call result
+	_LIT( KUCCCallResult, "UCC Call Result = %d" );
+	INFO_PRINTF2( KUCCCallResult, ret );
+
+	// Cleanup
+	delete app;
+	CleanupStack::PopAndDestroy(commandLine8);
+	CleanupStack::PopAndDestroy(commandLine);
+
+	// the following section represents an ultra lightweight way of tolerating handles returned by services, without assuming
+	//  that any nonzero return code is a problem.
+	//  in future this could be extended to store the specific handle values in a map to refer back to them in later test steps..
+	//  something like "store_result_as_handle_called=Test1"
+	TBool expectPositiveReturnCode(EFalse);
+	rv = GetBoolFromConfig( ConfigSection(), KExpectPositiveReturnCodeStr, expectPositiveReturnCode );
+	if(expectPositiveReturnCode && ret > 0)
+		{
+		if(ret>0) // a handle value was returned = success
+			{
+			ret=KErrNone;
+			}
+		else if(ret==0) // null handle means there was a problem
+			{
+			ret=KErrUnknown;
+			}
+		}
+
+	// Return success / failure
+	SetTestStepResult( (ret == KErrNone) ? EPass : EFail );
+	return TestStepResult();
+	}
+
+CUCCTestSetDeviceID::CUCCTestSetDeviceID()
+	{
+	SetTestStepName(KTestSetDeviceID);
+	}
+
+CUCCTestSetDeviceID::~CUCCTestSetDeviceID()
+	{
+	}
+
+TVerdict CUCCTestSetDeviceID::doTestStepL()
+	{
+	int uid;
+	CUCCSDeviceControl *app;
+
+	// get the application control instance and use-case id
+	app = CreateApplicationControlInstance( &uid );
+	if( app == NULL )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+	
+	// do the set
+	SetTestStepResult( UpdateCommdbEntry( app ) );
+
+	// cleanup and exit
+	delete app;
+	app = NULL;
+	return TestStepResult();
+	}
+
+TVerdict CUCCTestSetDeviceID::UpdateCommdbEntry( CUCCSDeviceControl *aApp )
+	{
+	int ret, err = 0, isp_index, device_id;
+	TCommDBError cdberr;
+	CSetUpCommDb commdb_handle;
+	TBuf<MAXLOGINSCRIPT> login_script_string;
+	char device_id_string[MAXVARLEN];
+	char isp_index_string[MAXVARLEN];
+
+	// get the device id from the use-case script
+	ret = aApp->getVariableName( "DEVICEID", device_id_string, MAXVARLEN, &err );
+	if( ret != UCCS_OK )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+	device_id = atoi(device_id_string);
+
+	// get the ISP index from the use-case script
+	ret = aApp->getVariableName( "COMMDB_ISP_INDEX", isp_index_string, MAXVARLEN, &err );
+	if( ret != UCCS_OK )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+	isp_index = atoi( isp_index_string );
+
+	// create the entry string
+	login_script_string.FillZ();
+	login_script_string.Append( _L("CHARMAP [windows-1252]\n") );
+	login_script_string.Append( _L("LOOP 10\n{\nSEND \"ID=") );
+	login_script_string.AppendNum( device_id );
+	login_script_string.Append( _L("\"+<0x0d>\nWAIT 3\n{\n\"SERVER(") );
+	login_script_string.AppendNum( device_id );
+	login_script_string.Append( _L(")\" OK\n}\n}\nEXIT KErrNoAnswer$\n\nOK:\nEXIT\n") );
+
+	// set the value in COMMDB
+	cdberr = commdb_handle.initialise();
+	if( cdberr != TCommDB_Success )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+	cdberr = commdb_handle.updateEntry( DIAL_OUT_ISP, isp_index, ISP_LOGIN_SCRIPT, (char*)login_script_string.PtrZ(), &err ); 
+	if( cdberr != TCommDB_Success )
+		{
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	// done ik
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTest.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+/**
+ @file CUCCTest.h
+*/
+
+#ifndef __UCC_TEST_H__
+#define __UCC_TEST_H__
+
+#include <testexecutestepbase.h>
+#include "CUCCTestStep.h"
+#include "CUCCServer.h"
+
+class CUCCTestStartUseCase : public CUCCTestStep
+	{
+public:
+	CUCCTestStartUseCase();
+	~CUCCTestStartUseCase();
+	virtual TVerdict doTestStepL();
+	};
+
+class CUCCTestSignal : public CUCCTestStep
+	{
+public:
+	CUCCTestSignal();
+	~CUCCTestSignal();
+	virtual TVerdict doTestStepL();
+	};
+
+class CUCCTestRendezvous : public CUCCTestStep
+	{
+public:
+	CUCCTestRendezvous();
+	~CUCCTestRendezvous();
+	virtual TVerdict doTestStepL();
+	};
+
+class CUCCTestWaitfor : public CUCCTestStep
+	{
+public:
+	CUCCTestWaitfor();
+	~CUCCTestWaitfor();
+	virtual TVerdict doTestStepL();
+	};
+
+class CUCCTestEndUseCase : public CUCCTestStep
+	{
+public:
+	CUCCTestEndUseCase();
+	~CUCCTestEndUseCase();
+	virtual TVerdict doTestStepL();
+	};
+
+class CUCCTestGetVariableName : public CUCCTestStep
+	{
+public:
+	CUCCTestGetVariableName();
+	~CUCCTestGetVariableName();
+	virtual TVerdict doTestStepL();
+	};
+
+class CUCCTestRunCommand : public CUCCTestStep
+	{
+public:
+	CUCCTestRunCommand();
+	~CUCCTestRunCommand();
+	virtual TVerdict doTestStepL();
+	};
+
+class CUCCTestSetDeviceID : public CUCCTestStep
+	{
+public:
+	CUCCTestSetDeviceID();
+	~CUCCTestSetDeviceID();
+	virtual TVerdict doTestStepL();
+private:
+	TVerdict UpdateCommdbEntry( CUCCSDeviceControl *aApp );
+	};
+
+_LIT(KTestStartUseCase,"StartUseCase");
+_LIT(KTestSignal,"Signal");
+_LIT(KTestRendezvous,"Rendezvous");
+_LIT(KTestWaitfor,"Waitfor");
+_LIT(KTestEndUseCase,"EndUseCase");
+_LIT(KTestGetVariableName,"GetVariableName");
+_LIT(KTestRunCommand,"RunCommand");
+_LIT(KTestSetDeviceID,"SetDeviceID");
+
+#endif // __UCC_TEST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTestStep.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+/**
+ @file CUCCTestStep.cpp
+*/
+
+#include <e32base.h>
+
+#include "assert.h"
+#include "CUCCTestStep.h"
+#include "CUCCSDeviceProtocol.h"
+
+_LIT( delim, "|" );
+
+CUCCTestStep::CUCCTestStep() 
+	{
+	}
+
+CUCCTestStep::~CUCCTestStep()
+	{
+	}
+
+CUCCSDeviceControl *CUCCTestStep::CreateApplicationControlInstance( int *aUID, TBool aUIDRequired )
+	{
+	int r = 0;
+	TBool rv;
+	TBuf<50> initialisation_string;
+	TPtrC temp_string;
+	CUCCSDeviceControl *app_instance = NULL;
+
+	// check params
+	assert( aUID != NULL );
+	*aUID = -1;
+
+	// Note: I've changed the tags of the ini files, but am keeping support for the old tags 
+	TDPTransport transType = TDP_NONE;
+	
+	// Get the com port from the ini file and add it to the initialisation string
+	if( GetStringFromConfig( _L("UCCControl"), _L("CommPortIndex"), temp_string ) )
+		{
+		initialisation_string.Append( temp_string );
+		initialisation_string.Append( delim );
+		initialisation_string.Append( _L("115200") );
+		initialisation_string.Append( delim );
+		transType = TDP_SERIAL;
+		}
+	else if( GetStringFromConfig( _L("UCCControl"), _L("RemoteHost"), temp_string ) )
+		{
+		initialisation_string.Append( temp_string );
+		initialisation_string.Append( delim );
+		if( GetIntFromConfig( _L("UCCControl"), _L("IAP"), r) )
+			{
+			initialisation_string.Append( _L("IAP:") );
+			initialisation_string.AppendNum(r);
+			initialisation_string.Append( delim );
+			}
+		if( r == 0 && GetIntFromConfig( _L("UCCControl"), _L("SNAP"), r) )
+			{
+#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
+			initialisation_string.Append( _L("SNAP:") );
+			initialisation_string.AppendNum(r);
+			initialisation_string.Append( delim );
+#else
+			r = 0;
+			INFO_PRINTF1(_L("Access Point selection is not supported.."));
+#endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
+			}
+		transType = TDP_TCP;
+		}
+	else
+		{
+		return NULL;
+		}
+
+	// Get the test id (use case number) from the ini file
+	// Only if it is required.
+	if( aUIDRequired )
+		{
+		rv = GetIntFromConfig( _L("UCCControl"), _L("UseCaseID"), (*aUID) );
+		if( rv == 0 )
+			{
+			rv = GetIntFromConfig( _L("Test_Common"), _L("testID"), (*aUID) );
+			if( rv == 0 )
+				{
+				return NULL;
+				}
+			}
+		}
+
+	// create the application control object
+	app_instance = CUCCSDeviceControl::New();	
+	assert (app_instance != NULL);
+
+	// connect to the uccs
+	r = app_instance->connectL( (TDesC16*)&initialisation_string, transType );
+	if( r != 0)
+		{
+		delete app_instance;
+		return NULL;
+		}
+
+	// done return the info
+	return app_instance;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTestStep.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+/**
+ @file CUCCTestStep.h
+*/
+
+#ifndef __UCC_TEST_STEP_H__
+#define __UCC_TEST_STEP_H__
+
+#include <testexecuteserverbase.h>
+#include <networkemulator/cuccsdevicecontrol.h>
+
+class CUCCTestStep : public CTestStep
+	{
+public:
+	CUCCTestStep();
+	~CUCCTestStep();
+	CUCCSDeviceControl *CreateApplicationControlInstance( int *aUID, TBool aUIDRequired = ETrue );
+	CUCCTestStep * iSelfTestSuite;
+	};
+
+#endif // __UCC_TEST_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ThreadLibrary/CAThread.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Local Includes
+*
+*/
+
+
+
+#ifdef WIN32
+#include "CAThread.windows.cpp"
+#else
+#include "CAThread.linux.cpp"
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ThreadLibrary/CAThread.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CAThread
+*
+*/
+
+
+
+#ifndef __CATHREAD_H__
+#define __CATHREAD_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#ifdef WIN32
+#include <windows.h>
+#endif
+#include <stdio.h>
+#include <string>
+using namespace std;
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+#ifndef WIN32
+#define INFINITE (-1)
+typedef pthread_t HANDLE;
+#endif
+
+/*******************************************************************************
+ *
+ * Type
+ *
+ ******************************************************************************/
+typedef enum {
+	TS_INIT,
+	TS_ACTIVE,
+	TS_DONE
+} TThreadState;
+
+typedef enum {
+	TE_NONE,
+	TE_ERROR,
+	TE_TIMEOUT,
+	TE_INVALIDSTATE,
+} TThreadError;
+
+/*******************************************************************************
+ *
+ * Class Definition
+ *
+ ******************************************************************************/
+class CAThread
+{
+public:
+	CAThread();
+	CAThread( string aThreadName );
+	~CAThread();
+
+	TThreadError StartThread( void *aStartProc, void *aArg, int *aSystemSpecificError );
+	TThreadError WaitForThread( int aTimeout );
+	TThreadState GetThreadState();
+
+private:
+	TThreadState iThreadState;
+	HANDLE iThreadHandle;
+	void *iProc;
+	string iThreadName;
+};
+
+#endif // __CATHREAD_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ThreadLibrary/CAThread.linux.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <errno.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CAThread.h" 
+
+/*******************************************************************************
+ *
+ * Implementation
+ *
+ ******************************************************************************/
+CAThread::CAThread()
+{
+  iThreadHandle = 0;
+  iThreadState = TS_INIT;
+  iProc = NULL;
+}
+
+
+CAThread::CAThread( string aThreadName )
+{
+  iThreadHandle = 0;
+  iThreadState = TS_INIT;
+  iProc = NULL;
+  iThreadName = aThreadName;
+}
+
+
+CAThread::~CAThread()
+{
+  assert( iThreadHandle == 0 );
+  assert( iThreadState != TS_ACTIVE );
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: StartThread
+ *
+ ******************************************************************************/
+TThreadError CAThread::StartThread( void *aStartProc, void *aArg, int *aSystemSpecificError )
+{
+  int err;
+
+  // check params
+  assert( aSystemSpecificError != NULL );
+  *aSystemSpecificError = 0;
+
+  // check state
+  if( iThreadState != TS_INIT ) {
+    return TE_INVALIDSTATE;
+  }
+
+  // NOTE: we use the handle as a replacement for pthread_t. This is OK since they are both
+  // 4-bytes integers -- however -- this obviously breaks the abstraction of the pthread_t
+  // type so I validate this assumption here.
+  assert( sizeof(pthread_t) == sizeof(HANDLE) );
+
+  // create the thread
+  err = pthread_create( (pthread_t*)&iThreadHandle, NULL, (void*(*)(void*))aStartProc, aArg );
+  iProc = aStartProc;
+
+  // handle errors
+  if( err != 0 ) {
+    *aSystemSpecificError = errno;
+    return TE_ERROR;
+  }
+
+  // done
+  iThreadState = TS_ACTIVE;
+  return TE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: WaitForThread - To implement this method using pthreads we 
+ * use two functions. pthread_getschedparam is a non-blocking call that returns
+ * whether the thread is still active - pthread_join waits infinitely for the 
+ * thread to complete. At the moment this implementation doesn't support wait
+ * periods other than zero and infinite.
+ *
+ ******************************************************************************/
+TThreadError CAThread::WaitForThread( int aTimeout )
+{
+  int err, thread_return_value;
+  int policy;
+  struct sched_param param;
+
+  // check the state
+  if( iThreadState != TS_ACTIVE ) {
+    return TE_INVALIDSTATE;
+  }
+  
+  // check the param
+  assert( (aTimeout == 0) || (aTimeout == -1) );
+  
+  // in the non-blocking case we check whether the thread is active, if it is then we just return, otherwise, we then join with it.
+  if( aTimeout == 0 ) {
+    err = pthread_getschedparam( iThreadHandle, &policy, &param );
+    if( err == 0 ) {
+      return TE_TIMEOUT;
+    } else if( err != ESRCH ) {
+      return TE_ERROR;
+    }
+  }
+  
+  // we are either waiting indefinitely, or, we are waiting non-blocking but have just worked out that the thread is not running anymore
+  err = pthread_join( iThreadHandle, (void**)&thread_return_value );
+  assert( err == 0 );
+
+  // cleanup our state
+  iThreadHandle = 0;
+  iThreadState = TS_DONE;
+  return TE_NONE;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: GetThreadState
+ *
+ ******************************************************************************/
+TThreadState CAThread::GetThreadState()
+{
+  return iThreadState;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ThreadLibrary/CAThread.windows.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CAThread.h" 
+
+/*******************************************************************************
+ *
+ * Implementation
+ *
+ ******************************************************************************/
+CAThread::CAThread()
+{
+	iThreadHandle = NULL;
+	iThreadState = TS_INIT;
+	iProc = NULL;
+}
+
+
+CAThread::CAThread( string aThreadName )
+{
+	iThreadHandle = NULL;
+	iThreadState = TS_INIT;
+	iProc = NULL;
+	iThreadName = aThreadName;
+}
+
+
+CAThread::~CAThread()
+{
+	assert( iThreadHandle == NULL );
+	assert( iThreadState != TS_ACTIVE );
+}
+
+
+TThreadError CAThread::StartThread( void *aStartProc, void *aArg, int *aSystemSpecificError )
+{
+	// check params
+	assert( aSystemSpecificError != NULL );
+	*aSystemSpecificError = 0;
+
+	// create the thread
+	iThreadHandle = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)aStartProc, aArg, 0, NULL );
+	iProc = aStartProc;
+
+	// handle errors
+	if( iThreadHandle == NULL ) {
+		*aSystemSpecificError = GetLastError();
+		return TE_ERROR;
+	}
+
+	// done
+	iThreadState = TS_ACTIVE;
+	return TE_NONE;
+}
+
+
+TThreadError CAThread::WaitForThread( int aTimeout )
+{
+	int err;
+
+	// wait for the object
+	err = WaitForSingleObject( iThreadHandle, aTimeout );
+
+	// handle the case that we got it
+	if( err == WAIT_OBJECT_0 ) {
+		iThreadState = TS_DONE;
+		iThreadHandle = NULL;
+		return TE_NONE;
+	}
+
+	// handle a timeout
+	if( err == WAIT_TIMEOUT ) {
+		return TE_TIMEOUT;
+	}
+
+	// handle all other responses
+	assert( !"INVALID CODE PATH" );
+	return TE_NONE;
+}
+
+
+TThreadState CAThread::GetThreadState()
+{
+	return iThreadState;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ThreadLibrary/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=../../BinInternal/libthread.a
+INCLUDES=
+OBJECTS=	CAThread.o
+LIBS=
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) 
+	ar -rcs $(TARGET) $(OBJECTS)
+
+CAThread.o:	CAThread.cpp CAThread.linux.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ThreadLibrary/ThreadLibrary.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,100 @@
+# Microsoft Developer Studio Project File - Name="ThreadLibrary" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=ThreadLibrary - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "ThreadLibrary.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "ThreadLibrary.mak" CFG="ThreadLibrary - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "ThreadLibrary - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "ThreadLibrary - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "ThreadLibrary - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libthread.lib"
+
+!ELSEIF  "$(CFG)" == "ThreadLibrary - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\BinInternal\libthread.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "ThreadLibrary - Win32 Release"
+# Name "ThreadLibrary - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CAThread.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CAThread.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/ThreadLibrary/ThreadLibrary.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "ThreadLibrary"=.\ThreadLibrary.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CNetworkEmulatorSetupCommdb.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,676 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <cdbcols.h>
+#include <e32std.h>
+#include <d32dbms.h>
+#include <stdlib.h>
+#include <charconv.h>
+#include <f32file.h> 
+#include <libc/string.h>
+
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+#include "assert.h"
+#include "NetworkEmulatorControl.h"
+
+
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: Constructor
+ *
+ ****************************************************************************/	
+EXPORT_C CSetUpCommDb::CSetUpCommDb()
+{
+	iStatus = TCOMMBD_IDLE;
+}
+
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: Destructor
+ *
+ ****************************************************************************/
+EXPORT_C CSetUpCommDb::~CSetUpCommDb()
+{
+	if( iStatus == TCOMMBD_CONNECTED ) {
+		assert( iDbComms != NULL ); 
+		delete iDbComms;
+		iDbComms = NULL;
+		iStatus = TCOMMBD_IDLE; 
+	}
+	assert( iStatus == TCOMMBD_IDLE );
+}
+
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: Initialise the database
+ *
+ ****************************************************************************/
+EXPORT_C TCommDBError CSetUpCommDb::initialise(void)
+{
+	assert( iStatus == TCOMMBD_IDLE);
+
+	// Connect to the database.
+	// Specifying type as EFalse, so if the dB does not exist, function leaves.
+	TRAPD (r, iDbComms = CCommsDatabase::NewL(EFalse));
+	if( r != KErrNone ) {
+		return 	TCommDB_ErrorInitCommDb;
+	}
+	assert ( iDbComms != NULL );
+	iStatus = TCOMMBD_CONNECTED;
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	SECTION: updateEntry
+ *
+ ****************************************************************************/
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: updateEntry
+ *
+ ****************************************************************************/
+EXPORT_C TCommDBError CSetUpCommDb::updateEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode)
+{
+	CCommsDbTableView *table_handle = NULL;
+	int ret = KErrNone;
+
+	// Check the params
+	assert ( aFieldValue != NULL );
+	assert ( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// Check the state
+	assert( iStatus == TCOMMBD_CONNECTED );
+	assert ( iDbComms != NULL );
+
+	// Open the table we are looking for
+	TRAP( ret, (table_handle = openTableL(iDbComms,aTable)) );
+	if( (ret != KErrNone) || (table_handle == NULL) ) {
+		*aErrCode = ret;
+		return TCommDB_ErrorTableNotFound;
+	}
+
+	// find and update the record
+	FindAndUpdateRecord( table_handle, aRecordID, aFieldName, aFieldValue, aErrCode );
+
+	// cleanup and return
+	delete table_handle;
+	table_handle = NULL;
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	PRIVATE METHOD: FindAndUpdateRecord
+ *
+ ****************************************************************************/
+TCommDBError CSetUpCommDb::FindAndUpdateRecord( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode)
+{
+	int err, ret;
+	TUint32 id = 0;
+
+	// Look for the matching record in the table
+	err = aTable->GotoFirstRecord();
+	while( err == KErrNone ) {
+
+		// Read the id for each record in the table and compare to the one we are looking for.
+		TRAP( ret, (aTable->ReadUintL(TPtrC(COMMDB_ID),id)) );
+		if( ret != KErrNone ) {	
+			*aErrCode = ret;
+			return TCommDB_ErrorReadingRecord;
+		}
+
+		// We have found the record we are looking for then update the field	
+		if( id == aRecordID) {
+			return UpdateField( aTable, aFieldName, aFieldValue, aErrCode );
+		}
+	}
+
+	// no matching record found
+	return TCommDB_RecNotFound;
+}
+
+
+/*****************************************************************************
+ *
+ *	PRIVATE METHOD: UpdateField
+ *
+ ****************************************************************************/
+TCommDBError CSetUpCommDb::UpdateField( CCommsDbTableView *aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode )
+{
+	int err, ret;
+	TDbColType colType = EDbColBinary;
+	TUint32 attrib;
+	TUint32 entry_integer;
+
+	// Get the type of the field we are writing to
+	TRAP( ret, (aTable->ReadTypeAttribL(aFieldName,colType,attrib)) );
+	if( ret != KErrNone ) {		
+		*aErrCode = ret;
+		return TCommDB_ErrorColNotFound;
+	}
+
+	// Must call update record before editing any existing record.
+	err = aTable->UpdateRecord();
+	if( err != KErrNone ) {	
+		*aErrCode = err;
+		return TCommDB_ErrorUpdatingRecord;
+	}
+
+	// Convert the string value to the appropriate type and write entry to database
+	switch (colType) {
+
+	// convert the string to an integer and update the entry
+	case EDbColUint16:
+	case EDbColUint32:
+	case EDbColUint8:
+		entry_integer = (TUint32)atoi((const char*)aFieldValue);
+		TRAP( ret, (aTable->WriteUintL(aFieldName,entry_integer)) );
+		if( ret != KErrNone ) {		
+			*aErrCode = ret;
+			return TCommDB_ErrorUpdatingRecord;
+		}
+		break;
+
+	// no need for conversion - just add the string
+	case EDbColText8:
+	{
+		TPtrC8 acsiiPtr((TUint8*)aFieldValue);
+		TRAP( ret, (aTable->WriteTextL(aFieldName,acsiiPtr)) );
+		if( ret != KErrNone ) {
+			*aErrCode = ret;
+			return TCommDB_ErrorUpdatingRecord;
+		}
+		break;
+	}
+
+	// convert the ascii string to unicode and update the entry
+	case EDbColText16:
+		err = SetUnicodeString( aTable, aFieldName, aFieldValue, aErrCode );
+		if( err != TCommDB_Success ) {
+			return TCommDB_ErrorUpdatingRecord;	
+		}
+		break;
+
+	// no need for conversion - just add the string
+	case EDbColLongText8:
+	{
+		TPtrC8 asciiPtrLong((TUint8*)aFieldValue);
+		TRAP( ret, (aTable->WriteTextL(aFieldName,asciiPtrLong)) );
+		if( ret != KErrNone ) {		
+			*aErrCode = ret;
+			return TCommDB_ErrorUpdatingRecord;
+		}
+		break;
+	}
+
+	// convert the ascii string to unicode and update the entry
+	case EDbColLongText16:
+		ret = SetUnicodeStringLong( aTable, aFieldName, aFieldValue, aErrCode );
+		if( ret != TCommDB_Success ) {
+			return TCommDB_ErrorUpdatingRecord;	
+		}
+		break;
+
+	// unknown column type
+	default:
+		return TCommDB_ErrorColTypeValueNotSupported;
+	}
+
+	// commit the changes
+	err = aTable->PutRecordChanges();
+	if( err != KErrNone ) {
+		*aErrCode = ret;
+		return TCommDB_ErrorUpdatingRecord;
+	}
+
+	// done
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	SECTION: Get...
+ *
+ ****************************************************************************/
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: getIntEntry
+ *
+ ****************************************************************************/
+EXPORT_C TCommDBError CSetUpCommDb::getIntEntry( TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TUint32& aFieldValue, int* aErrCode )
+{
+	int ret;
+	TCommDBError rv;
+	CCommsDbTableView* table = NULL;
+	TDbColType colType;
+
+	// check params and state
+	assert( iStatus == TCOMMBD_CONNECTED );
+	assert ( iDbComms != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// open the table
+	TRAP( ret, (table = openTableL(iDbComms, aTable)) );
+	if( (ret != KErrNone) || (table == NULL) ) {
+		*aErrCode = ret;
+		return TCommDB_ErrorTableNotFound;
+	}
+
+	// get to the record 
+	rv = FindRecordAndGetType( table, aRecordID, aFieldName, &colType, aErrCode );
+	if( rv != TCommDB_Success ) {
+		delete table;
+		return rv;
+	}
+
+	// check the field has the expected type
+	if( (colType != EDbColUint16) && (colType != EDbColUint8) ) {
+		delete table;
+		return TCommDB_ErrorUnexpectedColType;
+	}
+
+	// get the field
+	TRAP( ret, (table->ReadUintL(aFieldName,aFieldValue)) );
+	if ( ret != KErrNone ) {	
+		delete table;
+		*aErrCode = ret;
+		return TCommDB_ErrorReadingRecord;
+	}
+
+	// done
+	delete table;
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: getBoolEntry
+ *
+ ****************************************************************************/
+EXPORT_C TCommDBError CSetUpCommDb::getBoolEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TBool& aFieldValue, int* aErrCode)
+{
+	int ret;
+	TCommDBError rv;
+	CCommsDbTableView* table = NULL;
+	TDbColType colType;
+
+	// check params and state
+	assert( iStatus == TCOMMBD_CONNECTED );
+	assert ( iDbComms != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// open the table
+	TRAP( ret, (table = openTableL(iDbComms, aTable)) );
+	if( (ret != KErrNone) || (table == NULL) ) {
+		*aErrCode = ret;
+		return TCommDB_ErrorTableNotFound;
+	}
+
+	// get to the record 
+	rv = FindRecordAndGetType( table, aRecordID, aFieldName, &colType, aErrCode );
+	if( rv != TCommDB_Success ) {
+		delete table;
+		return rv;
+	}
+
+	// check the field has the expected type
+	if( colType != EDbColBit ) {
+		delete table;
+		return TCommDB_ErrorUnexpectedColType;
+	}
+
+	// get the field
+	TRAP( ret, (table->ReadBoolL(aFieldName,aFieldValue)) );
+	if ( ret != KErrNone ) {	
+		delete table;
+		*aErrCode = ret;
+		return TCommDB_ErrorReadingRecord;
+	}
+
+	// done
+	delete table;
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: getAsciiEntry
+ *
+ ****************************************************************************/
+EXPORT_C TCommDBError CSetUpCommDb::getAsciiEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes8& aFieldValue, int* aErrCode)
+{
+	int ret;
+	TCommDBError rv;
+	CCommsDbTableView* table = NULL;
+	TDbColType colType;
+
+	// check params and state
+	assert( iStatus == TCOMMBD_CONNECTED );
+	assert ( iDbComms != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// open the table
+	TRAP( ret, (table = openTableL(iDbComms, aTable)) );
+	if( (ret != KErrNone) || (table == NULL) ) {
+		*aErrCode = ret;
+		return TCommDB_ErrorTableNotFound;
+	}
+
+	// get to the record 
+	rv = FindRecordAndGetType( table, aRecordID, aFieldName, &colType, aErrCode );
+	if( rv != TCommDB_Success ) {
+		delete table;
+		return rv;
+	}
+
+	// check the field has the expected type
+	if( colType != EDbColText8 ) {
+		delete table;
+		return TCommDB_ErrorUnexpectedColType;
+	}
+
+	// get the field
+	TRAP( ret, (table->ReadTextL(aFieldName,aFieldValue)) );
+	if ( ret != KErrNone ) {	
+		delete table;
+		*aErrCode = ret;
+		return TCommDB_ErrorReadingRecord;
+	}
+
+	// done
+	delete table;
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	PUBLIC METHOD: getUnicodeEntry
+ *
+ ****************************************************************************/
+EXPORT_C TCommDBError CSetUpCommDb::getUnicodeEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes16& aFieldValue, int* aErrCode)
+{
+	int ret;
+	TCommDBError rv;
+	CCommsDbTableView* table = NULL;
+	TDbColType colType;
+
+	// check params and state
+	assert( iStatus == TCOMMBD_CONNECTED );
+	assert ( iDbComms != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// open the table
+	TRAP( ret, (table = openTableL(iDbComms, aTable)) );
+	if( (ret != KErrNone) || (table == NULL) ) {
+		*aErrCode = ret;
+		return TCommDB_ErrorTableNotFound;
+	}
+
+	// get to the record 
+	rv = FindRecordAndGetType( table, aRecordID, aFieldName, &colType, aErrCode );
+	if( rv != TCommDB_Success ) {
+		delete table;
+		return rv;
+	}
+
+	// check the field has the expected type
+	if( colType != EDbColText16 ) {
+		delete table;
+		return TCommDB_ErrorUnexpectedColType;
+	}
+
+	// get the field
+	TRAP( ret, (table->ReadTextL(aFieldName,aFieldValue)) );
+	if ( ret != KErrNone ) {	
+		delete table;
+		*aErrCode = ret;
+		return TCommDB_ErrorReadingRecord;
+	}
+
+	// done
+	delete table;
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ * PRIVATE METHOD: FindRecordAndGetType
+ *
+ ****************************************************************************/
+TCommDBError CSetUpCommDb::FindRecordAndGetType( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, TDbColType *aColType, int* aErrCode )
+{
+	int err = KErrNone;
+	int ret = KErrNone;
+	TUint32 id = 0;
+	TDbColType colType = EDbColBit;
+	TUint32 attrib;
+
+	// check params
+	assert( aTable != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// find the matching record in the table
+	err = aTable->GotoFirstRecord();
+	while( err == KErrNone) {
+
+		// get the id field
+		TRAP( ret, (aTable->ReadUintL(TPtrC(COMMDB_ID),id)) );
+		if( ret != KErrNone ) {	
+			*aErrCode = ret;
+			return TCommDB_ErrorReadingRecord;
+		}
+
+		// see if the id matches the requested id
+		if( id == aRecordID) {
+			break;
+		}
+
+		// go to the next record
+		err = aTable->GotoNextRecord();
+	}
+
+	// see if no record was found
+	if( err != KErrNone ) {
+		return TCommDB_RecNotFound;
+	}
+
+	// check the type of the field and see if it matches Int
+	TRAP( ret, (aTable->ReadTypeAttribL(aFieldName,colType,attrib)) );
+	if( ret != KErrNone ) {
+		*aErrCode = ret;
+		return TCommDB_ErrorColNotFound;
+	}
+
+	// return the coltype
+	*aColType = colType;
+
+	// done
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	SECTION: Data Writers
+ *
+ ****************************************************************************/
+/*****************************************************************************
+ *
+ *	Set a unicode string in the db
+ *
+ ****************************************************************************/
+int CSetUpCommDb::SetUnicodeString( CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode )
+{
+	int ret;
+	HBufC16 *unicode_string;
+
+	// check params
+	assert( aTable != NULL );
+	assert( aFieldValue != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+
+	// convert the passed string to unicode			
+	unicode_string = ConvertAsciiToUnicode( aFieldValue );
+	if( unicode_string == NULL ) {
+		return TCommDB_ErrorConvertingToUnicode;
+	}
+	TPtr16 unicode_string_ptr( unicode_string->Des() );
+
+	// update the entry 
+	TRAP( ret, (aTable->WriteTextL(aFieldName,unicode_string_ptr)) );
+	if( ret != KErrNone ) {
+		delete unicode_string;
+		return TCommDB_ErrorUpdatingRecord;
+	}
+	
+	// done 
+	delete unicode_string;
+	return TCommDB_Success;
+}
+
+
+/*****************************************************************************
+ *
+ *	Set a long unicode string in the db
+ *
+ ****************************************************************************/
+int CSetUpCommDb::SetUnicodeStringLong(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int *aErrCode)
+{
+	int ret, i, value_length;
+	unsigned short *unicode_string;
+
+	// check params
+	assert( aTable != NULL );
+	assert( aFieldValue != NULL );
+	assert( aErrCode != NULL );
+	*aErrCode = 0;
+	unicode_string = (unsigned short *)aFieldValue;
+
+	// get the length of the (wide) string
+	for( i = 0; unicode_string[i] != 0; i++ )
+		;
+	value_length = i;
+
+	// convert the passed descriptors into the correct format
+	TPtrC field_value_ptr( unicode_string, value_length );
+
+	// update the entry 
+	TRAP( ret, (aTable->WriteLongTextL(aFieldName,field_value_ptr)) );
+	if( ret != KErrNone ) {
+		return TCommDB_ErrorUpdatingRecord;
+	}
+	
+	// done 
+	return TCommDB_Success;
+}	
+
+
+/*****************************************************************************
+ *
+ *	SECTION: Helpers
+ *
+ ****************************************************************************/
+/*****************************************************************************
+ *
+ *	Open the given table
+ *
+ ****************************************************************************/
+CCommsDbTableView* CSetUpCommDb::openTableL( CCommsDatabase *aDbComms, TPtrC aTable )
+{
+	assert ( aDbComms != NULL );
+	CCommsDbTableView *rv = NULL;
+	rv = aDbComms->OpenTableLC( aTable );
+	CleanupStack::Pop();
+	return rv;
+}
+
+
+/*****************************************************************************
+ *
+ *	Convert an ascii string to unicode
+ *
+ ****************************************************************************/
+HBufC16 *CSetUpCommDb::ConvertAsciiToUnicode( char *aAsciiString )
+{
+	RFs aFs;
+	int error_thrown, err;
+	TInt state;
+	HBufC16* unicode_string = NULL;
+	CCnvCharacterSetConverter* conv = NULL;
+	CCnvCharacterSetConverter::TAvailability available;
+
+	// Setup the descriptors and allocate the memory
+	const TPtrC8 textData( (TUint8*)aAsciiString );
+	TRAP( error_thrown, (unicode_string = HBufC16::NewL(textData.Length())) );	
+	if( (error_thrown != KErrNone) || (unicode_string == NULL) ) {
+		return NULL;
+	}
+	TPtr16 textPtr( unicode_string->Des() );
+
+	// connect to the file-system to do the conversion
+	err = aFs.Connect();				
+	if( err != KErrNone) {	
+		return NULL;
+	}
+
+	// get the character convertor
+	TRAP( error_thrown, (conv = CCnvCharacterSetConverter::NewL()) );
+	if( (error_thrown != KErrNone) || (conv == NULL) ) {
+		delete unicode_string;
+		return NULL;
+	}
+
+	// Check if the required character set we are converting too is available
+	available = conv->PrepareToConvertToOrFromL( KCharacterSetIdentifierUtf8, aFs );  
+	if( available == CCnvCharacterSetConverter::ENotAvailable ) {
+		delete unicode_string;
+		delete conv;
+		return NULL;
+	}
+
+	// finally, do the actual conversion
+	state = CCnvCharacterSetConverter::KStateDefault;
+	conv->ConvertToUnicode( textPtr, textData, state );
+
+	// ok we are done - return the new string
+	delete conv;
+	return unicode_string;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CNetworkEmulatorSetupCommdb.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSetUpCommDb.h
+*
+*/
+
+
+
+#ifndef _CSetUpCommDb_H
+#define _CSetUpCommDb_H
+
+/*****************************************************************************
+ *
+ * System Includes 
+ *
+ ****************************************************************************/
+#include <commdb.h> 
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ *
+ *  Types
+ *
+ ****************************************************************************/
+typedef enum {
+	TCommDB_Success,
+	TCommDB_ErrorInitCommDb,
+	TCommDB_ErrorTableNotFound,
+	TCommDB_ErrorUpdatingRecord,
+	TCommDB_ErrorReadingRecord,
+	TCommDB_ErrorColNotFound,
+	TCommDB_ErrorColTypeValueNotSupported,
+	TCommDB_ErrorConvertingToUnicode,
+	TCommDB_ErrorUnexpectedColType,
+	TCommDB_RecNotFound
+}TCommDBError;
+
+typedef enum {
+	TCOMMBD_IDLE,
+	TCOMMBD_CONNECTED
+}TCommDbStatus;
+
+/*****************************************************************************
+ *
+ * Class Definition
+ *
+ ****************************************************************************/
+class CSetUpCommDb : public CBase
+{
+
+public:
+	// Constructor sets all member data to null
+	IMPORT_C CSetUpCommDb();
+
+	// Deletes the pointer, sets it to null.
+	IMPORT_C ~CSetUpCommDb();
+
+	// Method to initialise the database.
+	IMPORT_C TCommDBError initialise(void);
+	
+	IMPORT_C TCommDBError updateEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);	
+
+	IMPORT_C TCommDBError getAsciiEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes8& aFieldValue, int* aErrCode);
+	IMPORT_C TCommDBError getUnicodeEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes16& aFieldValue, int* aErrCode);
+	IMPORT_C TCommDBError getIntEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TUint32& aFieldValue, int* aErrCode);
+	IMPORT_C TCommDBError getBoolEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TBool& aFieldValue, int* aErrCode);
+
+private:
+	CCommsDbTableView* openTableL( CCommsDatabase *aDbComms, TPtrC aTable );
+
+	TCommDBError FindAndUpdateRecord( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
+	TCommDBError UpdateField( CCommsDbTableView *aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode );
+	int SetUnicodeString(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
+	int SetUnicodeStringLong(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
+	HBufC16 *ConvertAsciiToUnicode( char *aAsciiString );
+
+	TCommDBError FindRecordAndGetType( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, TDbColType *aColType, int* aErrCode );
+
+
+	CCommsDatabase *iDbComms;
+	TCommDbStatus iStatus;
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CSerialTransport.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,372 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Local Includes
+*
+*/
+
+
+
+#include "assert.h"
+#include "CSerialTransport.h"
+
+/**************************************************************************************
+ *
+ * Definitions
+ *
+ *************************************************************************************/
+_LIT(LDD_NAME,"ECOMM");
+#ifdef __WINS__
+_LIT(PDD_NAME,"ECDRV");
+#else
+_LIT(PDD_NAME,"EUART1");
+#endif
+
+#define KMaxTimeoutRetries	(0x0FFFFFFF)
+#define KWriteTimeout		50000000
+
+/********************************************************************************
+ *
+ * Macro functions
+ *
+ ********************************************************************************/
+
+/**************************************************************************************
+ *
+ * CSerialTransport - Construction
+ *
+ *************************************************************************************/
+CSerialTransport* CSerialTransport::NewL( TPtrC16 aModule )
+{
+    CSerialTransport *self = new (ELeave) CSerialTransport();
+    CleanupStack::PushL(self);
+	self->ConstructL( aModule );
+	CleanupStack::Pop();
+    return self;
+}
+
+CSerialTransport::CSerialTransport() 
+{
+}
+
+CSerialTransport::~CSerialTransport()
+{
+	iCommPort.Close();
+	iCommServer.Close();
+}
+
+void CSerialTransport::ConstructL( TPtrC16 aModule )
+{
+	// set parameters
+	assert( aModule.Length() <= KModuleSize );
+	iModule.Copy( aModule );
+	iSerialStatus = EIdle;
+	iRetries = 0;
+	iCommPortOpen = 0;
+	iCommOldSettingsValid = 0;
+}
+
+/**************************************************************************************
+ *
+ * CSerialTransport - Initialise and Release
+ *
+ *************************************************************************************/
+TInt CSerialTransport::InitialiseL()
+{
+	TInt r;
+
+	// set the state
+	SetStatus( EInitialising );
+
+	// Under WINS we must force a link to the file server so that we're sure we'll be 
+	// able to load the device drivers. On a MARM implementation, this code would not
+	// be required because higher level components (EIKON) will automatically have started 
+	// the services. NOTE: this is now no longer required since we are an app and so even
+	// on WINS everything else should have started up by now.
+
+	// Load up the physical and the logical device drivers. If they are already loaded 
+	// then it won't make any difference.
+	r = User::LoadPhysicalDevice( PDD_NAME );
+	if( (r != KErrNone) && (r != KErrAlreadyExists) ) {
+		User::Leave( r );
+	}
+	r = User::LoadLogicalDevice( LDD_NAME );	
+	if( (r != KErrNone) && (r != KErrAlreadyExists) ) {
+		User::Leave( r );
+	}
+
+	// Both WINS and EIKON will have started the comms server process.
+	// (this is only really needed for ARM hardware development racks)
+#ifndef __WINS__
+	r = StartC32();
+	if( (r != KErrNone) && (r != KErrAlreadyExists) )
+		User::Leave( r );
+#endif
+
+	// Now connect to the comm server	
+	User::LeaveIfError( iCommServer.Connect() );
+
+	// Load the CSY module
+	r = iCommServer.LoadCommModule( iModule );
+	User::LeaveIfError( r );
+
+	// check we loaded correctly
+	TInt numPorts;
+	r = iCommServer.NumPorts( numPorts );
+	User::LeaveIfError( r );
+
+	// set the state
+	SetStatus( EInitialised );
+	return KErrNone;
+}
+
+TInt CSerialTransport::Release(void)
+{
+	// make sure the status is as expected
+	assert( (iSerialStatus == EInitialising) || (iSerialStatus == EInitialised) || (iSerialStatus == EDisconnected) );
+	SetStatus( EReleasing );
+
+	// disconnect from the comms server
+	iCommServer.Close();
+
+	// update state and finish
+	SetStatus( EIdle );
+	return KErrNone;
+}
+
+/**************************************************************************************
+ *
+ * CSerialTransport - Connect and Close
+ *
+ *************************************************************************************/
+static int atoi( const short *str )
+{
+	int ret = 0;
+	for( int i = 0; str[i] != NULL; i++ ) {
+		ret *= 10;
+		ret += str[i] - '0';
+	}
+	return ret;
+}
+
+void CSerialTransport::ExtractOptions( TDesC *aRemoteHost, TInt& aPortNumber, TInt& aBaudCap, TBps& aBaudRate )
+{
+	TInt baud;
+	short *delim;
+
+	// get the character array for the remote host (note that this is in unicode)
+	short *opt = (short*)aRemoteHost->Ptr();
+
+	// extract the portnumber
+	aPortNumber = opt[0] - '0';
+
+	// make sure the next char is a delimiter
+	assert( opt[1] == OPT_DELIMITER );
+
+	// now search for the next delimiter and NULL it
+	for( delim = &opt[2]; (*delim != NULL) && (*delim != OPT_DELIMITER); delim++ )
+		;
+
+	// if this is a delim then NULL it
+	if( *delim == OPT_DELIMITER ) {
+		*delim = NULL;
+	}
+
+	// extract the baud -- and set the correct constants for the given baud
+	baud = atoi( &(opt[2]) ); 
+	switch( baud ) {
+	case 115200:
+		aBaudRate = EBps115200;
+		aBaudCap = KCapsBps115200;
+		break;
+	case 38400:
+		aBaudRate = EBps38400;
+		aBaudCap = KCapsBps38400;
+		break;
+	case 19200:
+		aBaudRate = EBps19200;
+		aBaudCap = KCapsBps19200;
+		break;
+	case 9600:
+		aBaudRate = EBps9600;
+		aBaudCap = KCapsBps9600;
+		break;
+	default:
+		assert( !"Unsupported baud rate" );
+		break;
+	}
+}
+
+TInt CSerialTransport::ConnectL( TDesC *aRemoteHost )
+{
+	TInt portNumber;
+	TInt baudCap;
+	TBps baudRate;
+
+	TBuf8<1> iDummyBuffer;
+	
+	// verify state 
+	assert( iSerialStatus == EInitialised );
+	SetStatus( EConnecting );
+
+	// extract the options from the string
+	ExtractOptions( aRemoteHost, portNumber, baudCap, baudRate ); 
+
+	// construct the address -- aRemoteHost should provide the COM port number
+	TBuf16<KMaxPortName + 4> portName;
+	portName.Num( portNumber );
+	portName.Insert( 0, _L("::") );
+	if( iModule == _L("IrCOMM") ) 
+		portName.Insert( 0, _L("IrCOMM") );
+	else if( iModule == _L("ECUART") )
+		portName.Insert( 0, _L("COMM") );
+
+	// open the serial port
+	TInt r = iCommPort.Open( iCommServer, portName, ECommExclusive );
+	User::LeaveIfError( r );
+	iCommPortOpen = 1;
+
+	// check our configuration is supported
+	TCommCaps ourCapabilities;
+	iCommPort.Caps( ourCapabilities );
+	if (((ourCapabilities ().iRate & baudCap) == 0) ||
+		 ((ourCapabilities ().iDataBits & KCapsData8) == 0) ||
+		 ((ourCapabilities ().iStopBits & KCapsStop1) == 0) ||
+		 ((ourCapabilities ().iParity & KCapsParityNone) == 0)) 
+	{
+			User::Leave( KErrNotSupported );
+	}
+
+
+	// save port settings for restoring later
+	iCommPort.Config( iOldPortSettings );
+	iCommOldSettingsValid = 1;
+
+	// set new port settings
+	iCommPort.Config( iPortSettings );
+	iPortSettings().iRate = baudRate;
+	iPortSettings().iParity = EParityNone;
+	iPortSettings().iDataBits = EData8;
+	iPortSettings().iStopBits = EStop1;
+	iPortSettings().iFifo = EFifoEnable;
+  	iPortSettings().iHandshake = KConfigObeyCTS;
+	iPortSettings().iTerminatorCount = 0;
+
+	// cancel any pending reads / writes to be safe and set the config
+	iCommPort.Cancel();
+	r = iCommPort.SetConfig( iPortSettings );
+	if( r != KErrNone ) {
+		User::Leave(r);
+	}
+
+	// set the receive buffer length then check it did it ok
+	iCommPort.SetReceiveBufferLength( 2*KMaxPacketSize );
+	if( iCommPort.ReceiveBufferLength() != 2*KMaxPacketSize ) {
+		User::Leave( KErrTooBig );
+	}
+
+	// power up the serial port by doing a null read on the port
+	if( iModule != _L("IrCOMM") ) {
+		iCommPort.Read(iStatus, iDummyBuffer,0);
+		User::WaitForRequest(iStatus);
+		if(iStatus.Int() != KErrNone){
+			Disconnect();
+			Release();
+			User::Leave(iStatus.Int());
+
+		}
+	} else {
+		iCommPort.Write(iStatus, iDummyBuffer,0);
+		User::WaitForRequest(iStatus);
+		if(iStatus.Int() != KErrNone){
+			Disconnect();
+			Release();
+			User::Leave(iStatus.Int());
+		
+		}
+	}
+
+	SetStatus(EConnected);
+	return KErrNone;
+}
+
+TInt CSerialTransport::Disconnect(void)
+{
+	// verify the status
+	assert( (iSerialStatus == EConnected) || (iSerialStatus == EConnecting) );
+	SetStatus( EDisconnecting );
+
+	// clean up the port
+	if( iCommPortOpen )
+		iCommPort.Cancel();
+	if( iCommOldSettingsValid )
+		iCommPort.SetConfig( iOldPortSettings );
+	if( iCommPortOpen )
+		iCommPort.Close();
+	iCommPortOpen = 0;
+	iCommOldSettingsValid = 0;
+
+	// done
+	SetStatus( EDisconnected );
+	return KErrNone;
+}
+
+/**************************************************************************************
+ *
+ * CSerialTransport - Receive and Send. The ID / Length / Data nonsense 
+ * is handled by the packetisation layer. All serial has to do here is send data -- 
+ * serial is also assuming that the upper layer will keep the data until the response
+ *
+ *************************************************************************************/
+TInt CSerialTransport::RequestSend( TDesC8 *aData, const TUint aDataLength )
+{
+
+	// make sure we are in the appropriate state 
+	assert( iSerialStatus == EConnected );
+
+	// do the send
+	assert( (unsigned)aData->Length() == aDataLength );
+	iCommPort.Write( iStatus, (*aData), aDataLength );
+	User::WaitForRequest(iStatus);
+	return iStatus.Int();
+}
+
+TInt CSerialTransport::RequestReceive( TPtr8 *recvBufferPtr,TUint aByteCount  )
+{
+	// make sure we are in the appropriate state
+	assert( iSerialStatus == EConnected );
+
+	// allocate a buffer for the read
+	assert( aByteCount <= KMaxPacketSize );
+	recvBufferPtr->SetLength( 0 );
+	iCommPort.ReadCancel();
+	iCommPort.Read( iStatus, *recvBufferPtr, aByteCount );
+	User::WaitForRequest(iStatus);
+	return iStatus.Int();
+}
+
+TText8 *CSerialTransport::Error( void )
+{
+	return NULL;
+}
+
+/**************************************************************************************
+ *
+ * CSerialTransport - Private Functions
+ *
+ *************************************************************************************/
+void CSerialTransport::SetStatus( TCommStatus aNewStatus )
+{
+	iSerialStatus = aNewStatus;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CSerialTransport.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Serial Transport
+*
+*/
+
+
+
+#ifndef __SERIAL_H__
+#define __SERIAL_H__
+
+/********************************************************************************
+ *
+ * System Includes
+ *
+ *******************************************************************************/
+#include <c32comm.h>
+#include <f32file.h>
+
+#include "MUCCTransport.h"
+
+/********************************************************************************
+ *
+ * Definitions
+ *
+ *******************************************************************************/
+#define KMaxPacketSize								64
+#define KModuleSize									8
+#define KReadTimeout								30000000
+
+const char  OPT_DELIMITER	= '|';
+
+#ifndef _TCOMMSTATUS
+#define _TCOMMSTATUS
+enum TCommStatus { 
+	EIdle, 
+	EInitialising, 
+	EInitialised, 
+	EConnecting, 
+	EConnected,
+	EDisconnecting, 
+	EDisconnected, 
+	EReleasing, 
+	ESendPending,
+	EReceivePending,
+	ELast
+};
+#endif
+
+/********************************************************************************
+ *
+ * Class
+ *
+ *******************************************************************************/
+class CSerialTransport : public MUCCTransport
+{
+public:
+	CSerialTransport();
+	static CSerialTransport* NewL( TPtrC16 aModule );
+	virtual ~CSerialTransport();
+
+	TInt InitialiseL();
+	TInt ConnectL( TDesC *aRemoteHost );
+	TInt RequestSend( TDesC8 *aCommandData, const TUint aDataLength );
+	TInt RequestReceive( TPtr8 *aRecvBufferPtr, TUint aByteCount );
+	TInt Disconnect( void );
+	TInt Release( void );
+	TText8 *Error( void );
+
+private:
+	void ConstructL( TPtrC16 aModule );
+	void SetStatus( TCommStatus aNewStatus );
+	void ExtractOptions( TDesC *aRemoteHost, TInt& aPortNumber, TInt& aBaudCap, TBps& aBaudRate );
+
+private:
+	enum TReadWriteStatus { ENoRW, EWritePending, EReadPending };
+
+private:
+	TCommStatus iSerialStatus;
+	TBuf16<KModuleSize> iModule;
+	TInt iRetries;
+
+	RCommServ iCommServer;
+	RComm iCommPort;
+	TCommConfig iPortSettings, iOldPortSettings;
+
+	TInt iCommPortOpen, iCommOldSettingsValid;
+	TRequestStatus iStatus;	 
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CTCPTransport.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <e32def.h>
+#include <inet.h>
+
+#include "CTCPTransport.h"
+#include "assert.h"
+
+#include <CommDbConnPref.h>
+
+
+CTCPTransport::CTCPTransport()
+	{
+	}
+
+CTCPTransport::~CTCPTransport()
+	{
+	iSocket.Close();
+	iServer.Close();
+	}
+
+TInt CTCPTransport::InitialiseL()
+	{
+	return KErrNone;
+	}
+
+TInt CTCPTransport::Release( void )
+	{
+	iSocket.Close();
+	iServer.Close();
+	return KErrNone;
+	}
+
+TInt CTCPTransport::ConnectL( TDesC* aRemoteHost )
+	{
+	// Retrieve the destination port location
+	TInt colonPos = aRemoteHost->Locate( TChar(':') );
+	if(colonPos != KErrNotFound)
+		{
+		// Set the destination port
+		TPtrC host( aRemoteHost->Left(colonPos) );
+		TLex portLex( aRemoteHost->Mid(colonPos + 1) );
+		TInt port = 0;
+		portLex.Val( port );
+		iDestAddr.SetPort( port );
+
+		// Retrieve and set the destination ip address
+		TBuf<20> ipAddress;
+		ipAddress.Copy( host.Ptr(), colonPos );
+		iDestAddr.Input( ipAddress );
+		}
+	else
+		{
+		iDestAddr.SetPort( KUCCTCPPort );
+		}
+	
+	// pick out the iap/snap index..
+	TInt index=0;
+	TPtrC mode;
+
+	TInt pipePos = aRemoteHost->Locate( TChar('|') );
+	if( pipePos != KErrNotFound )
+		{
+		TPtrC tempstr( aRemoteHost->Ptr() + pipePos + 1 );
+		TInt indexPos = tempstr.Locate( TChar(':') );
+
+		if( indexPos != KErrNotFound )
+			{
+			mode.Set( tempstr.Left(indexPos) );
+			TLex iapLex( tempstr.Mid(indexPos + 1) );
+			iapLex.Val( index );
+			}
+		}
+	
+	// Connect to the server - need to retry as the first few attepts seem to fail over PPP
+	User::LeaveIfError( iServer.Connect() );
+	User::LeaveIfError( iConnection.Open(iServer) );
+
+	if( index > 0 && mode.Compare( _L("IAP") ) == 0 )
+		{
+		TCommDbConnPref pref;
+		pref.SetIapId(index);
+		pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
+		User::LeaveIfError(iConnection.Start(pref));
+		}
+#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
+	else if( index > 0 && mode.Compare( _L("SNAP") ) == 0 )
+		{
+		TConnSnapPref pref(index);
+		User::LeaveIfError(iConnection.Start(pref));
+		}
+#endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
+	else
+		{
+		User::LeaveIfError(iConnection.Start());
+		}
+
+	TInt ret = -1;
+	while( ret )
+		{
+		User::LeaveIfError( iSocket.Open(iServer, KAfInet, KSockStream, KProtocolInetTcp, iConnection) );
+		TRequestStatus status;
+		iSocket.Connect( iDestAddr, status );
+		User::WaitForRequest( status );
+		ret = status.Int();
+		}
+
+	return KErrNone;
+	}
+
+TInt CTCPTransport::Disconnect( void )
+	{
+	iSocket.Close();
+	iServer.Close();
+	return KErrNone;
+	}
+
+TInt CTCPTransport::RequestSend( TDesC8 *aData, const TUint aDataLength )
+	{
+	assert( aData->Length() == aDataLength );
+	// Write to the socket
+	TRequestStatus status;
+	iSocket.Write( *aData, status );
+	User::WaitForRequest( status );
+	return status.Int();
+	}
+
+TInt CTCPTransport::RequestReceive( TPtr8 *aRecvBufferPtr, TUint aByteCount )
+	{
+	assert( aRecvBufferPtr->MaxLength() == aByteCount );
+	// Read from the socket
+	TRequestStatus status;
+	iSocket.Read( *aRecvBufferPtr, status );
+	User::WaitForRequest( status );
+	return status.Int();
+	}
+
+TText8 *CTCPTransport::Error( void )
+	{
+	return NULL;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CTCPTransport.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CTCPTRANSPORT_H__
+#define __CTCPTRANSPORT_H__
+
+#include <es_sock.h>
+#include <in_sock.h>
+
+#include "MUCCTransport.h"
+
+const TUint KStatHeaderSize			= 8;
+const TUint KLittleStatPort			= 3000;
+const TUint KLittleStatListenQueue	= 1;
+const TUint KMaxTCPIPPacketSize		= 1024*32;
+const TUint	KUCCTCPPort				= 3001;
+
+class CTCPTransport : public MUCCTransport
+	{
+public:
+	// construction
+	CTCPTransport();
+	virtual ~CTCPTransport();
+
+	// from MStatNetwork
+	TInt InitialiseL();
+	TInt ConnectL( TDesC *aRemoteHost );
+	TInt RequestSend( TDesC8 *aCommandData, const TUint aDataLength );
+	TInt RequestReceive( TPtr8 *aRecvBufferPtr, TUint aByteCount );
+	TInt Disconnect( void );
+	TInt Release( void );
+	TText8 *Error( void );
+
+private:
+	RSocket		iSocket;
+	RConnection iConnection;
+	RSocketServ iServer;
+	TInetAddr	iDestAddr;
+	};
+
+#endif // __CTCPTRANSPORT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceControl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,380 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <e32uid.h>
+#include <string.h>
+#include <stdlib.h>
+
+
+/**********************************************************************************
+ *
+ * Local Includes
+ *
+ *********************************************************************************/
+#include "assert.h"
+#include "CUCCSDeviceControl.h"
+
+// Error Codes
+#include "CProtocolTypes.h"
+#include "UCCS_ErrorCodes.h"
+
+
+/**********************************************************************************
+ *
+ * Dll Entry point
+ *
+ *********************************************************************************/
+/**********************************************************************************
+ *
+ * Construction / Destruction
+ *
+ *********************************************************************************/
+EXPORT_C CUCCSDeviceControl* CUCCSDeviceControl::New()
+{
+	CUCCSDeviceControl* self = new CUCCSDeviceControl();
+    CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+    return self;
+}
+
+
+CUCCSDeviceControl::CUCCSDeviceControl()
+{
+}
+
+
+void CUCCSDeviceControl::ConstructL()
+{
+	iProtocol = new (ELeave) CUCCSDeviceProtocol();
+	assert( iProtocol != NULL );
+}
+
+
+EXPORT_C CUCCSDeviceControl::~CUCCSDeviceControl()
+{
+	int ret;
+	ret = iProtocol->disconnect();
+	assert (ret == TDC_SUCCESS);
+	assert( iProtocol != NULL );
+	delete iProtocol;
+	iProtocol = NULL;
+}
+
+
+EXPORT_C TUint CUCCSDeviceControl::connectL( TDesC *aRemoteHost, TDPTransport aTransportType )
+{
+	int ret = iProtocol->initialise(*aRemoteHost,aTransportType);
+	if (ret != TDP_SUCCESS)
+		return TDC_ERRINTIALISING;
+	return TDC_SUCCESS;
+}
+
+
+/**********************************************************************************
+ *
+ * startUseCase
+ *
+ *********************************************************************************/
+EXPORT_C TUint CUCCSDeviceControl::startUseCase ( TUint aData, int *aErrorCode )
+{		
+	int ret, datalen;
+	TStartUsecaseRequest req;
+	TStartUsecaseReply rep;
+	TPCommand cmdID;
+
+	// Send the request
+	cmdID = CMD_REQ_STARTUSECASEID;
+	req.iUsecaseID = aData;
+	datalen = sizeof(req);
+	
+	ret = iProtocol->sendMessage( cmdID, datalen, &req);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRSENDING;
+
+	// Get the reply
+	datalen = sizeof(rep);
+	ret = iProtocol->receiveMessage ( &cmdID, &datalen, &rep);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRRECV;
+
+	// Check that the reply cmdID is what we expect it to be
+	if ( cmdID != CMD_REP_STARTUSECASEID )
+		return TDC_INVALIDREPLY;
+
+	// Then return the result
+	return rep.iResult;
+}
+
+/**********************************************************************************
+ *
+ * signal
+ *
+ *********************************************************************************/
+EXPORT_C TUint CUCCSDeviceControl::signal( TUint aData, int *aErrorCode )
+{
+	int ret, datalen;
+	TSignalRequest req;
+	TSignalReply rep;
+	TPCommand cmdID;
+
+	// Send the request
+	cmdID = CMD_REQ_SIGNALID;
+	req.iUsecaseID = aData;
+	datalen = sizeof(req);
+	
+	ret = iProtocol->sendMessage( cmdID, datalen, &req);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRSENDING;
+
+	// Get the reply
+	datalen = sizeof(rep);
+	ret = iProtocol->receiveMessage ( &cmdID, &datalen, &rep);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRRECV;
+
+	// Check that the reply cmdID is what we expect it to be
+	if ( cmdID != CMD_REP_SIGNALID )
+		return TDC_INVALIDREPLY;
+
+	// Then return the result
+	return rep.iResult;
+}
+
+/**********************************************************************************
+ *
+ * waitfor
+ *
+ *********************************************************************************/
+EXPORT_C TUint CUCCSDeviceControl::waitfor( TUint aData, int *aErrorCode )
+{
+	int ret, datalen;
+	TWaitRequest req;
+	TWaitReply rep;
+	TPCommand cmdID;
+
+	// Send the request
+	cmdID = CMD_REQ_WAITID;
+	req.iUsecaseID = aData;
+	datalen = sizeof(req);
+	
+	ret = iProtocol->sendMessage( cmdID, datalen, &req);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRSENDING;
+
+	// Get the reply
+	datalen = sizeof(rep);
+	ret = iProtocol->receiveMessage ( &cmdID, &datalen, &rep);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRRECV;
+
+	// Check that the reply cmdID is what we expect it to be
+	if ( cmdID != CMD_REP_WAITID )
+		return TDC_INVALIDREPLY;
+
+	// Then return the result
+	return rep.iResult;
+}
+
+/**********************************************************************************
+ *
+ * rendezvous
+ *
+ *********************************************************************************/
+EXPORT_C TUint CUCCSDeviceControl::rendezvous( TUint aData, int *aErrorCode )
+{
+	int ret, datalen;
+	TRendezvousRequest req;
+	TRendezvousReply rep;
+	TPCommand cmdID;
+
+	// Send the request
+	cmdID = CMD_REQ_RENDEZVOUSID;
+	req.iUsecaseID = aData;
+	datalen = sizeof(req);
+	
+	ret = iProtocol->sendMessage( cmdID, datalen, &req);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRSENDING;
+
+	// Get the reply
+	datalen = sizeof(rep);
+	ret = iProtocol->receiveMessage ( &cmdID, &datalen, &rep);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRRECV;
+
+	// Check that the reply cmdID is what we expect it to be
+	if ( cmdID != CMD_REP_RENDEZVOUSID )
+		return TDC_INVALIDREPLY;
+
+	// Then return the result
+	return rep.iResult;
+}
+
+/**********************************************************************************
+ *
+ * endUseCase
+ *
+ *********************************************************************************/
+EXPORT_C TUint CUCCSDeviceControl::endUseCase (TUint aUseCaseID, TUint aResult, int *aErrorCode )
+{	
+	int ret, datalen;
+	TEndUsecaseRequest req;
+	TEndUsecaseReply rep;
+	TPCommand cmdID;
+
+	// Send the request
+	cmdID = CMD_REQ_ENDUSECASEID;
+	req.iUsecaseID = aUseCaseID;
+	req.iResult = aResult;
+	datalen = sizeof(req);
+	
+	ret = iProtocol->sendMessage( cmdID, datalen, &req);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRSENDING;
+
+	// Get the reply
+	datalen = sizeof(rep);
+	ret = iProtocol->receiveMessage ( &cmdID, &datalen, &rep);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRRECV;
+
+	// Check that the reply cmdID is what we expect it to be
+	if ( cmdID != CMD_REP_ENDUSECASEID )
+		return TDC_INVALIDREPLY;
+
+	// Then return the result
+	return rep.iCommandResult;
+}
+
+/**********************************************************************************
+ *
+ * getVariableName
+ *
+ *********************************************************************************/
+EXPORT_C TUint CUCCSDeviceControl::getVariableName( char* aVariableName, char* aOutputBuffer, int aOutputBufferSize, int *aErrorCode )
+{
+	int ret, len, recDatalen;
+	TGetVariableNameRequest var_req;
+	TGetVariableNameReply var_rep;
+	TPCommand cmd;
+
+	// Check params
+	assert ( aVariableName != NULL );
+	assert ( aOutputBuffer != NULL );
+	assert ( aOutputBufferSize >= 0);
+
+	// Check if aVariableName can be copied into our structure
+	len = strlen(aVariableName) + 1;
+	if ( len > MAXVARNAMELEN )
+		return TDC_VARNAMETOOLONG;
+
+	// Then copy into our buffer
+	memcpy ( var_req.iVariableName, aVariableName, len);
+
+	// Send the request
+	cmd = CMD_REQ_GETVARIABLENAMEID;
+	ret = iProtocol->sendMessage( cmd, sizeof(var_req), &var_req);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRSENDING;
+
+	// Get the reply
+	recDatalen = sizeof(var_rep);
+	ret = iProtocol->receiveMessage( &cmd, &recDatalen, &var_rep);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRRECV;
+
+	// Check whether we successfully retrieved the value we want
+	if ( cmd != CMD_REP_GETVARIABLENAMEID)
+		return TDC_INVALIDREPLY;			// Not what we are expecting 
+
+	// Only copy the data if everything went ok at the UCCS end - UCCS_OK 
+	if ( var_rep.iResult == UCCS_OK )
+	{
+		// Return the data
+		// Check that the data received will fit into the return buffer
+		len = strlen (var_rep.iVariableValue) + 1;
+		if ( len > aOutputBufferSize )
+			return TDC_VARVALTOOLONG;
+
+		// Else copy the data into the return buffer
+		memcpy ( aOutputBuffer, var_rep.iVariableValue, len);
+	}
+
+	return var_rep.iResult;
+}
+
+/**********************************************************************************
+ *
+ * runCommand
+ *
+ *********************************************************************************/
+EXPORT_C TUint CUCCSDeviceControl::runCommandL( char* aCommandLine, int *aErrorCode )
+{
+	int ret, len, recDatalen;
+	TRunCommandRequest* run_req = new (ELeave) (TRunCommandRequest);
+	TRunCommandReply run_rep;
+	TPCommand cmd;
+
+	// Check params
+	assert ( aCommandLine != NULL );
+
+	// Check if aCommandLine can be copied into our structure
+	len = strlen( aCommandLine )+1;
+	if ( len > MAXCOMMANDLINELEN )
+		return TDC_COMMANDLINETOOLONG;
+
+	// Then copy into our buffer
+	memset( run_req->iCommandLine, 0x00, sizeof(run_req->iCommandLine) );
+	memcpy( run_req->iCommandLine, aCommandLine, len);
+
+	// Send the request
+	cmd = CMD_REQ_RUNCOMMAND;
+	ret = iProtocol->sendMessage( cmd, sizeof(*run_req), run_req);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRSENDING;
+
+	// Get the reply
+	recDatalen = sizeof(run_rep);
+	ret = iProtocol->receiveMessage( &cmd, &recDatalen, &run_rep);
+	*aErrorCode = ret;
+	if ( ret != TDP_SUCCESS )
+		return TDC_ERRRECV;
+
+	// Check whether we successfully retrieved the value we want
+	if ( cmd != CMD_REP_RUNCOMMAND)
+		return TDC_INVALIDREPLY;			// Not what we are expecting 
+
+	return run_rep.iResult;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceControl.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CUCCSDeviceControl Class
+*
+*/
+
+
+
+#ifndef _CUCCSDeviceControl_H
+#define _CUCCSDeviceControl_H
+
+
+/*****************************************************************************
+ *
+ * System Includes 
+ *
+ ****************************************************************************/
+#include <e32cons.h>
+#include <e32def.h>
+
+#include <cuccsdeviceprotocol.h>
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+
+
+/*****************************************************************************
+ *
+ *  Types
+ *
+ ****************************************************************************/
+typedef enum {
+	TDC_SUCCESS,
+	TDC_ERRINTIALISING,
+	TDC_ERRSENDING,
+	TDC_ERRRECV,
+	TDC_INVALIDREPLY,
+	TDC_VARNAMETOOLONG,
+	TDC_VARVALTOOLONG,
+	TDC_COMMDBERR,
+	TDC_RECORDIDNOTSPECIFIED,
+	TDC_COMMANDLINETOOLONG
+} TDCError;
+
+
+/*****************************************************************************
+ *
+ * CUCCSDeviceControl
+ *
+ ****************************************************************************/
+class CUCCSDeviceControl : CBase
+{
+public:
+	// Construction / Destruction						
+	IMPORT_C static CUCCSDeviceControl* New(); 
+	IMPORT_C ~CUCCSDeviceControl();
+
+	// External interface
+	IMPORT_C TUint connectL( TDesC *aRemoteHost, TDPTransport aTransportType = TDP_SERIAL );
+	IMPORT_C TUint startUseCase( TUint aData, int *aErrorCode );  
+	IMPORT_C TUint signal( TUint aData, int *aErrorCode );
+	IMPORT_C TUint waitfor( TUint aData, int *aErrorCode );
+	IMPORT_C TUint rendezvous( TUint aData, int *aErrorCode );
+	IMPORT_C TUint endUseCase( TUint aUseCaseData, TUint aResult, int *aErrorCode );
+	IMPORT_C TUint getVariableName( char* aVariableName, char* aOutputBuffer, int aOutputBufferSize, int *aErrorCode );
+	IMPORT_C TUint runCommandL( char* aCommandLine, int *aErrorCode );
+
+private:
+	CUCCSDeviceControl();
+	void ConstructL();
+
+private:
+	CUCCSDeviceProtocol *iProtocol;
+};
+
+#endif
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceProtocol.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Includes
+*
+*/
+
+
+
+#include <e32math.h>
+#include <e32std.h>
+
+#include "CProtocolTypes.h"
+#include "CSerialTransport.h"
+#include "CTCPTransport.h"
+#include "CUCCSDeviceProtocol.h"
+#include "assert.h"
+
+
+/*****************************************************************************
+ *
+ *	Constructor
+ *
+ ****************************************************************************/
+CUCCSDeviceProtocol::CUCCSDeviceProtocol()
+{		
+	iTransport = NULL;
+	iStatus = TDP_IDLE;
+
+	// Seed the random number generator - this requires a 64 bit seed
+	TTime now;
+	now.HomeTime();
+	iRandomSeed = now.Int64();
+}
+
+
+/*****************************************************************************
+ *
+ *	Destructor 
+ *
+ ****************************************************************************/
+CUCCSDeviceProtocol::~CUCCSDeviceProtocol()
+{
+	assert ( iStatus == TDP_IDLE );
+	assert ( iTransport == NULL );
+}
+
+
+/*****************************************************************************
+ *
+ *	Initialise 
+ *
+ ****************************************************************************/
+TDPError CUCCSDeviceProtocol::initialise(TBufC16<40> aRemoteHost, TDPTransport aTransportType)
+	{	
+	// Check the state
+	assert ( iStatus == TDP_IDLE );
+
+	// Check params
+	assert (aRemoteHost.Length() > 0);
+	
+	// Set the member data
+	iRand_UID = Math::Rand( iRandomSeed );
+	iRemoteHost = aRemoteHost;
+
+	// Initialise the serial transport
+	if( iTransport == NULL )
+		{
+		TInt r = 0;
+		if( aTransportType == TDP_SERIAL )
+			{
+			TRAP ( r, iTransport = CSerialTransport::NewL(_L("ECUART")) );
+			}
+		else if( aTransportType == TDP_TCP )
+			{
+			TRAP ( r, iTransport = new (ELeave) CTCPTransport() );
+			
+			}
+		else
+			{
+			return TDP_ERRINTIALISING;
+			}
+
+		if ( r != KErrNone)
+			return TDP_ERRINTIALISING;
+		
+		TRAPD ( s,iTransport->InitialiseL() );
+		if ( s != KErrNone)
+			{	
+			iTransport->Release();
+			delete iTransport;
+			iTransport = NULL;
+			return TDP_ERRINTIALISING;
+			}
+
+		TRAPD ( t, iTransport->ConnectL(&iRemoteHost) );
+		if ( t != KErrNone)
+			{
+			iTransport->Disconnect();
+			iTransport->Release();
+			delete iTransport;
+			iTransport = NULL;
+			return TDP_ERRINTIALISING;
+			}
+		}
+
+	iStatus = TDP_CONNECTED;
+	return TDP_SUCCESS;
+	}
+
+
+/*****************************************************************************
+ *
+ *	Disconnect 
+ *
+ ****************************************************************************/
+TDPError CUCCSDeviceProtocol::disconnect()
+{
+	// check the state
+	if( iStatus == TDP_IDLE ) {
+		return TDP_SUCCESS;
+	}
+	assert ( iStatus == TDP_CONNECTED );
+
+	// if the serial transport is up then bring it down
+	if( iTransport != NULL ) {
+		iTransport->Disconnect();
+		iTransport->Release();	
+		delete iTransport;
+		iTransport = NULL;
+	}
+
+	// update the state and return
+	iStatus = TDP_IDLE;
+	return TDP_SUCCESS;
+}
+
+
+/*****************************************************************************
+ *
+ *	Receive Message 
+ *
+ ****************************************************************************/
+TDPError CUCCSDeviceProtocol::receiveMessage(TPCommand* aCmd, int* aDataLength, void* aData)
+{
+	TPHeader header;
+	TInt ret;
+	int bufferLen;
+
+	// Check the state
+	assert ( iStatus == TDP_CONNECTED );
+
+	// Check params
+	assert( aCmd != NULL );
+	assert( aDataLength != NULL );
+	assert( aData != NULL );
+
+	// Record the original length of the aData buffer b4 it gets overwritten
+	bufferLen = *aDataLength;
+
+	// Read the header
+	TPtr8 p( (TUint8*)&header,sizeof(header), sizeof(header) );
+	ret = iTransport->RequestReceive( &p, p.Size());	
+	if ( ret != KErrNone)
+		return TDP_RECVERROR;
+
+	// Check that this is a response to our last message
+	if ( header.iUid != iRand_UID)
+		return TDP_UIDMISMATCH;
+
+	// Extract the header information
+	*aCmd = header.iCmdID;
+	*aDataLength = header.iDataLen;
+
+	// Now read the rest of the data
+	TPtr8 q( (TUint8*)aData, bufferLen, bufferLen);
+	ret = iTransport->RequestReceive( &q, q.Size());	
+	if ( ret != KErrNone)
+		return TDP_RECVERROR;
+
+	// Increment the UID for next time
+	iRand_UID += 1;
+	return TDP_SUCCESS;
+}
+
+
+/*****************************************************************************
+ *
+ *	Send Message 
+ *
+ ****************************************************************************/
+TDPError CUCCSDeviceProtocol::sendMessage(TPCommand aCmd, int aDataLength, void *aData)
+{
+	TPHeader header;
+	TInt ret;
+
+	// Check the state
+	assert ( iStatus == TDP_CONNECTED );
+
+	// Check params
+	assert( aData != NULL );
+
+	if( isValidCMDID(aCmd) == 0 ) 
+	{
+		return TDP_INVALIDCMDID;
+	}
+
+	// Create the header
+	header.iCmdID = aCmd;
+	header.iDataLen = aDataLength;
+	header.iUid = (int)iRand_UID;
+	
+	// Send the header first
+	TPtrC8 p( (unsigned char*)&header , sizeof(header) );
+	ret = iTransport->RequestSend( &p, p.Size());
+
+	if (ret != KErrNone)
+		return TDP_SENDERROR;
+
+	// Now send the rest of the data
+	TPtrC8 q( (unsigned char*)aData , aDataLength );
+	ret = iTransport->RequestSend( &q , q.Size());
+	if (ret != KErrNone)
+		return TDP_SENDERROR;
+
+	return TDP_SUCCESS;
+}
+
+
+/**********************************************************************************************
+ *
+ * Check IDs
+ *
+ *********************************************************************************************/	
+bool CUCCSDeviceProtocol::isValidCMDID(TPCommand aCommand)
+{	
+	bool ret_val = true;
+
+	switch (aCommand) 
+	{
+		case CMD_REQ_SIGNALID:
+			break;
+
+		case CMD_REQ_RENDEZVOUSID:
+			break;
+
+		case CMD_REQ_WAITID:
+			break;
+   
+		case CMD_REQ_STARTUSECASEID:
+			break;
+
+		case CMD_REQ_ENDUSECASEID:
+			break;
+	
+		case CMD_REQ_GETVARIABLENAMEID:
+			break;
+
+		case CMD_QUITID:
+			break;
+
+		case CMD_REQ_RUNCOMMAND:
+			break;
+
+		default:
+			ret_val = false;
+			break;
+   }
+
+	return ret_val;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceProtocol.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CUCCSDeviceProtocol Class
+*
+*/
+
+
+
+#ifndef _CUCCSDeviceProtocol_H
+#define _CUCCSDeviceProtocol_H
+
+
+/*****************************************************************************
+ *
+ * System Includes 
+ *
+ ****************************************************************************/
+#include <e32cons.h>
+
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+//#include "MUCCTransport.h"
+//#include "CProtocolTypes.h"
+
+#include <mucctransport.h>
+#include <cprotocoltypes.h>
+
+
+/*****************************************************************************
+ *
+ *  Types
+ *
+ ****************************************************************************/
+typedef enum {
+	TDP_SUCCESS,
+	TDP_INVALIDCMDID,
+	TDP_SENDERROR,
+	TDP_RECVERROR,
+	TDP_ERRINTIALISING,
+	TDP_UIDMISMATCH,
+} TDPError;
+
+typedef enum {
+	TDP_IDLE,
+	TDP_CONNECTED
+} TDPStatus;
+
+
+typedef enum 
+{
+	TDP_NONE,
+	TDP_SERIAL,
+	TDP_TCP
+} TDPTransport;
+
+/*****************************************************************************
+ *
+ * Class Definition
+ *
+ ****************************************************************************/
+class CUCCSDeviceProtocol : public CBase
+{
+public:
+	CUCCSDeviceProtocol();
+	~CUCCSDeviceProtocol();
+
+	TDPError initialise(TBufC16<40> aRemoteHost, TDPTransport aTransportType = TDP_SERIAL );
+	TDPError disconnect();
+	
+	TDPError sendMessage(TPCommand aCmd, int aDataLength, void *aData);
+	TDPError receiveMessage(TPCommand* aCmd, int* aDataLength, void* aData);
+
+private:
+	bool isValidCMDID(TPCommand aCommand);
+
+	int iRand_UID;
+	MUCCTransport* iTransport;
+	TBufC16<40> iRemoteHost;
+	TInt64 iRandomSeed;
+	TDPStatus iStatus;
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/MUCCTransport.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+/**
+ @file MUCCTransport.h
+*/
+
+#ifndef __MUCCTRANSPORT_H__
+#define __MUCCTRANSPORT_H__
+
+class MUCCTransport
+{
+public:
+	virtual ~MUCCTransport() {}
+	virtual TInt InitialiseL() = 0;
+	virtual TInt ConnectL( TDesC *aRemoteHost ) = 0;
+	virtual TInt RequestSend( TDesC8 *aData, const TUint aLength ) = 0;
+	virtual TInt RequestReceive( TPtr8 *aRecvBufferPtr, TUint aByteCount ) = 0;
+	virtual TInt Disconnect( void ) = 0;
+	virtual TInt Release( void ) = 0;
+	virtual TText8 *Error( void ) = 0;
+};
+
+#endif // __MUCCTRANSPORT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/NetworkEmulatorControl.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __NETWORKEMULATORCONTROL_H__
+#define __NETWORKEMULATORCONTROL_H__
+
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+#include <networkemulator/cuccsdevicecontrol.h>
+#include <networkemulator/cnetworkemulatorsetupcommdb.h>
+
+
+#endif //__NETWORKEMULATORCONTROL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/UCCSDeviceControl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* UCCSDeviceControl.cpp : Defines the entry point for the console application.
+*
+*/
+
+
+
+int main(int argc, char* argv[])
+{
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UCCSDeviceControl/assert.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Defines the standard C assert macro and an asserte macro
+* to show the source file and line in a message window.
+*
+*/
+
+
+
+#ifndef __ASSERT_H__
+#define __ASSERT_H__
+
+// asserte
+// Extend assert to raise a panic that features the source file and 
+// line number that caused the assert.
+#include <e32std.h>
+extern void AssertE( TPtrC8 _file, TInt _line );
+#define asserte(x)	if(!(x)) { AssertE( (TPtrC8(reinterpret_cast<const TText8*>(__FILE__))), __LINE__); }
+
+// assert
+// Exit the program and show the message "Assert Failed".
+#define assert(x)	__ASSERT_ALWAYS((x),User::Panic(_L("Assert Failed"),0))
+
+#endif //__ASSERT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/CSUuinterface.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Nov 24 15:19:48 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcUuinterface.h"
+#include "CSUuinterface.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSUuinterface::CSUuinterface()
+{
+}
+
+CSUuinterface::~CSUuinterface()
+{
+}
+
+int CSUuinterface::GetKey()
+{
+	return iKey;
+}
+
+void CSUuinterface::SetKey( int aKey )
+{
+	iKey = aKey;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/CSUuinterface.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Nov 24 15:19:47 2003
+*
+*/
+
+
+
+
+#ifndef __CSUUINTERFACE_H__
+#define __CSUUINTERFACE_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "uuinterface.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSUuinterface
+ * 
+ ***************************************************************************************/
+class CSUuinterface
+{
+public:
+	// Standard Methods
+	CSUuinterface();
+	~CSUuinterface();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+
+private:
+	int iKey;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/CSvcUuinterface.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,706 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Wed Nov 05 16:06:20 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcUuinterface.h"
+#include "uuinterface.h"
+#include "../ProcessLibrary/proclib.h"
+#include "../include/standard_unix.h"
+#include "../include/standard_service_manager.h"
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSUuinterface> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcUuinterface::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	// Not implemented as we will never have more that one instance
+	assert( !"NOT IMPLEMENTED" );
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcUuinterface::SetError( int aMethod, void *aArgs, int aError )
+{
+	TResult* result;
+	TComponentList *rv_component_list;
+	int rv = ERR_NONE;
+	
+	// Check params
+	assert ( aArgs != NULL );
+
+	switch( aMethod ) {
+	case LIST_DEVICES:
+		SET_LIST_ERROR_CODE( TComponentList, rv_component_list );
+
+	case ST_SETDELAY:
+	case ST_SETDROPPERCENTAGE:
+	case ST_SETDUPLICATEPERCENTAGE:
+	case ST_SETBANDWIDTH:
+	case ST_SETDRD:
+	case ST_CLEARSETTINGS:
+	case ST_STOPSERVICE:
+	case ST_RESET:
+		SET_ERROR_CODE( TResult, iStandardResult, result );
+		break;
+
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError
+ * 
+ ***************************************************************************************/
+int CSvcUuinterface::GetError( int aMethod, void *aArgs )
+{
+	// Not implemented as we will never have more that one instance
+	assert( !"NOT IMPLEMENTED" );
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcUuinterface::StartRPCService( CComponentManager<CSUuinterface> *aComponentManager, TStartupInfo *aArg )
+{
+	assert( iComponentManager == NULL );
+	iComponentManager = aComponentManager;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcUuinterface::StopRPCService()
+{
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_setdelay
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_setdelay( TConfigValue aArgs )
+{
+	TResult rv;
+	int ret;
+
+	char commandLine[MAX_COMMANDLINE];
+	char finalSrc[TOTAL_MAX_ADDRESS_LEN]; 
+	char finalDst[TOTAL_MAX_ADDRESS_LEN];
+
+	// check the values in the config values structure
+	ret = CheckConfigValue( aArgs, finalSrc, finalDst );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -u -a %s %s --delay %d.%d %d.%d/%d.%d",
+		finalSrc, 
+		finalDst, 
+		aArgs.iValueIntegerPart, 
+		aArgs.iValueFractionPart, 
+		aArgs.iSigmaIntegerPart,
+		aArgs.iSigmaFractionPart,
+		aArgs.iCorrelationIntegerPart,
+		aArgs.iCorrelationFractionPart );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_setdroppercentage
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_setdroppercentage( TConfigValue aArgs )
+{
+	TResult rv;
+	int ret;
+
+	char commandLine [MAX_COMMANDLINE];
+	char finalSrc[TOTAL_MAX_ADDRESS_LEN]; 
+	char finalDst[TOTAL_MAX_ADDRESS_LEN];
+
+	// check the values in the config values structure
+	ret = CheckConfigValue( aArgs, finalSrc, finalDst );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+	ret = CheckPercentage( aArgs.iValueIntegerPart );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -u -a  %s %s --drop %d.%d/%d.%d",
+		finalSrc, 
+		finalDst, 
+		aArgs.iValueIntegerPart, 
+		aArgs.iValueFractionPart, 
+		aArgs.iCorrelationIntegerPart,
+		aArgs.iCorrelationFractionPart );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);	
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_setduplicatepercentage
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_setduplicatepercentage( TConfigValue aArgs )
+{
+	TResult rv;
+	int ret;
+
+	char commandLine [MAX_COMMANDLINE];
+	char finalSrc[TOTAL_MAX_ADDRESS_LEN]; 
+	char finalDst[TOTAL_MAX_ADDRESS_LEN];
+
+	// check the values in the config values structure
+	ret = CheckConfigValue( aArgs, finalSrc, finalDst );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}
+	
+	ret = CheckPercentage( aArgs.iValueIntegerPart );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -u -a %s %s --dup %d.%d/%d.%d",
+		finalSrc,
+		finalDst, 
+		aArgs.iValueIntegerPart, 
+		aArgs.iValueFractionPart, 
+		aArgs.iCorrelationIntegerPart,
+		aArgs.iCorrelationFractionPart );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);	
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+	
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_setbandwidth
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_setbandwidth( TConfigValue aArgs )
+{
+	TResult rv;
+	int ret;
+	
+	char commandLine [MAX_COMMANDLINE];
+	char finalSrc[TOTAL_MAX_ADDRESS_LEN]; 
+	char finalDst[TOTAL_MAX_ADDRESS_LEN];
+
+	// check the values in the config values structure
+	ret = CheckConfigValue( aArgs, finalSrc, finalDst );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -u -a %s %s --bandwidth %d.%d",
+		finalSrc, 
+		finalDst, 
+		aArgs.iValueIntegerPart, 
+		aArgs.iValueFractionPart );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);	
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+
+	return rv;
+}
+
+
+/**************************************************************************************** * 
+ * PUBLIC: st_setdrd
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_setdrd( TConfigValue aArgs )
+{
+	TResult rv;
+	int ret;
+	
+	char commandLine [MAX_COMMANDLINE];
+	char finalSrc[TOTAL_MAX_ADDRESS_LEN]; 
+	char finalDst[TOTAL_MAX_ADDRESS_LEN];
+
+	// check the values in the config values structure
+	ret = CheckConfigValue( aArgs, finalSrc, finalDst );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+    ret = CheckDRDs( aArgs.iValueIntegerPart, aArgs.iValueFractionPart,
+					aArgs.iMaximumValueIntegerPart, aArgs.iMaximumValueFractionPart, 
+					aArgs.iCongestionIntegerPart, aArgs.iCongestionFractionPart );
+
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -u -a %s %s --drd %d.%d %d.%d %d.%d",
+		finalSrc, 
+		finalDst, 
+		aArgs.iValueIntegerPart, 
+		aArgs.iValueFractionPart,
+		aArgs.iMaximumValueIntegerPart, 
+		aArgs.iMaximumValueFractionPart,
+		aArgs.iCongestionIntegerPart, 
+		aArgs.iCongestionFractionPart );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+	
+	return rv;
+}
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_clearsettings
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_clearsettings( TConfigValue aArgs )
+{
+	TResult rv;
+	int ret;
+	
+	char commandLine [MAX_COMMANDLINE];
+	char finalSrc[TOTAL_MAX_ADDRESS_LEN]; 
+	char finalDst[TOTAL_MAX_ADDRESS_LEN];
+
+	// check the values in the config values structure
+	ret = CheckConfigValue( aArgs, finalSrc, finalDst );
+	if ( ret == ERR_INVALIDARG )
+	{
+		memset( &rv, 0, sizeof(rv) );
+		rv.iStandardResult = ERR_INVALIDARG;	
+		return rv;
+	}	
+
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -r %s %s",
+		finalSrc, 
+		finalDst );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);	
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_stopservice
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_stopservice( void )
+{
+	TResult rv;
+	int ret;
+	char commandLine [MAX_COMMANDLINE];
+	
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -d" );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+	
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: st_reset
+ * 
+ ***************************************************************************************/
+TResult CSvcUuinterface::st_reset( void )
+{
+	TResult rv;
+	int ret;
+	char commandLine [MAX_COMMANDLINE];
+	
+	// construct the command line
+	snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_reset.pl" );
+
+	// execute the command and return the result
+	ret = execute(commandLine, &rv);	
+	assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) );
+	
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE: Executes the given command line
+ * 
+ ***************************************************************************************/
+int CSvcUuinterface::execute(const char* aCommandLine, TResult* rv)
+{
+	int errcode;
+	CAProcess process;
+	TCAProcessError perr;
+	TProcessExitReason preason;
+
+	// Check params
+	assert ( aCommandLine != NULL );
+	assert ( rv != NULL );
+
+	// init the rv
+	memset( rv, 0, sizeof(*rv) );
+	rv->iStandardResult = ERR_NONE;	
+
+	// execute the process - return any errors
+	perr = process.Execute( aCommandLine, &errcode );  
+	if( perr != CAE_NONE ) {
+		rv->iStandardResult = ERR_PROCESSEXECUTEFAILED;
+		rv->iExtendedCode = (int)perr;
+		rv->iSystemError = errcode;
+	}
+
+	// if there was an error then return now
+	if( rv->iStandardResult != ERR_NONE ) {
+		return ERR_FAILEDTOEXECUTECOMMAND ;
+	}
+
+	// save the status, exitreason, etc
+	perr = process.GetExitReason( &preason );
+	assert( perr == CAE_NONE );
+	rv->iExtendedCode = (int)preason;
+	
+	perr = process.GetExitCode( &errcode );
+	assert( perr == CAE_NONE );
+	rv->iSystemError = errcode;
+	
+	return ERR_NONE;
+}
+
+/*******************************************************************************
+ *
+ * INTERNAL FUNCTION: CheckConfigVals
+ *
+ ******************************************************************************/
+int CSvcUuinterface::CheckConfigValue( TConfigValue aConfigValue, char* afinalSrc, char* afinalDst)
+{
+	int err;
+
+	assert ( afinalSrc != NULL );
+	assert ( afinalDst != NULL );
+
+	// construct valid NISTNET source/destination strings from the passed information
+	err = GetSrcDstStrings( aConfigValue.iSourceAddress, aConfigValue.iDestinationAddress, 
+							aConfigValue.iProtocol,
+							aConfigValue.iSrcPort, aConfigValue.iDstPort,
+							afinalSrc, afinalDst );
+	if( err != ERR_NONE) {
+		return ERR_INVALIDARG;
+	}
+
+	// do semantic checking of the values
+	err = CheckCorrelation( aConfigValue.iCorrelationIntegerPart, aConfigValue.iCorrelationFractionPart );
+	if( err != ERR_NONE ) {
+		return ERR_INVALIDARG;
+	}
+
+	err = CheckPositive( aConfigValue.iSigmaIntegerPart, aConfigValue.iSigmaFractionPart );
+	if( err != ERR_NONE ) {
+		return ERR_INVALIDARG;
+	}
+
+	err = CheckPositive( aConfigValue.iValueIntegerPart, aConfigValue.iValueFractionPart );
+	if( err != ERR_NONE ) {
+		return ERR_INVALIDARG;
+	}
+
+	err = CheckPositive( aConfigValue.iMaximumValueIntegerPart, aConfigValue.iMaximumValueFractionPart );
+	if( err != ERR_NONE ) {
+		return ERR_INVALIDARG;
+	}
+
+	err = CheckPositive( aConfigValue.iCongestionIntegerPart, aConfigValue.iCongestionFractionPart );
+	if( err != ERR_NONE ) {
+		return ERR_INVALIDARG;
+	}
+
+	return ERR_NONE;
+}		
+
+/*******************************************************************************
+ *
+ * INTERNAL FUNCTION: CheckPorts
+ *
+ ******************************************************************************/
+int CSvcUuinterface::CheckPorts( int aSrcPort, int aDestPort )
+{
+	
+	if( !(( aSrcPort >= MIN_PORT_VAL ) && ( aSrcPort <= MAX_PORT_VAL )) ) {
+		return ERR_INVALIDARG;
+	}
+	
+	if( !(( aDestPort >= MIN_PORT_VAL ) && ( aDestPort <= MAX_PORT_VAL )) ) {
+		return ERR_INVALIDARG;
+	}
+
+	return ERR_NONE;
+}
+
+/*******************************************************************************
+ *
+ * INTERNAL FUNCTION: CheckProts
+ *
+ ******************************************************************************/
+int CSvcUuinterface::CheckProt( int aProtocol )
+{
+	if ( aProtocol == X_UDP ) 
+		return ERR_NONE;
+	
+	if ( aProtocol == X_TCP ) 
+		return ERR_NONE;
+
+	return ERR_INVALIDARG;
+}
+
+
+/*******************************************************************************
+ *
+ * INTERNAL FUNCTION: CheckPositive
+ *
+ ******************************************************************************/
+int CSvcUuinterface::CheckPositive( int aIntegerPart, int aFractionPart )
+{
+	if( aIntegerPart < 0 ) {
+		return ERR_INVALIDARG;
+	}
+	if( aFractionPart < 0 ) {
+		return ERR_INVALIDARG;
+	}
+	return ERR_NONE;
+}
+
+/*******************************************************************************
+ *
+ * INTERNAL FUNCTION: CheckCorrelation
+ *
+ ******************************************************************************/
+int CSvcUuinterface::CheckCorrelation( int aIntegerPart, int aFractionPart )
+{
+	if( (aIntegerPart > -1) && (aIntegerPart < 1) ) {
+		return ERR_NONE;
+	}
+	if( (aIntegerPart == -1) && (aFractionPart == 0) ) {
+		return ERR_NONE;
+	}
+	if( (aIntegerPart == 1) && (aFractionPart == 0) ) {
+		return ERR_NONE;
+	}
+	return ERR_INVALIDARG;
+}
+
+/*******************************************************************************
+ *
+ * INTERNAL FUNCTION: CheckDRDs
+ *
+ ******************************************************************************/
+int CSvcUuinterface::CheckDRDs( const int aDRDMinInt, const int aDRDMinFrac, 
+							    const int aDRDMaxInt, const int aDRDMaxFrac, 
+							    const int aDRDCongestInt, const int aDRDCongestFrac )
+{
+   	//Condition for drd vals is 0<=drdmin (<= drdcongest) <=drdmax
+   	if (!(aDRDMinInt>=0 && aDRDMinFrac>=0 && aDRDMaxInt >=0 && aDRDMaxFrac>=0 )) {
+		return ERR_INVALIDARG;
+   	}   
+   	if ( aDRDMinInt > aDRDMaxInt ) {
+		return ERR_INVALIDARG;
+   	}   
+   	if (aDRDCongestInt >= 0 && aDRDCongestFrac >=0) {
+   		if ( !( (aDRDMinInt < aDRDCongestInt) && (aDRDMaxInt > aDRDCongestInt) ) ) {
+			return ERR_INVALIDARG;
+   		}
+   	} else {
+		return ERR_INVALIDARG;	
+	}
+   	return ERR_NONE;
+}
+
+/*******************************************************************************
+ *
+ * INTERNAL FUNCTION: CheckPercentage
+ *
+ ******************************************************************************/
+int CSvcUuinterface::CheckPercentage( const int aPercentage )
+{
+	if (aPercentage >= 0 && aPercentage < 100)
+		return ERR_NONE;
+	return ERR_INVALIDARG;
+}
+
+/*******************************************************************************
+ *
+ * GetSrcDstStrings
+ *
+ ******************************************************************************/
+int CSvcUuinterface::GetSrcDstStrings(	char* aSrc, char* aDst, 
+						int aProtocol,
+						int aSrcPort, int aDstPort,
+						char* finalSrc, char* finalDst )
+{
+	int err, len;
+
+	// validate params
+	assert(aSrc!=NULL);
+	assert(aDst!=NULL);
+	assert(finalSrc!=NULL);
+	assert(finalDst!=NULL);
+
+	// Validate the ports
+	err = CheckPorts( aSrcPort,aDstPort );
+	if( err != ERR_NONE ) {
+		return ERR_INVALIDARG;
+	}
+
+	// Validate the prots
+	err = CheckProt( aProtocol );
+	if( err != ERR_NONE ) {
+		return ERR_INVALIDARG;
+	}
+
+	// Formulate a complete source string <ip-address> + ':' + <port> + '.' + <protocol>
+	len = strlen(aSrc) + 1 + 1 + 1 + 1 + 1;
+	assert( len < TOTAL_MAX_ADDRESS_LEN );
+	snprintf( finalSrc, TOTAL_MAX_ADDRESS_LEN, "%s:%d.%d", aSrc, aSrcPort, aProtocol );
+
+	// Formulate a complete dest string <ip-address> + ':' + <port> + '.' + <protocol>
+	len = strlen(aDst) + 1 + 1 + 1 + 1 + 1;
+	assert( len < TOTAL_MAX_ADDRESS_LEN );
+	snprintf( finalDst, TOTAL_MAX_ADDRESS_LEN, "%s:%d.%d", aDst, aDstPort, aProtocol );
+
+	// done
+	return ERR_NONE;
+}
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/CSvcUuinterface.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Wed Nov 05 16:06:20 2003
+*
+*/
+
+
+
+
+#ifndef __CSVCUUINTERFACE_H__
+#define __CSVCUUINTERFACE_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "uuinterface.h"
+#include "CSUuinterface.h"
+#include "CComponentManager.h"
+
+/****************************************************************************************
+ * 
+ * Defines
+ * 
+ ***************************************************************************************/
+#define MAX_COMMANDLINE			256	
+#define TOTAL_MAX_ADDRESS_LEN	128
+#define MAX_PORT_VAL			65535
+#define MIN_PORT_VAL			0
+
+ /****************************************************************************************
+ * 
+ * Definition: CSvcUuinterface
+ * 
+ ***************************************************************************************/
+class CSvcUuinterface
+{
+public:
+	/* standard methods */
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSUuinterface> *aComponentManager, TStartupInfo *aArg );
+	static int StopRPCService();
+
+	/* custom methods */
+	static TResult st_setdelay( TConfigValue aArgs );
+	static TResult st_setdroppercentage( TConfigValue aArgs );
+	static TResult st_setduplicatepercentage( TConfigValue aArgs );
+	static TResult st_setbandwidth( TConfigValue aArgs );
+	static TResult st_setdrd( TConfigValue aArgs );
+	static TResult st_clearsettings( TConfigValue aArgs );
+	static TResult st_stopservice( void );
+	static TResult st_reset( void );
+
+private:
+	static int execute(const char* aCommandLine, TResult* rv);
+	
+	// Methods to validate args
+	static int CheckDRDs( const int aDRDMinInt, const int aDRDMinFrac, const int aDRDMaxInt, const int aDRDMaxFrac, const int aDRDCongestInt, const int aDRDCongestFrac );
+	static int CheckPercentage(const int aPercentage);
+	static int CheckCorrelation( int aIntegerPart, int aFractionPart );
+	static int CheckPositive( int aIntegerPart, int aFractionPart );
+	static int CheckPorts( int aSrcPort, int DestPort );
+	static int CheckProt( int aProtocol );
+	static int GetSrcDstStrings( char* aSrc, char* aDst, 
+								int aSrcProt,
+								int aSrcPort,int aDstPort,
+								char* finalSrc, char* finalDst );
+	static int CheckConfigValue( TConfigValue aConfigValue, char* aFinalSrc, char* aFinalDst);
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/Load.Nistnet	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,79 @@
+#!/bin/bash
+#$Header: /usr/local/cvsroot/3GNetworkEmulator/Source/UUInterface/Load.Nistnet,v 1.1 2003/11/17 16:17:02 penuser Exp $
+# Script to load the kernel module, saving the rtc if possible
+#
+# Mark Carson, NIST/UMCP
+#  1/2001
+
+# Surely there's a better way to do this...
+versionstring=`uname -r | sed 's/\./ /g'`
+read version0 version1 version2 << below
+$versionstring
+below
+
+case $version0 in
+	2)
+		;;
+	*)
+		echo Sorry, NIST Net runs only on 2.0.xx or 2.2.xx kernels
+		exit 1
+		;;
+esac
+
+# This no doubt is not the way to find the system map
+# for the current kernel, but hopefully it will do.
+if [ -r /System.map ] ; then
+	map=/System.map
+elif [ -r /boot/System.map ] ; then
+	map=/boot/System.map
+elif [ -r /usr/src/linux/System.map ] ; then
+	map=/usr/src/linux/System.map
+fi
+
+case $version1 in
+	0)
+		# Look for irq_action - why doesn't a pipe work? Sheesh...
+		grep irq_action $map > /tmp/j$$
+		read irq_action junk < /tmp/j$$
+		rm /tmp/j$$
+		if [ "$irq_action" != "" ] ; then
+			insmod nistnet irq_desc_addr=0x$irq_action
+		else
+			insmod nistnet
+		fi
+		;;
+	2)
+		# Look for irq_desc - why doesn't a pipe work? Sheesh...
+		grep irq_desc $map > /tmp/j$$
+		read irq_desc junk < /tmp/j$$
+		rm /tmp/j$$
+		if [ "$irq_desc" != "" ] ; then
+			insmod nistnet irq_desc_addr=0x$irq_desc
+		else
+			insmod nistnet
+		fi
+		;;
+	4)
+		# Try to remove rtc module
+		rmmod rtc
+		if [ $? != 0 ] ; then
+		    echo "Couldn't find rtc module - /dev/rtc will be mostly"
+		    echo "unusable after running nistnet.  Sorry about that...."
+		    echo "To prevent this message, recompile rtc"
+		    echo "(Enhanced Real Time Clock Support, under"
+		    echo "character devices) as a module."
+		else
+		    echo "rtc module removed - you may want to reinstall it"
+		    echo "(with insmod rtc) after you are done with nistnet"
+		fi
+
+		insmod nistnet
+		echo "nistnet module installed"
+		;;
+	*)
+		echo Sorry, NIST Net runs only on 2.0, 2.2 or 2.4 kernels
+		exit 1
+		;;
+esac
+
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,53 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+include /home/penuser/3GNetworkEmulator/Makefile.conf
+
+BINDIR=		../../bin/
+TARGET=		../../bin/uuservice
+INCLUDES= 	-I../include
+
+CPSOURCE_PERL=	$(wildcard *.pl)
+CPTARGET_PERL=	$(patsubst %.pl,$(BINDIR)/%.pl,$(CPSOURCE_PERL))
+CPSOURCE=	$(CPSOURCE_PERL) Load.Nistnet
+CPTARGET=	$(CPTARGET_PERL) $(BINDIR)/Load.Nistnet
+
+OBJECTS=	CSUuinterface.o		\
+		CSvcUuinterface.o		\
+		UUInterface_svc.o		\
+		uuinterface_svc_stub_impl.o	\
+		UUInterface_xdr.o		
+
+
+LIBS=		-L../../BinInternal -lproc
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+all:	$(TARGET) $(CPTARGET)
+
+$(TARGET):	$(OBJECTS) ../../BinInternal/libproc.a
+	g++ -gstabs -Wall -o $(TARGET) $(OBJECTS) $(LIBS)
+
+$(CPTARGET):	$(CPSOURCE)
+	echo $(CPTARGET)
+	cp $(CPSOURCE) $(BINDIR)
+
+%.o:	%.c
+	gcc -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -gstabs -Wall $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ dyntmp* $(CPTARGET)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/UUInterface.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,179 @@
+# Microsoft Developer Studio Project File - Name="uuinterface" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=uuinterface - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "uuinterface.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "uuinterface.mak" CFG="uuinterface - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "uuinterface - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "uuinterface - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "uuinterface - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "uuinterface - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\External\source_for_build\oncrpc" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libproc.lib oncrpcms.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\BinInternal" /libpath:"..\..\External\binaries_for_build"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "uuinterface - Win32 Release"
+# Name "uuinterface - Win32 Debug"
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CUUInterface.cpp
+
+!IF  "$(CFG)" == "uuinterface - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "uuinterface - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\uuinterface.x
+
+!IF  "$(CFG)" == "uuinterface - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "uuinterface - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\uuinterface.x
+
+"uuinterface.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BinInternal\rpcgen -server -component_mod_component_impl -component_base -wrapstring uuinterface.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# End Group
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSUuinterface.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\uuinterface.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSUuinterface.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\UUInterface_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\uuinterface_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\UUInterface_xdr.c
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSvcUuinterface.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcUuinterface.h
+# End Source File
+# End Group
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/UUInterface.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "uuinterface"=.\uuinterface.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/UUInterface_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "uuinterface.h"
+
+static void uuinterface_2();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+	(void)pmap_unset(UUINTERFACE, UUINTERFACEVER);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, UUINTERFACE, UUINTERFACEVER, uuinterface_2, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (UUINTERFACE, UUINTERFACEVER, udp).\n");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, UUINTERFACE, UUINTERFACEVER, uuinterface_2, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (UUINTERFACE, UUINTERFACEVER, tcp).\n");
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+	exit(1);
+}
+
+static void
+uuinterface_2(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		TStartupInfo ss_startuprpcservice_2_arg;
+		int sc_shutdownrpcservice_2_arg;
+		TConfigValue st_setdelay_2_arg;
+		TConfigValue st_setdroppercentage_2_arg;
+		TConfigValue st_setduplicatepercentage_2_arg;
+		TConfigValue st_setbandwidth_2_arg;
+		TConfigValue st_setdrd_2_arg;
+		TConfigValue st_clearsettings_2_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_uuinterface_TStartupInfo;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_2;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_2;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_uuinterface_TComponentList;
+		local = (char *(*)()) list_devices_2;
+		break;
+
+	case ST_SETDELAY:
+		xdr_argument = xdr_uuinterface_TConfigValue;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_setdelay_2;
+		break;
+
+	case ST_SETDROPPERCENTAGE:
+		xdr_argument = xdr_uuinterface_TConfigValue;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_setdroppercentage_2;
+		break;
+
+	case ST_SETDUPLICATEPERCENTAGE:
+		xdr_argument = xdr_uuinterface_TConfigValue;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_setduplicatepercentage_2;
+		break;
+
+	case ST_SETBANDWIDTH:
+		xdr_argument = xdr_uuinterface_TConfigValue;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_setbandwidth_2;
+		break;
+
+	case ST_SETDRD:
+		xdr_argument = xdr_uuinterface_TConfigValue;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_setdrd_2;
+		break;
+
+	case ST_CLEARSETTINGS:
+		xdr_argument = xdr_uuinterface_TConfigValue;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_clearsettings_2;
+		break;
+
+	case ST_STOPSERVICE:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_stopservice_2;
+		break;
+
+	case ST_RESET:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_uuinterface_TResult;
+		local = (char *(*)()) st_reset_2;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+		exit(1);
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/UUInterface_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "uuinterface.h"
+
+
+bool_t
+xdr_uuinterface_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_uuinterface_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_uuinterface_TConfigValue(xdrs, objp)
+	XDR *xdrs;
+	TConfigValue *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iSourceAddress, X_MAX_ADDRESS_LENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iDestinationAddress, X_MAX_ADDRESS_LENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProtocol)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSrcPort)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDstPort)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iValueIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iValueFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSigmaIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSigmaFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCorrelationIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCorrelationFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMaximumValueIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMaximumValueFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCongestionIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCongestionFractionPart)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_uuinterface_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iStandardResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExtendedCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSystemError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/config_nistnet_add.pl	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,127 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+#!/usr/bin/perl
+#
+
+my $NISTNET="/usr/local/bin/cnistnet";
+my $EFILE="1.txt";
+my $NFILE="2.txt";
+
+#################################################################################################
+#
+# Main()
+#
+#################################################################################################
+
+# DEBUG: Show the passed line
+my $argc = scalar(@ARGV);
+my $dstr = "ArgC: $argc\nArgV: @ARGV\n";
+#print $dstr;
+
+# CASE 1 -- REMOVE ENTRIES
+if( $ARGV[0] =~ /-r/ ) {
+    system( "$NISTNET -r $ARGV[1] $ARGV[2]" );
+    exit( 0 );
+}
+
+# CASE 2 -- NISTNET DOWN
+if( $ARGV[0] =~ /-d/ ) {
+    system( "$NISTNET -d" );
+    exit( 0 );
+}
+
+
+# CASE 3 -- ADD ENTRY 
+
+# Make sure that NISTNET is running and start it if it isn't
+my $result = system( "$NISTNET -G | grep \"Emulator is: On\" > /dev/null" );
+if( $result != 0 ) {
+    system( "$NISTNET -u" );
+    my $result = system( "$NISTNET -G | grep \"Emulator is: On\" > /dev/null" );
+    if( $result != 0 ) {
+	print( "ERROR: Nistnet is not running.\n" );
+	exit( -1 );
+    }
+}
+
+
+# Remove the temporary files created previously
+system( "rm -f 1.txt 2.txt" );
+
+# Now get the nistnet output and put into file 1.txt
+my $result = system( "$NISTNET -R > $EFILE" );
+
+
+# Grep the nistnet output for our channel
+my $gstr = "grep -- \"$ARGV[2] $ARGV[3]\" $EFILE";
+my $result = system( "$gstr > $NFILE" );
+
+# DEBUG: print the grep string
+#print "GREP STRING: $gstr\n";
+
+# If the output is <> 0 then no match was found so just call nistnet
+if( $result != 0 ) {
+#    print "cmd: $NISTNET @ARGV\n";
+    $result = system( "$NISTNET @ARGV" );
+    exit( $result );
+}
+
+
+# Open the file containing the previous command line and read it into an array.
+open( CFILE, "$NFILE" ) or die "ERROR: can't open intermediate file $NFILE.\n";
+my $cmd = <CFILE>;
+my @cmdarray = split( " ", $cmd);
+
+
+# DEBUG: print the current configuration
+#print "Current Configuration: @cmdarray\n";
+
+
+# Look for the passed option in the existing string. If it is found then blank out these entries
+my $option_to_set = $ARGV[4];
+my $in_option = 0;
+my $len = scalar(@cmdarray);
+for( $i = 0; $i < $len; $i++ ) {
+    my $current_config_token = $cmdarray[$i];
+    if( $current_config_token =~ /^--/ ) {
+	$in_option = 0;
+    }
+    if( $current_config_token eq $option_to_set ) {
+	$in_option = 1;
+    }
+    if( $in_option == 1 ) {
+	$cmdarray[$i] = "";
+    }
+}
+
+# Now append the argument array to the current array
+$len = scalar(@ARGV);
+for( $i = 4; $i < $len; $i++ ) {
+    push( @cmdarray, $ARGV[$i] );
+}
+
+# Clear the nistnet cmd as we add this here
+$cmdarray[0] = "";
+
+# DEBUG: We now have the complete string
+#print "cmda: @cmdarray\n";
+
+# Now run the command
+my $result = system( "$NISTNET @cmdarray" );
+ 
+# Success
+exit( $result );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/config_nistnet_reset.pl	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# Description:  
+#
+
+my $LOAD_NISTNET="/home/penuser/3GNetworkEmulator/bin/Load.Nistnet";
+my $REM_MOD="rmmod nistnet";
+my $CHECK_MOD="lsmod | grep nistnet";
+
+#################################################################################################
+#
+# Main()
+#
+#################################################################################################
+
+# Check if the module is loaded -- and unload it if it is
+my $result = system( $CHECK_MOD );
+if( $result != 0 ) {
+	print( "INFO: Nistnet module is not loaded.\n" );
+} else {
+	$result = system( $REM_MOD );
+	if( $result != 0 ) {
+		print( "ERROR: Unable to remove the nistnet module.\n" );
+		exit( -1 );
+    	}
+}
+
+# Now reload the module
+$result = system( $LOAD_NISTNET );
+if( $result != 0 ) {
+	print( "ERROR: Unable to load the nistnet module.\n" );
+	exit( -1 );
+}
+ 
+# Success
+exit( 0 );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/uuinterface.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __UUINTERFACE_H__
+#define __UUINTERFACE_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TComponentList(...);
+}
+#else
+bool_t xdr_uuinterface_TComponentList();
+#endif
+
+#define X_MAX_ADDRESS_LENGTH 64
+#define X_TCP 6
+#define X_UDP 17
+#define ERR_FAILEDTOEXECUTECOMMAND -100
+#define ERR_PROCESSEXECUTEFAILED -101
+#define ERR_PORTNOTSPECIFIED -103
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TStartupInfo(...);
+}
+#else
+bool_t xdr_uuinterface_TStartupInfo();
+#endif
+
+
+struct TConfigValue {
+	char iSourceAddress[X_MAX_ADDRESS_LENGTH];
+	char iDestinationAddress[X_MAX_ADDRESS_LENGTH];
+	int iProtocol;
+	int iSrcPort;
+	int iDstPort;
+	int iValueIntegerPart;
+	int iValueFractionPart;
+	int iSigmaIntegerPart;
+	int iSigmaFractionPart;
+	int iCorrelationIntegerPart;
+	int iCorrelationFractionPart;
+	int iMaximumValueIntegerPart;
+	int iMaximumValueFractionPart;
+	int iCongestionIntegerPart;
+	int iCongestionFractionPart;
+};
+typedef struct TConfigValue TConfigValue;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TConfigValue(...);
+}
+#else
+bool_t xdr_uuinterface_TConfigValue();
+#endif
+
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TResult(...);
+}
+#else
+bool_t xdr_uuinterface_TResult();
+#endif
+
+
+#define UUINTERFACE ((u_long)0x34630202)
+#define UUINTERFACEVER ((u_long)2)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_2( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_2();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_2( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_2();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_2( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_2();
+#endif /* __cplusplus */
+#define ST_SETDELAY ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setdelay_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setdelay_2();
+#endif /* __cplusplus */
+#define ST_SETDROPPERCENTAGE ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setdroppercentage_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setdroppercentage_2();
+#endif /* __cplusplus */
+#define ST_SETDUPLICATEPERCENTAGE ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setduplicatepercentage_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setduplicatepercentage_2();
+#endif /* __cplusplus */
+#define ST_SETBANDWIDTH ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setbandwidth_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setbandwidth_2();
+#endif /* __cplusplus */
+#define ST_SETDRD ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setdrd_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setdrd_2();
+#endif /* __cplusplus */
+#define ST_CLEARSETTINGS ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_clearsettings_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_clearsettings_2();
+#endif /* __cplusplus */
+#define ST_STOPSERVICE ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_stopservice_2( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_stopservice_2();
+#endif /* __cplusplus */
+#define ST_RESET ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_reset_2( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_reset_2();
+#endif /* __cplusplus */
+
+#endif /* __UUINTERFACE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/uuinterface.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+/*******************************************************************************
+ *
+ * Constants
+ *
+ ******************************************************************************/
+const X_MAX_ADDRESS_LENGTH	= 64;
+
+const X_TCP = 6;
+const X_UDP = 17;
+
+/*******************************************************************************
+ *
+ * Error codes
+ *
+ ******************************************************************************/
+const ERR_FAILEDTOEXECUTECOMMAND		= -100;
+const ERR_PROCESSEXECUTEFAILED			= -101;
+
+const ERR_PORTNOTSPECIFIED				= -103;
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+struct TStartupInfo {
+	int iEmpty;
+};
+
+struct TConfigValue
+{
+	char iSourceAddress[X_MAX_ADDRESS_LENGTH];
+	char iDestinationAddress[X_MAX_ADDRESS_LENGTH];
+	int iProtocol;
+	int iSrcPort;
+	int iDstPort;
+	int iValueIntegerPart;
+	int iValueFractionPart;
+	int iSigmaIntegerPart;
+	int iSigmaFractionPart;
+	int iCorrelationIntegerPart;
+	int iCorrelationFractionPart;
+	int iMaximumValueIntegerPart;
+	int iMaximumValueFractionPart;
+	int iCongestionIntegerPart;
+	int iCongestionFractionPart;
+};
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+
+/*******************************************************************************
+ *
+ * Interface
+ *
+ ******************************************************************************/
+program UUINTERFACE {
+	version UUINTERFACEVER {
+
+		/* Service Management */
+		int SS_STARTUPRPCSERVICE( TStartupInfo )		= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )				= 2;
+		TComponentList LIST_DEVICES( void )				= 30;
+
+		/* Custom Interface */
+		TResult ST_SETDELAY( TConfigValue ) = 3;
+		TResult ST_SETDROPPERCENTAGE( TConfigValue ) = 4;
+		TResult ST_SETDUPLICATEPERCENTAGE( TConfigValue ) = 5;
+		TResult ST_SETBANDWIDTH( TConfigValue ) = 6;
+		TResult ST_SETDRD ( TConfigValue ) = 7;
+		TResult ST_CLEARSETTINGS( TConfigValue ) = 8;
+		TResult ST_STOPSERVICE( void ) = 9;
+		TResult ST_RESET( void ) = 10;
+	} = 2;
+} =0x34630202;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/UUInterface/uuinterface_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,346 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Mon Nov 24 15:19:47 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcUuinterface.h"
+#include "CSUuinterface.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSUuinterface> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_2( TStartupInfo *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSUuinterface>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcUuinterface::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_2( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcUuinterface::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_2( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcUuinterface::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setdelay
+ * 
+ ***************************************************************************************/
+TResult *st_setdelay_2( TConfigValue *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_SETDELAY, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_setdelay( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setdroppercentage
+ * 
+ ***************************************************************************************/
+TResult *st_setdroppercentage_2( TConfigValue *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_SETDROPPERCENTAGE, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_setdroppercentage( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setduplicatepercentage
+ * 
+ ***************************************************************************************/
+TResult *st_setduplicatepercentage_2( TConfigValue *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_SETDUPLICATEPERCENTAGE, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_setduplicatepercentage( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setbandwidth
+ * 
+ ***************************************************************************************/
+TResult *st_setbandwidth_2( TConfigValue *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_SETBANDWIDTH, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_setbandwidth( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setdrd
+ * 
+ ***************************************************************************************/
+TResult *st_setdrd_2( TConfigValue *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_SETDRD, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_setdrd( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_clearsettings
+ * 
+ ***************************************************************************************/
+TResult *st_clearsettings_2( TConfigValue *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_CLEARSETTINGS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_clearsettings( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_stopservice
+ * 
+ ***************************************************************************************/
+TResult *st_stopservice_2( void *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_STOPSERVICE, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_stopservice();
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_reset
+ * 
+ ***************************************************************************************/
+TResult *st_reset_2( void *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcUuinterface::SetError( ST_RESET, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// call the corresponding method on the instance
+	rv = CSvcUuinterface::st_reset();
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromConsole.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "CRetrieveCommandFromConsole.h"
+#include "UCCS_ErrorCodes.h"
+
+
+/***********************************************************************************
+ *
+ * Construction
+ *
+ **********************************************************************************/
+CRetrieveCommandFromConsole::CRetrieveCommandFromConsole()
+{
+	iFile = NULL;
+}
+
+CRetrieveCommandFromConsole::~CRetrieveCommandFromConsole()
+{
+	if( iFile != NULL ) {
+		fclose( iFile );
+		iFile = NULL;
+	}
+}
+
+
+/***********************************************************************************
+ *
+ * StartUseCase
+ *
+ **********************************************************************************/
+int CRetrieveCommandFromConsole::StartUseCase( int aUsecaseID )
+{
+	fprintf( stdout, "_______________________________________________________________________\n\n");
+	fprintf( stdout, "Use Case Controller -- Interactive Usecase Description\n" );
+	fprintf( stdout, "_______________________________________________________________________\n\n");
+	iFile = stdin;
+	iUsecaseID = aUsecaseID;
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * EndUseCase
+ *
+ **********************************************************************************/
+int CRetrieveCommandFromConsole::EndUseCase()
+{
+	fprintf( stdout, "END OF USE CASE\n" );
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * GetNextCommand
+ *
+ **********************************************************************************/
+int CRetrieveCommandFromConsole::GetNextCommand( char *aBuffer, int aLength )
+{
+	fprintf( stdout, "> " );
+	fgets( aBuffer, aLength, iFile );
+	return UCCS_OK;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromConsole.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CRetrieveCommandFromConsole
+*
+*/
+
+
+
+#ifndef __CRETRIEVECOMMANDFROMCONSOLE_H__
+#define __CRETRIEVECOMMANDFROMCONSOLE_H__
+
+
+/***********************************************************************************
+ *
+ * System Includes
+ *
+ **********************************************************************************/
+#include <stdio.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_Interfaces.h"
+
+
+/***********************************************************************************
+ *
+ * CRetrieveCommandFromConsole
+ *
+ **********************************************************************************/
+class CRetrieveCommandFromConsole : public IRetrieveCommand
+{
+public:
+	CRetrieveCommandFromConsole();
+	~CRetrieveCommandFromConsole();
+
+	virtual int StartUseCase( int aUsecaseID );
+	virtual int EndUseCase();
+	virtual int GetNextCommand( char *aBuffer, int aLength );
+
+private:
+	FILE *iFile;
+	int iUsecaseID;
+};
+
+#endif //__CRETRIEVECOMMANDFROMCONSOLE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromFile.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+/***********************************************************************************
+ *
+ * System Includes
+ *
+ **********************************************************************************/
+#include <stdio.h>
+#include <assert.h>
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "CRetrieveCommandFromFile.h"
+#include "UCCS_ErrorCodes.h"
+
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define MAXFILENAME 256
+
+
+/***********************************************************************************
+ *
+ * Construction
+ *
+ **********************************************************************************/
+CRetrieveCommandFromFile::CRetrieveCommandFromFile()
+{
+	iFile = NULL;
+}
+
+CRetrieveCommandFromFile::~CRetrieveCommandFromFile()
+{
+
+#ifdef TESTCASE109
+	char tempname[10];
+	sprintf(tempname, "testing");
+	iFile = new FILE;
+	iFile->_ptr = tempname;
+#endif
+
+	if( iFile != NULL ) {
+		fclose( iFile );
+		iFile = NULL;
+	}
+}
+
+
+/***********************************************************************************
+ *
+ * StartUseCase
+ *
+ **********************************************************************************/
+int CRetrieveCommandFromFile::StartUseCase( int aUsecaseID )
+{
+	char fname[MAXFILENAME];
+
+	// make sure there isn't a file already open -- this is a defect -- the batchengine
+	// should catch errors before they get to here
+	assert( iFile == NULL );
+
+	// try and open the file
+	sprintf( fname, "script.%04d.ucd", aUsecaseID );
+	iFile = fopen( fname, "r" );
+	if( iFile == NULL ) {
+		return UCCS_CANTOPENSCRIPTFILE;
+	}
+	iUsecaseID = aUsecaseID;
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * EndUseCase
+ *
+ **********************************************************************************/
+int CRetrieveCommandFromFile::EndUseCase()
+{
+	fclose(iFile);
+	iFile = NULL;
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * GetNextCommand
+ *	
+ **********************************************************************************/
+int CRetrieveCommandFromFile::GetNextCommand( char *aBuffer, int aLength )
+{
+	char *c;
+	c = fgets( aBuffer, aLength, iFile );
+	if( c == NULL ) {
+		return UCCS_NOMORECOMMANDS;
+	}
+	return UCCS_OK;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromFile.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CRetrieveCommandFromFile
+*
+*/
+
+
+
+#ifndef __CRETRIEVECOMMANDFROMFILE_H__
+#define __CRETRIEVECOMMANDFROMFILE_H__
+
+
+/***********************************************************************************
+ *
+ * System Includes
+ *
+ **********************************************************************************/
+#include <stdio.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_Interfaces.h"
+
+
+/***********************************************************************************
+ *
+ * CRetrieveCommandFromFile
+ *
+ **********************************************************************************/
+class CRetrieveCommandFromFile : public IRetrieveCommand
+{
+public:
+	CRetrieveCommandFromFile();
+	~CRetrieveCommandFromFile();
+
+	virtual int StartUseCase( int aUsecaseID );
+	virtual int EndUseCase();
+	virtual int GetNextCommand( char *aBuffer, int aLength );
+
+private:
+	FILE *iFile;
+	int iUsecaseID;
+};
+
+#endif //__CRETRIEVECOMMANDFROMFILE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CSynchronisation.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+/****************************************************************************************
+ *
+ * Local Includes
+ *
+ ***************************************************************************************/
+#include "CSynchronisation.h"
+#include "UCCS_ErrorCodes.h"
+
+/****************************************************************************************
+ *
+ * Definitions
+ *
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ *
+ * Construction
+ *
+ ***************************************************************************************/
+CSynchronisation::CSynchronisation( IOutput *aOutput )
+{
+	assert( aOutput != NULL );
+	iOutput = aOutput;
+	iObjectCleared = 0;
+	hDeviceSideRendezvousSemaphore = CreateSemaphore( NULL, 0, 2, NULL );
+	assert( hDeviceSideRendezvousSemaphore != NULL );
+	hPCSideRendezvousSemaphore = CreateSemaphore( NULL, 0, 2, NULL );
+	assert( hPCSideRendezvousSemaphore != NULL );
+	hDeviceSignalSemaphore = CreateSemaphore( NULL, 0, 0x000000FF, NULL );
+	assert( hDeviceSignalSemaphore != NULL );
+	hScriptSignalSemaphore = CreateSemaphore( NULL, 0, 0x000000FF, NULL );
+	assert( hScriptSignalSemaphore != NULL );
+}
+
+CSynchronisation::~CSynchronisation()
+{
+	CloseHandle( hDeviceSideRendezvousSemaphore );
+	CloseHandle( hPCSideRendezvousSemaphore );
+	CloseHandle( hDeviceSignalSemaphore );
+	CloseHandle( hScriptSignalSemaphore );
+}
+
+
+/****************************************************************************************
+ *
+ * SignalFromDevice
+ *
+ ***************************************************************************************/
+int CSynchronisation::SignalFromDevice()
+{
+	int err;
+
+	// do stuff
+	err = ReleaseSemaphore( hDeviceSignalSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the device signal semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * WaitFromScript
+ *
+ ***************************************************************************************/
+int CSynchronisation::WaitFromScript()
+{
+	int err;
+	err = WaitForSingleObject( hDeviceSignalSemaphore, INFINITE );
+	if( err != WAIT_OBJECT_0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Error while waiting for the device signal semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * SignalFromScript
+ *
+ ***************************************************************************************/
+int CSynchronisation::SignalFromScript()
+{
+	int err;
+
+	// do stuff
+	err = ReleaseSemaphore( hScriptSignalSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the script signal semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * WaitFromDevice
+ *
+ ***************************************************************************************/
+int CSynchronisation::WaitFromDevice()
+{
+	int err;
+	err = WaitForSingleObject( hScriptSignalSemaphore, INFINITE );
+	if( err != WAIT_OBJECT_0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Error while waiting for the script signal semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * RendezvousFromDevice
+ *
+ ***************************************************************************************/
+int CSynchronisation::RendezvousFromDevice()
+{
+	int err;
+
+	// signal that the device side has arrived
+	err = ReleaseSemaphore( hDeviceSideRendezvousSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the device-side rendezvous semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+
+	// wait for the pc-side to arrive
+	err = WaitForSingleObject( hPCSideRendezvousSemaphore, INFINITE );
+	if( err != WAIT_OBJECT_0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Error while waiting for pc-side rendezvous semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+
+	// otherwise everything is good
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * RendezvousFromScript
+ *
+ ***************************************************************************************/
+int CSynchronisation::RendezvousFromScript()
+{
+	int err;
+
+	// signal that the pc side has arrived
+	err = ReleaseSemaphore( hPCSideRendezvousSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the pc-side rendezvous semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+
+	// wait for the device-side to arrive
+	err = WaitForSingleObject( hDeviceSideRendezvousSemaphore, INFINITE );
+	if( err != WAIT_OBJECT_0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Error while waiting for device-side rendezvous semaphore." );
+		return UCCS_SYSTEMERROR;
+	}
+
+	// otherwise everything is good
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * ClearSynchronisation
+ *
+ ***************************************************************************************/
+void CSynchronisation::ClearSynchronisation()
+{
+	int err;
+
+	// signal all semaphores so that anyone waiting will be blocked
+	err = ReleaseSemaphore( hDeviceSideRendezvousSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the device-side rendezvous semaphore." );
+	}
+	err = ReleaseSemaphore( hPCSideRendezvousSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the script-side rendezvous semaphore." );
+	}
+	err = ReleaseSemaphore( hDeviceSignalSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the device signal semaphore." );
+	}
+	err = ReleaseSemaphore( hScriptSignalSemaphore, 1, NULL );
+	if( err == 0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "Failed to signal the script signal semaphore." );
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CSynchronisation.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSynchronisation
+*
+*/
+
+
+
+#ifndef __CSYNCHRONISATION_H__
+#define __CSYNCHRONISATION_H__
+
+
+/****************************************************************************************
+ *
+ * Includes
+ *
+ ***************************************************************************************/
+#include <windows.h>
+#include "UCCS_Interfaces.h"
+
+/****************************************************************************************
+ *
+ * CSynchronisation
+ *
+ ***************************************************************************************/
+class CSynchronisation
+{
+public:
+	CSynchronisation( IOutput *aOutput );
+	~CSynchronisation();
+
+	int SignalFromDevice();
+	int WaitFromScript();
+	int WaitFromDevice();
+	int SignalFromScript();
+	int RendezvousFromDevice();
+	int RendezvousFromScript();
+	void ClearSynchronisation();
+
+private:
+	int iObjectCleared;
+	IOutput *iOutput;
+	HANDLE hDeviceSideRendezvousSemaphore;
+	HANDLE hPCSideRendezvousSemaphore;
+	HANDLE hDeviceSignalSemaphore;
+	HANDLE hScriptSignalSemaphore;
+};
+
+
+#endif //__CSYNCHRONISATION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CUCCIniFile.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CUCCIniFile.h
+*
+*/
+
+
+
+#include <afxcoll.h>
+#include <assert.h>
+
+#include "CUCCIniFile.h"
+
+#define MAX_BUFFER_SIZE 1024
+
+CUCCIniFile::CUCCIniFile()
+{
+}
+
+CUCCIniFile::CUCCIniFile(const string& strName)
+{
+	SetIniFileName( strName );
+}
+
+CUCCIniFile::~CUCCIniFile()
+{
+}
+
+void CUCCIniFile::SetIniFileName(const string& strName)
+{
+	assert( strName.size() != 0 );
+	iIniFileName = strName;
+}
+
+bool CUCCIniFile::KeyValue(const string& strKey,const string& strSection, string& value ) const
+{
+	TCHAR result[MAX_BUFFER_SIZE];
+	int ret = GetPrivateProfileString(	(LPCTSTR)strSection.c_str(),
+										(LPCTSTR)strKey.c_str(),
+										_T(""),
+										result,
+										MAX_BUFFER_SIZE,
+										(LPCTSTR)iIniFileName.c_str());
+
+	if( ret>0 )
+	{
+		value = result;
+	}
+	return ret>0?true:false;
+}
+
+bool CUCCIniFile::KeyValue(const string& strKey, const string& strSection, int& value) const
+{
+	char* stopstring = NULL;
+	string tmpKeyValue;
+
+	bool ret = KeyValue( strKey, strSection, tmpKeyValue );
+	if( ret )
+	{
+		// Check to see if the input value is in hex
+		if( tmpKeyValue[0] == '0' && tmpKeyValue[1] == 'x' )
+		{
+			value = strtol(tmpKeyValue.c_str()+2, &stopstring, 16 );
+		}
+		else
+		{
+			value = strtol(tmpKeyValue.c_str(), &stopstring, 10 );
+		}
+	}
+	return ret;
+}
+
+vector<string> CUCCIniFile::SectionNames() const
+{
+	TCHAR result[MAX_BUFFER_SIZE];
+	long lRetValue = GetPrivateProfileSectionNames(	result,
+													MAX_BUFFER_SIZE,
+													(LPCTSTR)iIniFileName.c_str());
+
+	// Return a vector of all the section names
+	vector<string> sections;
+
+	int pos = 0;
+	while( pos <= MAX_BUFFER_SIZE )
+	{
+		string section = (char*)(result+pos);
+		if( section.size() > 0 )
+		{
+			sections.push_back( section );
+			pos +=section.size()+1;
+		}
+		else
+		{
+			break;
+		}
+	}
+
+	return sections;
+}
+
+vector<string> CUCCIniFile::SectionParameters(const string& strSection) const
+{
+	TCHAR result[MAX_BUFFER_SIZE];
+	long lRetValue = GetPrivateProfileString(	(LPCTSTR)strSection.c_str(),
+												NULL,
+												_T(""),
+												result,
+												MAX_BUFFER_SIZE,
+												(LPCTSTR)iIniFileName.c_str());
+
+	// Return a vector of parameters
+	vector<string> params;
+
+	int pos = 0;
+	while( pos <= MAX_BUFFER_SIZE )
+	{
+		string param = (char*)(result+pos);
+		if( param.size() > 0 )
+		{
+			params.push_back( param );
+			pos +=param.size()+1;
+		}
+		else
+		{
+			break;
+		}
+	}
+
+	return params;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/CUCCIniFile.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef __CUCCININFILE_H__
+#define __CUCCININFILE_H__
+
+#include <vector>
+#include <string>
+
+using std::string;
+using std::vector;
+
+class CUCCIniFile  
+{
+	public:
+		CUCCIniFile();
+		CUCCIniFile(const string& strName);
+		~CUCCIniFile();
+
+		void SetIniFileName(const string& strName);
+		bool KeyValue(const string& strKey, const string& strSection, string& value) const;
+		bool KeyValue(const string& strKey, const string& strSection, int& value) const;
+		
+		vector<string> SectionNames() const;
+		vector<string> SectionParameters(const string& strSection) const;
+
+	private:
+		string iIniFileName;
+};
+
+#endif //__CUCCININFILE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/HTMLOutput.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,676 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <assert.h>
+
+/********************************************************************************
+ *
+ * Local Includes
+ *
+ ********************************************************************************/
+#include "penstd.h"
+#include "strncpynt.h"
+#include "HTMLOutput.h"
+#include "UCCS_ErrorCodes.h"
+#include "../ServiceStubs/CommonServiceStub/CServiceAgentBase.h"
+#include "../Core/UCCS_CExecuteCommand.h"
+
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define MAXFILENAME 1024
+#define DEFAULT_ERROR_STRING ""
+#define STRINGIFY_NULL(x)	(((x) == NULL) ? ("<null>") : (x)) 
+
+
+/***********************************************************************************
+ *
+ * SECTION: CHTMLOutput
+ *
+ **********************************************************************************/
+/********************************************************************************
+ *
+ * CHTMLOutput
+ *
+ ********************************************************************************/
+CHTMLOutput::CHTMLOutput()
+{
+	iFile = NULL;
+	iFileDebug = NULL;
+	iFileNoRefresh = NULL;
+	iCompletedScriptCalled = false;
+	iCounter = 0;
+
+	// setup the constant arrays
+	iRecordTableTitle[RT_COMMAND]			= "<invalid>";
+	iRecordTableTitle[RT_COMMAND_REPLY]		= "Command Reply";
+	iRecordTableTitle[RT_ENVIRONMENT]		= "Environment";
+	iRecordTableTitleBackgroundColour[RT_COMMAND]			= "#c0e0c0";
+	iRecordTableTitleBackgroundColour[RT_COMMAND_REPLY]		= "#b0b0d0";
+	iRecordTableTitleBackgroundColour[RT_ENVIRONMENT]		= "#e0c0c0";
+	iRecordTableBorderColour[RT_COMMAND]		= "#008000";
+	iRecordTableBorderColour[RT_COMMAND_REPLY]	= "#0000C0";
+	iRecordTableBorderColour[RT_ENVIRONMENT]	= "#800000";
+	iStandardRowCount[RT_COMMAND]		 = 3;
+	iStandardRowCount[RT_COMMAND_REPLY]	 = 5;
+	iStandardRowCount[RT_ENVIRONMENT]	 = 0;
+	iStandardRowColour[RT_COMMAND]			= " bgcolor=\"#E0E0E0\"";
+	iStandardRowColour[RT_COMMAND_REPLY]	= " bgcolor=\"#E0E0E0\"";
+	iStandardRowColour[RT_ENVIRONMENT]		= " bgcolor=\"#E0E0E0\"";
+	iNonZeroResultColour = " bgcolor=\"#e06060\"";
+}
+
+
+/********************************************************************************
+ *
+ * ~CHTMLOutput
+ *
+ ********************************************************************************/
+CHTMLOutput::~CHTMLOutput()
+{
+	// output the end of the HTML
+	OutputLine( iFile, "</body></html>\n" );
+	OutputLine( iFileNoRefresh, "</body></html>\n" );
+	OutputLine( iFileDebug, "</body></html>\n" );
+
+	// close the files
+	if( iFile != NULL ) {
+		fclose( iFile );
+	}
+	if( iFileNoRefresh != NULL ) {
+		fclose( iFileNoRefresh );
+	}
+	if( iFileDebug != NULL ) {
+		fclose( iFileDebug );
+	}
+}
+
+
+/********************************************************************************
+ *
+ * SetFilename
+ *
+ ********************************************************************************/
+int CHTMLOutput::SetFilename( char *aFilename )
+{	
+	char fname[MAXFILENAME];
+	int len;
+
+	// check the filename
+	if( aFilename == NULL ) {
+		return UCCS_CANTOPENOUTPUTFILE;
+	}
+
+	// create the normal log file
+	_snprintf( fname, MAXFILENAME, "%s.log.html", aFilename );
+	len = strlen(fname)+1;
+	if( len > MAXLOGFILENAMELEN)
+		return UCCS_CANTOPENOUTPUTFILE;
+	STRNCPY_NULL_TERMINATE( iLogName, fname, len );
+	iFile = fopen( fname, "w+" );
+	if( iFile == NULL ) {
+		return UCCS_CANTOPENOUTPUTFILE;
+	}
+
+	// create the debug log file
+	_snprintf( fname, MAXFILENAME, "%s.debug.html", aFilename );
+	len = strlen(fname)+1;
+	if( len > MAXLOGFILENAMELEN)
+		return UCCS_CANTOPENOUTPUTFILE;
+	STRNCPY_NULL_TERMINATE(iDebugLogName, fname, len);
+	iFileDebug = fopen( fname, "w+" );
+	if( iFileDebug == NULL ) {
+		fclose( iFile );
+		return UCCS_CANTOPENOUTPUTFILE;
+	}
+
+	// create the no refresh log file
+	_snprintf( fname, MAXFILENAME, "%s.noref.html", aFilename );
+	len = strlen(fname)+1;
+	if( len > MAXLOGFILENAMELEN)
+		return UCCS_CANTOPENOUTPUTFILE;
+	STRNCPY_NULL_TERMINATE(iLogNameNoRefresh, fname, len);
+	iFileNoRefresh = fopen( fname, "w+" );
+	if( iFileNoRefresh == NULL ) {
+		fclose( iFile );
+		fclose( iFileDebug );
+		return UCCS_CANTOPENOUTPUTFILE;
+	}
+
+	// add the header HTML tags to the all the log files
+	OutputBeginTags();
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * SECTION: IOutput
+ *
+ **********************************************************************************/
+/********************************************************************************
+ *
+ * PUBLIC METHOD: StartUsecase
+ *
+ ********************************************************************************/
+void CHTMLOutput::StartUsecase( int aID )
+{
+	int err;
+	char fname[MAXFILENAME];
+
+	// Reset the operation counter
+	iCounter = 0;
+
+	// Set the filename (and open the files)
+	_snprintf( fname, MAXFILENAME, "output%04d", aID );
+	err = SetFilename( fname );
+	if( err != UCCS_OK ) {
+		fprintf( stderr, "ERROR: can't open output files.\n" );
+	}
+
+	// Output the startusecase heading
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<hr><h3>StartUseCase(%d)</h3><hr> \n", aID );
+	OutputLine( iFile, iLineBuffer );
+	OutputLine( iFileNoRefresh, iLineBuffer );
+	OutputLine( iFileDebug, iLineBuffer );
+}
+
+
+/********************************************************************************
+ *
+ * PUBLIC METHOD: EndUsecase
+ *
+ ********************************************************************************/
+void CHTMLOutput::EndUsecase( int aID, int aResult )
+{
+	// make the line
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<h3>EndUsecase(%d, %d)</h3><hr> \n", aID, aResult );
+
+	// output the line
+	OutputLine( iFile, iLineBuffer );
+	OutputLine( iFileNoRefresh, iLineBuffer );
+	OutputLine( iFileDebug, iLineBuffer );
+}
+
+
+/********************************************************************************
+ *
+ * PUBLIC METHOD: CompletedScript
+ *
+ ********************************************************************************/
+void CHTMLOutput::CompletedScript()
+{
+	// create the line
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<hr><h3>All script commands have been executed</h3>\n" );
+	
+	// output the line
+	OutputLine( iFile, iLineBuffer );
+	OutputLine( iFileNoRefresh, iLineBuffer );
+	OutputLine( iFileDebug, iLineBuffer );
+
+	// set the flag (which at the moment has no effect?)
+	iCompletedScriptCalled = true;
+}
+
+
+/********************************************************************************************
+ *
+ * PUBLIC METHOD: StartServiceResult 
+ *
+ *******************************************************************************************/
+void CHTMLOutput::StartServiceResult( int aServiceID, char *aServiceHost, int aStubReturnValue, int aErrorCode, int aUnused )
+{
+	char error_tag[MAXLINELENGTH];
+
+	// make the appropriate error tag
+	if( aStubReturnValue == ERR_NONE ) {
+		error_tag[0] = 0;
+	} else {
+		_snprintf( error_tag, MAXLINELENGTH, "<font color=\"red\" size=\"+1\">ERROR: </b></font>" );
+	}
+
+	// create the log entry
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%sStartServiceResult</b>(%d, %s, %s)\n", error_tag, aServiceID, aServiceHost, GetPenstdErrorString(aStubReturnValue) );
+
+	// print the entry in the debug log
+	OutputLine( iFileDebug, iLineBuffer );
+
+	// print the entry in the other logs if there is an error
+	if( aStubReturnValue != ERR_NONE ) {
+		OutputLine( iFile, iLineBuffer );
+		OutputLine( iFileNoRefresh, iLineBuffer );
+	}
+}
+
+
+/********************************************************************************************
+ *
+ * PUBLIC METHOD: StopServiceResult 
+ *
+ *******************************************************************************************/
+void CHTMLOutput::StopServiceResult( int aServiceID, char *aServiceHost, int aStubReturnValue, int aErrorCode, int aUnused )
+{
+	char error_tag[MAXLINELENGTH];
+
+	// make the appropriate error tag
+	if( aStubReturnValue == ERR_NONE ) {
+		error_tag[0] = 0;
+	} else {
+		_snprintf( error_tag, MAXLINELENGTH, "<font color=\"red\" size=\"+1\">ERROR: </b></font>" );
+	}
+
+	// create the log entry
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%sStopServiceResult</b>(%d, %s, %s)\n", error_tag, aServiceID, aServiceHost, GetPenstdErrorString(aStubReturnValue) );
+
+	// print the entry in the debug log
+	OutputLine( iFileDebug, iLineBuffer );
+
+	// print the entry in the other logs if there is an error
+	if( aStubReturnValue != ERR_NONE ) {
+		OutputLine( iFile, iLineBuffer );
+		OutputLine( iFileNoRefresh, iLineBuffer );
+	}
+}
+
+
+/********************************************************************************************
+ *
+ * PUBLIC METHOD: ExecuteString
+ *
+ *******************************************************************************************/
+void CHTMLOutput::ExecuteString( char *aCommandLine )
+{
+	char *nptr;
+
+	// remove the newline from the command line
+	nptr = strchr( aCommandLine, '\n' );
+	if( nptr != NULL ) {
+		*nptr = 0;
+	}
+
+	// before the debug entry we put a line 
+	OutputLine( iFileDebug, "<hr>\n" );
+
+	// create the entry line
+	_snprintf( iLineBuffer, MAXLINELENGTH, "&nbsp;&nbsp;&nbsp;<img src=\"bullet.gif\" width=\"8\" height=\"8\" ><b>&nbsp; %d - ExecuteString</b>( %s )\n", iCounter, aCommandLine );
+	iCounter++;
+
+	// print the entry into all logs
+	OutputLine( iFile, iLineBuffer );
+	OutputLine( iFileDebug, iLineBuffer );
+	OutputLine( iFileNoRefresh, iLineBuffer );
+}
+
+
+/********************************************************************************
+ *
+ * PUBLIC METHOD: ExecuteCommand
+ *
+ ********************************************************************************/
+void CHTMLOutput::ExecuteCommand( TUccsCommand aCommand, CDataRecord *aArgs )
+{
+	// make sure the passed record is valid
+	if ( aArgs == NULL )
+		return;
+	
+	// print the record
+	fprintf( iFileDebug, "<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>\n");
+	OutputDataRecord( iFileDebug, aArgs, RT_COMMAND, aCommand );
+
+	// print an empty line to make things pretty
+	OutputLineBreak( iFileDebug );
+}
+
+
+/********************************************************************************************
+ *
+ * PUBLIC METHOD: ExecuteCommandReply
+ *
+ *******************************************************************************************/
+void CHTMLOutput::ExecuteCommandReply( CDataRecord *aReply )
+{	
+	int completion_code, err;
+
+	// if there is no valid reply record then just return
+	if( aReply == NULL ) {
+		return;
+	}
+
+	// print the record
+	OutputLineBreak( iFileDebug );
+	OutputDataRecord( iFileDebug, aReply, RT_COMMAND_REPLY, UC_INVALID );
+	OutputLineBreak( iFileDebug );
+
+	// raise an error if the completion code isn't success then this is an error
+	err = aReply->GetFieldAsInt( STD_REPLY_FIELD_REQUESTCOMPLETIONCODE, &completion_code );
+	assert( err == UCCS_OK );
+	if( completion_code != ERR_NONE ) {
+		Error( UCCS_CLIENT_ERROR, GetPenstdErrorString(completion_code) );
+	}
+}
+
+
+/********************************************************************************
+ *
+ * PUBLIC METHOD: Error
+ *
+ ********************************************************************************/
+void CHTMLOutput::Error( int aErrorCode, char *aErrorString )
+{
+	char custom_error_string[MAXLINELENGTH];
+
+	// set a default error string
+	if( aErrorString == NULL ) {
+		aErrorString = DEFAULT_ERROR_STRING;
+	}
+
+	// if the error is UCCS_CLIENT_ERROR then customise the error string
+	if( aErrorCode == UCCS_CLIENT_ERROR ) {
+		_snprintf( custom_error_string, MAXLINELENGTH, "%s.", aErrorString );
+		custom_error_string[0] = toupper( custom_error_string[0] );
+		aErrorString = custom_error_string;
+	}
+
+	// create the entry line
+	_snprintf( iLineBuffer, MAXLINELENGTH, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"+1\"><b>ERROR:</b></font> %s (%d). %s\n", GetUccsErrorStringI(aErrorCode), aErrorCode, aErrorString );
+
+	// add the line to all logs
+	OutputLine( iFile, iLineBuffer );
+	OutputLine( iFileNoRefresh, iLineBuffer );
+	OutputLine( iFileDebug, iLineBuffer );
+}
+
+
+/********************************************************************************************
+ *
+ * PUBLIC METHOD: DisplayEnvironment
+ *
+ *******************************************************************************************/
+void CHTMLOutput::DisplayEnvironment( CDataRecord *aEnvironment )
+{
+	// if there is no environment then return
+	if( aEnvironment == NULL ) {
+		return;
+	}
+
+	// print an empty line to make things pretty
+	OutputLineBreak( iFile );
+	OutputLineBreak( iFileDebug );
+	OutputLineBreak( iFileNoRefresh );
+
+	// print the record
+	OutputDataRecord( iFile, aEnvironment, RT_ENVIRONMENT, UC_INVALID );
+	OutputDataRecord( iFileDebug, aEnvironment, RT_ENVIRONMENT, UC_INVALID );
+	OutputDataRecord( iFileNoRefresh, aEnvironment, RT_ENVIRONMENT, UC_INVALID );
+}
+
+
+/********************************************************************************************
+ *
+ * SECTION: Unused methods
+ *
+ *******************************************************************************************/
+/********************************************************************************************
+ *
+ * PUBLIC METHOD: ExecuteStringResult 
+ *
+ *******************************************************************************************/
+void CHTMLOutput::ExecuteStringResult( int aUccsErrorcode )
+{
+}
+void CHTMLOutput::ExecuteCommandResult( int aUccsErrorcode )
+{
+}
+
+
+/********************************************************************************************
+ *
+ * SECTION: Removed API Calls
+ *
+ *******************************************************************************************/
+void CHTMLOutput::DisplayLastCommand( CDataRecord *aCommand )
+{
+	assert( !"Removed API" );
+}
+void CHTMLOutput::DisplayLastReply( CDataRecord *aResult )
+{
+	assert( !"Removed API" );
+}
+
+void CHTMLOutput::DisplayHelp()
+{
+	assert( !"Removed API" );
+}
+
+
+/********************************************************************************************
+ *
+ * SECTION: Helper Methods
+ *
+ *******************************************************************************************/
+/********************************************************************************************
+ *
+ * PRIVATE METHOD: OutputLine 
+ *
+ *******************************************************************************************/
+void CHTMLOutput::OutputLine( FILE *aFile, char *aLine )
+{
+	// check the file pointer is valid
+	if( aFile == NULL ) {
+		return;
+	}
+
+	// print the line to the file
+	fprintf( aFile, "%s", aLine );
+
+	// fflush to file
+	fflush( aFile );
+}
+
+
+/**************************************************************************************
+ *
+ * PRIVATE METHOD: OutputBeginTags
+ *
+ *************************************************************************************/
+void CHTMLOutput::OutputBeginTags()
+{
+	// get the current system time to put in the header
+	time_t ltime;
+	time( &ltime );
+	
+	// check that the files exist
+	if( (iFile == NULL) || (iFileDebug == NULL) || (iFileNoRefresh == NULL) ) {
+		return;
+	}
+
+	// output the standard header for the files
+	OutputLine(iFile,"<html> \n");
+	OutputLine(iFile,"<head> \n");
+	OutputLine(iFile, "<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"5\">\n" );
+	fprintf(iFile,"<title>%s</title> \n", iLogName);
+	OutputLine(iFile,"</head> \n");
+	OutputLine(iFile,"<body> \n");
+	OutputLine(iFile,"<pre> \n");
+	fprintf(iFile,"<hr>\n<h1>%s</h1> \n", iLogName);
+	fprintf(iFile, "<h4>%s</h4>\n", ctime( &ltime ));
+	fflush( iFile );
+
+	OutputLine(iFileDebug,"<html> \n");
+	OutputLine(iFileDebug,"<head> \n");
+	fprintf(iFileDebug,"<title>%s</title> \n", iDebugLogName);
+	OutputLine(iFileDebug,"</head> \n");
+	OutputLine(iFileDebug,"<body> \n");
+	OutputLine(iFileDebug,"<pre> \n");
+	fprintf(iFileDebug,"<hr>\n<h1>%s</h1> \n", iDebugLogName);
+	fprintf(iFileDebug, "<h4>%s</h4>\n", ctime( &ltime ));
+	fflush( iFileDebug );
+
+	OutputLine(iFileNoRefresh,"<html> \n");
+	OutputLine(iFileNoRefresh,"<head> \n");
+	fprintf(iFileNoRefresh,"<title>%s</title> \n", iLogNameNoRefresh);
+	OutputLine(iFileNoRefresh,"</head> \n");
+	OutputLine(iFileNoRefresh,"<body> \n");
+	OutputLine(iFileNoRefresh,"<pre> \n");
+	fprintf(iFileNoRefresh,"<hr>\n<h1>%s</h1> \n", iLogNameNoRefresh);
+	fprintf(iFileNoRefresh, "<h4>%s</h4>\n", ctime( &ltime ));
+	fflush( iFileNoRefresh );
+}
+
+
+/********************************************************************************
+ *
+ * PRIVATE METHOD: OutputDataRecord -- outputs a data CDataRecord to the passed
+ * log file. Records are output as tables
+ *
+ ********************************************************************************/
+void CHTMLOutput::OutputDataRecord( FILE* aFile, CDataRecord *aRecord, TRecordType aRecordType, TUccsCommand aCommandType )
+{
+	int standard_row_count, i;
+	char *multiline_value;
+	char *value;
+	char *background_colour;
+	char *fontsize;
+	CDataField *field;
+
+	// check that a real record is passed
+	if ( aRecord == NULL ) {
+		return;
+	}
+
+	// check the record type -- this is an internal thing so can just assert
+	assert( (aRecordType > RT_INVALID) && (aRecordType < RT_COUNT) );
+
+	// print the table header
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<br>" );
+	OutputLine( aFile, iLineBuffer );
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<table border=\"2\" cellpadding=3 cellspacing=\"0\" bordercolor=\"%s\">", iRecordTableBorderColour[aRecordType] );
+	OutputLine( aFile, iLineBuffer );
+
+	// print the table title 
+	iRecordTableTitle[RT_COMMAND] = (char*)GetScriptCommandString( aCommandType );
+	STRINGIFY_NULL( iRecordTableTitle[RT_COMMAND] );
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<tr bgcolor=\"%s\"><td colspan=2 align=\"center\"><font size=\"3\"><b>%s</b></font></tr>", iRecordTableTitleBackgroundColour[aRecordType], iRecordTableTitle[aRecordType] );
+	OutputLine( aFile, iLineBuffer );
+
+	// find out how many fields in this record are standard rows - AE: unsure why the 'if' is needed
+	standard_row_count = iStandardRowCount[aRecordType];
+	if( (aRecordType == RT_COMMAND) && (aCommandType != UC_RUNCMD) ) {
+		standard_row_count = 0;
+	}
+
+	// print all rows -- first X rows are standard and have a light grey background to distinguish them
+	for( field = aRecord->GetFirstField(), i = 0; field != NULL; i++ ) {
+
+		// get the background colour for the row - standard - warnings
+		background_colour = "";
+		if( i < standard_row_count ) {			
+			background_colour = iStandardRowColour[aRecordType];
+		}
+		if( (aRecordType == RT_COMMAND_REPLY) && (IsFailedResult(field)) ) {
+			background_colour = iNonZeroResultColour;
+		}
+
+		// get the string value for the field and check for multi-line entries
+		value = field->GetStrValue();
+		multiline_value = strchr( value, '\n' );
+		
+		// set the font size
+		fontsize = "1";
+		if( multiline_value != NULL ) {
+			fontsize = "3";
+		} 
+
+		// print the row - datarecord entries (especially log entries) can be longer than 1k so we break things up
+		_snprintf( iLineBuffer, MAXLINELENGTH, "<tr%s><td><font size=\"1\">%s</font></td><td><font size=\"%s\">", background_colour, field->GetName(), fontsize );
+		OutputLine( aFile, iLineBuffer ); 
+
+		// if multiline then put in the <pre> tags to make newlines come out
+		if( multiline_value != NULL ) {
+			OutputLine( aFile, "<pre>" );
+		}
+
+		// print actual data
+		OutputLine( aFile, value );
+		
+		// if multiline then put in the </pre> tags to make newlines come out
+		if( multiline_value != NULL ) {
+			OutputLine( aFile, "</pre>" );
+		}
+
+		// get the next field
+		field = aRecord->GetNextField();
+	}
+
+	// end the table
+	_snprintf( iLineBuffer, MAXLINELENGTH, "</table>" );
+	OutputLine( aFile, iLineBuffer );
+} 
+
+
+/********************************************************************************
+ *
+ * PRIVATE METHOD: IsResult
+ *
+ ********************************************************************************/
+int CHTMLOutput::IsFailedResult( CDataField *aField )
+{
+	int match, value;
+	char *field_name;
+
+	// check parameters
+	if( aField == NULL ) {
+		return 0;
+	}
+
+	// get the name of the field and see if this is a result
+	field_name = aField->GetName();
+	match = strcmp( field_name, STD_REPLY_FIELD_RESULT );
+	if( match != 0 ) {
+		return 0;
+	}
+
+	// this is a RESULT field, see if it is none-zero
+	value = aField->GetIntValue();
+	if( value == ERR_NONE ) {
+		return 0;
+	}
+
+	// this is a failed result
+	return 1;
+}
+
+
+/********************************************************************************
+ *
+ * PRIVATE METHOD: OutputLineBreak
+ *
+ ********************************************************************************/
+void CHTMLOutput::OutputLineBreak( FILE* aFile )
+{
+	_snprintf( iLineBuffer, MAXLINELENGTH, "<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>\n" );
+	OutputLine( aFile, iLineBuffer );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/HTMLOutput.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CHTMLOutput
+*
+*/
+
+
+
+#ifndef __CHTMLOutput_H__
+#define __CHTMLOutput_H__
+
+/********************************************************************************
+ *
+ * System Includes
+ *
+ ********************************************************************************/
+#include <stdio.h>
+
+/********************************************************************************
+ *
+ * Local Includes
+ *
+ ********************************************************************************/
+#include "UCCS_Interfaces.h"
+
+
+/********************************************************************************
+ *
+ * Defines
+ *
+ ********************************************************************************/
+#define MAXLOGFILENAMELEN	256
+#define MAXLINELENGTH		1024
+
+typedef enum {
+	RT_INVALID,
+	RT_COMMAND,
+	RT_COMMAND_REPLY,
+	RT_ENVIRONMENT,
+	RT_COUNT
+} TRecordType;
+
+
+/********************************************************************************
+ *
+ * CHTMLOutput
+ *
+ ********************************************************************************/
+class CHTMLOutput : public IOutput
+{
+public:
+	CHTMLOutput();
+	~CHTMLOutput();
+
+	int SetFilename( char *aFilename );
+
+	// from IOutput
+	void StartUsecase( int aID );
+	void EndUsecase( int aID, int aResult );
+	void Error( int aErrorCode, char *aErrorString );
+	void CompletedScript();
+
+	void ExecuteCommand( TUccsCommand aCommand, CDataRecord *aArgs );
+	void ExecuteCommandResult( int aUccsErrorcode );
+	void ExecuteCommandReply( CDataRecord *aReply );
+
+	void DisplayHelp();
+	void DisplayLastCommand( CDataRecord *aCommand );
+	void DisplayLastReply( CDataRecord *aResult );
+	void DisplayEnvironment( CDataRecord *aEnvironment );
+
+	void ExecuteString( char *aCommandLine );
+	void ExecuteStringResult( int aUccsErrorcode );
+
+	void StartServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused );
+	void StopServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused );
+
+private:
+	// helper methods
+	void OutputLine( FILE *aFile, char *aLine );
+	void OutputBeginTags();
+	void OutputDataRecord( FILE* aFile, CDataRecord *aArgs, TRecordType aRecordType, TUccsCommand aCommand );
+	void OutputLineBreak( FILE* aFile );
+	int IsFailedResult( CDataField *aField );
+
+	// log files
+	FILE *iFile;
+	FILE *iFileDebug;
+	FILE *iFileNoRefresh;
+	char iLogName[MAXLOGFILENAMELEN];
+	char iDebugLogName[MAXLOGFILENAMELEN];
+	char iLogNameNoRefresh[MAXLOGFILENAMELEN];
+	
+	// standard line buffer
+	char iLineBuffer[MAXLINELENGTH];
+
+	// state
+	bool iCompletedScriptCalled;
+	int iCounter;
+
+	// configurations - initialised in the constructor
+	char *iNonZeroResultColour;
+	char *iRecordTableTitle[RT_COUNT];
+	char *iRecordTableTitleBackgroundColour[RT_COUNT];
+	char *iRecordTableBorderColour[RT_COUNT];
+	char *iStandardRowColour[RT_COUNT];
+	int iStandardRowCount[RT_COUNT];
+};
+
+#endif //__CHTMLOutput_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CBatchEngine.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,428 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CBatchEngine.cpp
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <io.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_CBatchEngine.h"
+#include "UCCS_ErrorCodes.h"
+
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define IS_WHITESPACE(c)			(((c) == '\t')||((c) == '\n')||((c) == ' '))
+#define MAXCOMMANDLENGTH			2048
+
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+DWORD WINAPI ThreadProc(LPVOID lpParameter);
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: Construction
+ *
+ **********************************************************************************/
+CBatchEngine::CBatchEngine( IRetrieveCommand *aRetrieveCommand, IOutput *aOutput )
+{
+	// check parameters
+	assert( aRetrieveCommand != NULL );
+	assert( aOutput != NULL );
+
+	// init the vars
+	iRetrieveCommand = aRetrieveCommand;
+	iOutput = aOutput;
+
+	// set all other state
+	iExecutionThreadState = ETS_IDLE;
+	iControlThreadState = CTS_IDLE;
+
+	// the rest are set according to the state -- for idle their value is irrelevant 
+	// but I'd like to set them anyway for completeness
+	iLastError = 0;
+	iSync = NULL;
+	iUsecaseID = INVALID_USECASE_ID;
+	hThreadHandle = NULL;
+	iExecuteCommand = NULL;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: Destruction
+ *
+ **********************************************************************************/
+CBatchEngine::~CBatchEngine()
+{
+	// clean up any memory holding state variables
+	if( iExecuteCommand != NULL ) {
+		delete iExecuteCommand;
+		iExecuteCommand = NULL;
+	}
+	if( hThreadHandle != NULL ) {
+		CloseHandle(hThreadHandle);
+		hThreadHandle = NULL;
+	}
+	if( iSync != NULL ) {
+		delete iSync;
+		iSync = NULL;
+	}
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: StartUseCase
+ *
+ **********************************************************************************/
+int CBatchEngine::StartUsecase( int aUsecaseID )
+{
+	int err;
+	DWORD dwThreadID;
+
+	// check that the control thread is currently in idle
+	if( iControlThreadState != CTS_IDLE ) {
+		return UCCS_ALREADYSTARTEDUSECASE;
+	}
+	assert( iExecutionThreadState == ETS_IDLE );
+
+	// ask the retriever to get the use-case description
+	err = iRetrieveCommand->StartUseCase( aUsecaseID );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// set all the state appropriatley
+	assert( iSync == NULL );
+	iSync = new CSynchronisation( iOutput );
+	assert( iSync != NULL );
+	assert( iExecuteCommand == NULL );
+	iExecuteCommand = new CExecuteCommand( iSync, iOutput );
+	assert( iExecuteCommand != NULL );	
+	iLastError = 0;
+	iUsecaseID = aUsecaseID;
+
+	// set the state
+	iExecutionThreadState = ETS_EXECUTING_SCRIPT;
+	iControlThreadState = CTS_USECASE_STARTED;
+
+	// output that we have started
+	iOutput->StartUsecase( aUsecaseID );
+
+	// start the thread that goes and executes the steps
+#ifndef TESTCASEBATCH
+	hThreadHandle = CreateThread( NULL, 0, ThreadProc, this, 0,	&dwThreadID );		
+#else
+	hThreadHandle = 0;
+#endif
+	if( hThreadHandle == 0 ) {
+		delete iSync;
+		iSync = NULL;
+		delete iExecuteCommand;
+		iExecuteCommand = NULL;
+		iUsecaseID = INVALID_USECASE_ID;
+		iExecutionThreadState = ETS_IDLE;
+		iControlThreadState = CTS_IDLE;
+		return UCCS_FAILEDTOCREATEEXECUTETHREAD;
+	}
+
+	// done - return OK to the external controller
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: EndUsecase
+ *
+ **********************************************************************************/
+int CBatchEngine::EndUsecase( int aUsecaseID, int aResult, int *aScriptResult )
+{
+	int err;
+
+	// check that the control thread is in the correct state
+	if( iControlThreadState != CTS_USECASE_STARTED ) {
+		*aScriptResult = UCCS_NOUSECASERUNNING;
+		return UCCS_NOUSECASERUNNING;
+	}
+
+	// update the state of the control thread to ended -- this will cause the execution
+	// thread to exit on it's next iteration. 
+	iControlThreadState	= CTS_USECASE_ENDED;
+
+	// We clear the synchronisation so that if the execution thread is (or is just about 
+	// to) wait on a semaphore then it will not get stuck forever
+	iSync->ClearSynchronisation();
+
+	// Wait for the thread to really exit
+	err = WaitForSingleObject( hThreadHandle, INFINITE );
+	if( err != WAIT_OBJECT_0 ) {
+		iOutput->Error( UCCS_SYSTEMERROR, "An error occured while waiting for the executing script thread to finish." );
+	}
+	CloseHandle( hThreadHandle );
+	hThreadHandle = NULL;
+
+	// cleanup the rest of the state 
+	assert( iExecutionThreadState == ETS_IDLE );
+	iControlThreadState = CTS_IDLE;
+	delete iSync;	
+	iSync = NULL;
+	delete iExecuteCommand;
+	iExecuteCommand = NULL;
+	iUsecaseID = INVALID_USECASE_ID;
+	
+	// output that endusecase has been called
+	iOutput->EndUsecase( aUsecaseID, aResult );
+
+	// done -- return the information
+	*aScriptResult = iLastError;
+	iLastError = 0;
+	return UCCS_OK;
+}
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: GetVariableName
+ *
+ **********************************************************************************/
+int CBatchEngine::GetEnvVariable( char *aVariableName, char *aOutputBuffer, int aOutputBufferLen ) 
+{
+	// check params
+	assert ( aVariableName != NULL );
+	assert ( aOutputBuffer != NULL );
+	assert ( aOutputBufferLen > 0 );
+
+	// check that there is an actual usecase running
+	if( iControlThreadState != CTS_USECASE_STARTED ) {
+		return UCCS_NOUSECASERUNNING;
+	}
+	
+	// check that there is actually a command around
+	if( iExecuteCommand == NULL ) {
+		return UCCS_COMMANDEXECUTIONNOTSTARTEDYET;
+	}
+
+	// change aVariableName to uppercase -a s it is stored in the data record as uppercase.
+	_strupr( aVariableName );
+
+	// now go get the environment var
+	return iExecuteCommand->GetEnvironmentVariable( aVariableName, aOutputBuffer, aOutputBufferLen );
+}
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: RunCommand
+ *
+ **********************************************************************************/
+int CBatchEngine::RunCommand( char* aCommandLine )
+{
+	// check params
+	assert ( aCommandLine != NULL );
+
+	// check that there is actually a command around
+	if( iSync == NULL ) {
+		iSync = new CSynchronisation( iOutput );
+	}
+	if( iExecuteCommand == NULL ) {
+		iExecuteCommand = new CExecuteCommand( iSync, iOutput );
+	}
+
+	// now go get the environment var
+	return iExecuteCommand->ExecuteCommand( aCommandLine );
+}
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: Signal
+ *
+ **********************************************************************************/
+
+int CBatchEngine::Signal( int aUsecaseID )
+{
+	// check that the state is valid
+	if( iControlThreadState != CTS_USECASE_STARTED ) {
+		return UCCS_NOUSECASERUNNING;
+	}
+	return iSync->SignalFromDevice();
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: Rendezvous
+ *
+ **********************************************************************************/
+int CBatchEngine::Rendezvous( int aUseCaseID )
+{
+	// check that the control state is valid
+	if( iControlThreadState != CTS_USECASE_STARTED ) {
+		return UCCS_NOUSECASERUNNING;
+	}
+
+	// check that the execution thread is still running
+	if( iExecutionThreadState != ETS_EXECUTING_SCRIPT ) {
+		return UCCS_SCRIPTFINISHED;
+	}
+
+	// do the sync
+	return iSync->RendezvousFromDevice();
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: Wait
+ *
+ **********************************************************************************/
+int CBatchEngine::Wait( int aUseCaseID )
+{
+	// check that the control state is valid
+	if( iControlThreadState != CTS_USECASE_STARTED ) {
+		return UCCS_NOUSECASERUNNING;
+	}
+
+	// check that the execution thread is still running
+	if( iExecutionThreadState != ETS_EXECUTING_SCRIPT ) {
+		return UCCS_SCRIPTFINISHED;
+	}
+
+	// do the sync
+	return iSync->WaitFromDevice();
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: ExecuteScript
+ *
+ **********************************************************************************/
+int CBatchEngine::ExecuteScript( void )
+{
+	int err;
+	char *c;
+	char command_buffer[MAXCOMMANDLENGTH];
+	int rv = 0;
+
+	// execute all the commands 
+	while( 1 ) {
+
+		// if the controller has ended the usecase then we stop executing commands
+		if( iControlThreadState != CTS_USECASE_STARTED ) {
+			break;
+		}
+
+		// get the next command to execute
+		err = iRetrieveCommand->GetNextCommand( command_buffer, MAXCOMMANDLENGTH );
+		if( err == UCCS_NOMORECOMMANDS ) {
+			iOutput->CompletedScript();
+			break;
+		} 
+		assert( err == UCCS_OK );
+		
+		// NOTE: the code below is the correct implementation of handling generic errors from the input 
+		// module. It has been taken out because the input modules don't return anything except UCCS_NOMORECOMMANDS
+		// and UCCS_OK so there is no way to test the condition (and it messes up our coverage results!). But
+		// if new error codes are put in this implementation should be used.
+//			else if( err != UCCS_OK ) {
+//			iOutput->Error( err, "GetNextCommand returned error. Stopping script execution." );
+//			rv = err;
+//			break;
+//		}
+
+		// if the first not whitespace char is 0, or #, or // then return the comment
+		for( c = command_buffer; IS_WHITESPACE(*c); c++ ) 
+			;
+		if( (*c == 0) || (*c == '#') || ((c[0] == '/') && (c[1] == '/'))) {
+			continue;
+		}
+
+		// now execute the command 
+		iOutput->ExecuteString( c );
+		err = iExecuteCommand->ExecuteCommand( c );
+		iOutput->ExecuteStringResult( err );
+		if( (err != UCCS_OK) && (err != UCCS_QUIT) ) {
+			iOutput->Error( err, NULL );
+		}
+
+		// if the return value from the command was quit (i.e. the script had a 
+		// quit command) then we print the message and break from the loop.
+		if( err == UCCS_QUIT ) {
+			iOutput->CompletedScript();
+			break;
+		}
+
+		// save the last error -- this is so we can notify the device is an error occured
+		if( err != UCCS_OK ) {
+			iLastError = err;
+		}
+
+		// if we do a require or requirenot that fails then make a point about it!
+		if( (err == UCCS_REQUIREDVALUEERROR) || (err == UCCS_REQUIREDVALUEINCORRECT) || (err == UCCS_REQUIREDNOTVALUEERROR) || (err == UCCS_REQUIREDNOTVALUEMATCH) ) {
+			// should break out here -- problem is that at the moment there are no reset calls so we can't recover!!
+		}		
+	}
+
+	// set the state of this thread to completed and clear the synchronisation state so that
+	// the control thread won't wait forever. The state of the execution thread should stop
+	// the control thread from being able to wait again
+	iExecutionThreadState = ETS_COMPLETED_SCRIPT;
+	iSync->ClearSynchronisation();
+
+	// tell the input module that we are done with it
+	err = iRetrieveCommand->EndUseCase();
+	assert( err == UCCS_OK );
+
+	// set the state to idle 
+	iExecutionThreadState = ETS_IDLE;
+
+	// done
+	return rv;
+}
+			
+
+/***********************************************************************************
+ *
+ * FUNCTION: Entry point for second thread -- call executescript on the passed
+ * batch engine object.
+ *
+ **********************************************************************************/
+DWORD WINAPI ThreadProc(LPVOID lpParameter)
+{	
+	CBatchEngine* aLocalBatchEngine;
+	aLocalBatchEngine = (CBatchEngine*)lpParameter;
+	return aLocalBatchEngine->ExecuteScript();
+}
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CBatchEngine.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CBatchEngine.h
+*
+*/
+
+
+
+#ifndef __UCCSBATCHENGINE_H__
+#define __UCCSBATCHENGINE_H__
+
+
+/***********************************************************************************
+ *
+ * System Includes
+ *
+ **********************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_Interfaces.h"	
+#include "UCCS_CExecuteCommand.h"
+#include "CSynchronisation.h"
+
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define MAXFILENAMELENGTH		256
+#define INVALID_USECASE_ID		-1
+
+#define ETS_IDLE				0
+#define ETS_EXECUTING_SCRIPT	1
+#define ETS_COMPLETED_SCRIPT	2
+
+#define CTS_IDLE				0
+#define CTS_USECASE_STARTED		1
+#define CTS_USECASE_ENDED		2
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+class CBatchEngine : public MUccsControl
+{
+	public:
+		
+		//methods
+		CBatchEngine( IRetrieveCommand *aRetrieveCommand, IOutput *aOutput );
+		~CBatchEngine();	
+
+		// From MUccsControl - THREAD A
+		int StartUsecase( int aUsecaseID );
+		int Signal( int aUsecaseID );
+		int Rendezvous( int aUseCaseID );
+		int Wait( int aUseCaseID );
+		int EndUsecase( int aUsecaseID, int aResult, int *aScriptResult);
+		int GetEnvVariable(char *aVariableName, char *aOutputBuffer, int aOutputBufferLen);
+		int RunCommand( char* aCommandLine );
+
+		// Script execution - THREAD B
+		int ExecuteScript( void );
+			
+	private:
+		
+		// shared state that is static for the lifetime of batchengine 
+		IRetrieveCommand *iRetrieveCommand;
+		IOutput *iOutput;
+
+		// shared state -- note that these are set (NOT UPDATED!!) by one thread and
+		// read by another so there is no need for synchronisation
+		int iExecutionThreadState;
+		int iControlThreadState;
+		int iLastError;
+
+		// shared synchronisation state
+		CSynchronisation *iSync;
+
+		// THREAD A state
+		int iUsecaseID;
+		HANDLE hThreadHandle;
+
+		// THREAD B state
+		CExecuteCommand *iExecuteCommand;
+};
+
+//--------------------------------------------------------------------------------------------------
+
+#endif __UCCSBATCHENGINE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CCommandDecoder.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,503 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CCommandDecoder.cpp
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <stdlib.h>
+#include <iostream.h>
+#include <assert.h>
+#include <STDDEF.H>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <ctype.h>
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_CCommandDecoder.h"
+
+
+/***********************************************************************************
+ *
+ * Macro Functions
+ *
+ **********************************************************************************/
+#define IS_WHITESPACE(c)				((c == '\t')||(c == ' ')||(c == '\n'))
+#define NOT_IS_WHITESPACE_OR_TERM(c)	((IS_WHITESPACE(c) == 0)&&(c != 0))
+#define IS_NAME_CHAR(c)					(isdigit(c)||isalpha(c)||(c == '_'))
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define TA_FILENAME			1
+#define TA_ASSIGNEDVALUE	2
+#define TA_INTEGERLITERAL	4
+#define TA_STRINGLITERAL	8
+
+//--------------------------------------------------------------------------------------------------
+//
+// Construction
+//
+//--------------------------------------------------------------------------------------------------
+CCommandDecoder::CCommandDecoder( CDataRecord *aEnvironment )
+{
+	iEnvironment = aEnvironment;
+	iLastReply = NULL;
+}
+
+CCommandDecoder::~CCommandDecoder()
+{
+}
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// Parse commands here and store as a list of field descriptions 
+//
+//--------------------------------------------------------------------------------------------------
+int CCommandDecoder::ParseCommand( char* aCommandstring, TFieldDesc *aFieldList, int aListLength )
+{
+	char *start_name;
+	char *start_value;
+	int element_attributes;
+	char *end_value;
+	int i;
+	int err;
+
+	// if the command string is null then there is nothing to do
+	if( aCommandstring == NULL ) 
+		return UCCS_OK;
+
+	// process the entire string
+	start_name = aCommandstring;
+	for( i = 0; (i < aListLength) && (*start_name != 0); i++ ) {
+
+		// init the vars
+		element_attributes = 0;
+
+		// skip over any whitespace to the next start
+		for( start_name; IS_WHITESPACE(*start_name); start_name++ )
+			;
+
+		// if we are at NULL then exit
+		if( *start_name == 0 ) {
+			continue;
+		}
+
+		// if the character is not alpha then exit
+		if( isalpha(*start_name) == 0 ) {
+			return UCCS_PARSERFAILEDTOSTOREVALUE;
+		}
+
+		// otherwise this is the start of the token, look for the '=', only alpha, digit, and '_'
+		// characters are allowed in names
+		for( start_value = start_name; (start_value != NULL) && IS_NAME_CHAR(*start_value); start_value++ )
+			;
+		if( start_value == NULL ) {
+			break;
+		}
+		if( *start_value != '=' ) {
+			return UCCS_PARSERFAILEDTOSTOREVALUE;
+		}
+		*start_value = 0;
+		start_value++;
+
+		// if the character at start_value is alpha then this is an assigned value
+		if( isalpha(*start_value) ) {
+			element_attributes |= TA_ASSIGNEDVALUE;
+		}
+
+		// if the character at the start is numeric then this is an integer literal
+		if( isdigit(*start_value) ) {
+			element_attributes |= TA_INTEGERLITERAL;
+		}
+
+		// if the character at the start is '"' then this is a string literal
+		if( *start_value == '"' ) {
+			element_attributes |= TA_STRINGLITERAL;
+		}
+
+		// if the character is whitespace then this is an error
+		if( IS_WHITESPACE(*start_value) ) {
+			return UCCS_PARSERFAILEDTOSTOREVALUE;
+		}
+
+		// if the character at start_value is '"' then this is a string literal that may include
+		// whitespace and escaped '\' and '"' characters. At the end of this the start_value should
+		// point to a null terminated string that is what we want
+		if( *start_value == '"' ) {
+			end_value = FindEndOfDoubleQuotes( start_value );
+			if( end_value == NULL ) {
+				continue;
+			}
+			start_value++;
+		} else {
+			end_value = start_value;
+			for( end_value; NOT_IS_WHITESPACE_OR_TERM(*end_value); end_value++ )
+				;
+		}
+
+		// terminate the value
+		*end_value = 0;
+
+		// remove the escape sequences - eg. \" to "
+		if(DecodeEscapeSequences(start_value)) {
+            Cleanup( aFieldList, aListLength );
+            return UCCS_PARSERFAILEDTOSTOREVALUE;
+        }
+
+		// save the new value
+		err = StoreNextValue( start_name, start_value, element_attributes, aFieldList, i );
+		if( err != 0 ) {
+			Cleanup( aFieldList, aListLength );
+			return UCCS_PARSERFAILEDTOSTOREVALUE;
+		}
+
+		// now move to the next potential token
+		start_name = end_value + 1;
+	}
+
+	// done
+	return UCCS_OK;
+}
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// Parse commands here and store as a data record
+//
+//--------------------------------------------------------------------------------------------------
+int CCommandDecoder::ParseCommandToRecord( char *aCommandstring, CDataRecord *aRecord )
+{
+	int err;
+	int i;
+	TFieldDesc iFieldList[MAXFIELDCOUNT];
+
+	// Check params 
+	assert( aRecord != NULL );
+
+	// clear the field descriptions
+	memset( iFieldList, 0, sizeof(TFieldDesc)*MAXFIELDCOUNT );
+
+	// Parse the command into buffers
+	err = ParseCommand( aCommandstring, iFieldList, MAXFIELDCOUNT );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Now add all the fields to the record	
+	for( i = 0; (iFieldList[i].iName != NULL) && (i < MAXFIELDCOUNT); i++ ) {
+		if( iFieldList[i].iLength == 0 ) {
+			err = aRecord->NewField( iFieldList[i].iName, iFieldList[i].iValue );
+			assert( err == UCCS_OK );
+		} else {
+			err = aRecord->NewField( iFieldList[i].iName, iFieldList[i].iValue, iFieldList[i].iLength );
+			assert( err == UCCS_OK );
+		}
+		free( iFieldList[i].iName );
+		free( iFieldList[i].iValue );
+		iFieldList[i].iName = 0;
+		iFieldList[i].iValue = 0;
+		iFieldList[i].iLength = 0;
+	}
+
+	//done
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: SetLastReply - set the last reply to be used in parsing
+ *
+ **********************************************************************************/
+void CCommandDecoder::SetLastReply( CDataRecord *aLastReply )
+{
+	iLastReply = aLastReply;
+}
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// PRIVATE METHODS
+//
+//--------------------------------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------------------------------
+//
+// Store the value
+//
+//--------------------------------------------------------------------------------------------------
+int CCommandDecoder::StoreNextValue( char *aName, char *aValue, int aAttributes, TFieldDesc *aFieldList, int aIndex )
+{
+	int namelength;
+	int valuelength;
+//	int filesize;
+	int err;
+	int variable_found = 0;
+	char *aAssignedValue;
+
+	// check params
+	assert( aName != NULL );
+	assert( aValue != NULL );
+	assert( aFieldList != NULL );
+	assert( aFieldList[aIndex].iName == NULL );
+	assert( aFieldList[aIndex].iValue == NULL );
+
+	// store the name
+	_strupr( aName );
+	namelength = strlen( aName );
+	(aFieldList[aIndex].iName) = (char*)malloc( namelength + 1 );
+	assert( (aFieldList[aIndex].iName) != NULL );
+	strcpy( (aFieldList[aIndex].iName), aName );
+
+	// if the assigned values attribute is set then we: value = environment[value'] -- value = lastreply[value']
+	if( aAttributes & TA_ASSIGNEDVALUE ) {
+
+		// change the variable name to upper case to remove all case sensitivity
+		_strupr( aValue );
+
+		// look in the environment first
+		if( iEnvironment != NULL ) {
+			err = iEnvironment->GetFieldAsString( aValue, &aAssignedValue );
+			if( err == UCCS_OK ) {
+				aValue = aAssignedValue;
+				variable_found = 1;
+			}
+		}
+
+		// look in the last reply
+		if( (iLastReply != NULL) && (variable_found == 0) ) {
+			err = iLastReply->GetFieldAsString( aValue, &aAssignedValue );
+			if( err == UCCS_OK ) {
+				aValue = aAssignedValue;
+				variable_found = 1;
+			}
+		}
+
+		// if variable wasn't found then return error
+		if( variable_found == 0 ) {
+			return -1;
+		}
+	}
+
+	// store non-file values 
+	if( (aAttributes & TA_FILENAME) == 0 ) {
+		valuelength = strlen( aValue );
+		(aFieldList[aIndex].iValue) = (char*)malloc( valuelength + 1 );
+		assert( (aFieldList[aIndex].iValue) != NULL );
+		strcpy( (aFieldList[aIndex].iValue), aValue );
+	}
+
+	// store file value
+#ifdef OLDSTYLE
+	if( aAttributes & TA_FILENAME ) {
+
+		// get the size of the file
+		filesize = GetFileSize( aValue );
+		if( filesize == -1 ) {
+			free( (aFieldList[aIndex].iName) );
+			(aFieldList[aIndex].iName) = NULL;
+			return -1;
+		}
+
+		// allocate the memory to hold the file
+		(aFieldList[aIndex].iValue) = (char*)malloc( filesize );
+		assert( (aFieldList[aIndex].iValue) != NULL );
+
+		// set the size
+		aFieldList[aIndex].iLength = filesize;
+
+		// read the file into memory
+		err = ReadFileIntoBuffer( aValue, (aFieldList[aIndex].iValue), filesize );
+		if( err != 0 ) {
+			free( (aFieldList[aIndex].iName) );
+			(aFieldList[aIndex].iName) = NULL;
+			free( (aFieldList[aIndex].iValue) );
+			(aFieldList[aIndex].iValue) = NULL;
+			return -1;
+		}
+	}
+#endif
+
+	// done
+	return 0;
+}
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// FindEndOfDoubleQuotes -- given a string starting with '"' it returns a pointer to the character
+// matching '"'. It deals with escaped chars.
+//
+//--------------------------------------------------------------------------------------------------
+char *CCommandDecoder::FindEndOfDoubleQuotes( char *aString )
+{
+	char *str;
+
+	// the first char MUST be '"'
+	if( aString[0] != '"' ) {
+		return NULL;
+	}
+
+	// now look for a non-escaped '"'
+	str = aString + 1;
+	while( 1 ) {
+		str = strchr( str, '"' );
+		if( str == NULL ) {
+			return NULL;
+		}
+		if( str[-1] != '\\' ) {
+			return str;
+		}
+		str++;
+	}
+
+	// done
+	assert( !"INVALID CODE PATH" );
+	return NULL;
+}
+//--------------------------------------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// GetFileSize -- return the size of a file
+//
+//--------------------------------------------------------------------------------------------------
+int CCommandDecoder::GetFileSize( char *aFilename )
+{
+	struct _stat sinfo;
+	int err;
+	err = _stat( aFilename, &sinfo );
+	if( err != 0 ) {
+		return -1;
+	}
+	return sinfo.st_size;
+}
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// GetFileSize -- return the size of a file
+//
+//--------------------------------------------------------------------------------------------------
+int CCommandDecoder::ReadFileIntoBuffer( char *aFilename, char *aBuff, int aBuffSize )
+{
+	FILE *fp;
+	int err;
+	int i;
+
+	// open the file
+	fp = fopen( aFilename, "rb" );
+	if( fp == NULL ) {
+		return -1;
+	}
+
+	// read in the bytes
+	for( i = 0; i < aBuffSize; i++ ) {
+		err = fread( &(aBuff[i]), 1, 1, fp );
+		if( err != 1 ) {
+			fclose( fp );
+			return -1;
+		}
+	}
+
+	// done
+	fclose( fp );
+	return 0;
+}
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// Cleanup
+//
+//--------------------------------------------------------------------------------------------------
+void CCommandDecoder::Cleanup( TFieldDesc *aFieldList, int aLen )
+{
+	int i;
+	for( i = 0; i < aLen; i++ ) {
+		if( (aFieldList[i].iName) != NULL ) {
+			free( (aFieldList[i].iName) );
+			(aFieldList[i].iName) = NULL;
+		}
+		if( (aFieldList[i].iValue) != NULL ) {
+			free( (aFieldList[i].iName) );
+			(aFieldList[i].iName) = NULL;
+		}
+	}
+}
+
+
+//--------------------------------------------------------------------------------------------------
+//
+// DecodeEscapeSequences - change \" to " and \\ to \
+//
+//--------------------------------------------------------------------------------------------------
+// decode escape sequence
+// - deliberately chose not to use sscanf's parser; more complicated, performance overhead, & requirement for a seperate string
+int CCommandDecoder::DecodeEscapeSequences(char *start_value)
+{
+	int result = 0, read_pos = 0, write_pos = 0;
+
+	// remove the escape char
+	while (start_value[read_pos] != 0)
+    {
+		if (start_value[read_pos++] == '\\') 
+        {
+            char decodedChar = 0;
+            switch (start_value[read_pos++]) 
+            {
+            case 'a':  decodedChar = '\a'; break;
+            case 'b':  decodedChar = '\b'; break;
+            case 'f':  decodedChar = '\f'; break;
+            case 'n':  decodedChar = '\n'; break;
+            case 'r':  decodedChar = '\r'; break;
+            case 't':  decodedChar = '\t'; break;
+            case 'v':  decodedChar = '\v'; break;
+            case '\\': decodedChar = '\\'; break;
+            case '?':  decodedChar = '\?'; break;
+            case '\'': decodedChar = '\''; break;
+            case '\"': decodedChar = '\"'; break;
+            // case '\x"': decodedChar = '\"'; break; - not supported, since this could overrun the char array
+            // case '\o"': decodedChar = '\"'; break; - not supported, functionality not needed
+            default:
+                // unknown
+                result = -1;
+                return result;
+            }
+            start_value[write_pos++] = decodedChar;
+        }
+        else
+			start_value[write_pos++] = start_value[read_pos - 1];
+	}
+
+	// re-insert the null char
+	start_value[write_pos] = 0;
+
+    return result;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CCommandDecoder.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CCommandDecoder.h
+*
+*/
+
+
+
+#ifndef __UCCSCOMMANDLINE_H__
+#define __UCCSCOMMANDLINE_H__
+
+
+/***********************************************************************************
+ *
+ * System Includes
+ *
+ **********************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_CServMgr.h"
+#include "UCCS_ErrorCodes.h"
+#include "UCCS_CDataRecord.h"
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define MAXFIELDCOUNT 1024
+
+/***********************************************************************************
+ *
+ * Types
+ *
+ **********************************************************************************/
+typedef struct {
+	char *iName;
+	char *iValue;
+	int iLength;
+} TFieldDesc;
+
+/***********************************************************************************
+ *
+ * CCommandDecoder definition
+ *
+ **********************************************************************************/
+class CCommandDecoder
+{
+public:
+		
+	//methods
+	CCommandDecoder( CDataRecord *aEnvironment );
+	~CCommandDecoder();
+	int ParseCommandToRecord( char *aCommandstring, CDataRecord *aRecord );
+	void SetLastReply( CDataRecord *aLastReply );
+
+private:
+	int ParseCommand( char* aCommandstring, TFieldDesc *aFieldList, int aListLength );
+	int StoreNextValue( char *aName, char *aValue, int aFileFlag, TFieldDesc *aFieldList, int aIndex );
+	char *FindEndOfDoubleQuotes( char *aString );
+	int GetFileSize( char *aFilename );
+	int ReadFileIntoBuffer( char *aFilename, char *aBuff, int aBuffSize );
+	void Cleanup( TFieldDesc *aFieldList, int aLen );
+	int DecodeEscapeSequences(char *start_value);
+
+	CDataRecord *iLastReply;
+	CDataRecord *iEnvironment;
+};													
+//----------------------------------------------------------------------------------
+
+#endif __UCCSCOMMANDLINE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataField.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CDataField.cpp
+* System Includes
+*
+*/
+
+
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_CDataField.h"
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define MAXINTEGERSTRINGLEN 16
+
+
+/***********************************************************************************
+ *
+ * Constructor
+ *
+ **********************************************************************************/
+CDataField::CDataField( char* aName )
+{
+	// check the params
+	assert( aName != NULL );
+	assert( strlen(aName) < MAXNAMELENGTH );
+
+	// initialise all state vars
+	strcpy( iSelfObjectName, aName );
+	iFieldValue = NULL;
+	iFieldValueLength = 0;
+	iType = UDF_UNDEFINED;
+}
+
+
+/***********************************************************************************
+ *
+ * Destructor
+ *
+ **********************************************************************************/
+CDataField::~CDataField()
+{
+	// free any remaining value memory
+	if( iFieldValue != NULL ) 
+	{
+		free( iFieldValue );
+		iFieldValue = NULL;
+	}
+
+	iSelfObjectName[0] = 0;
+	iFieldValueLength = 0;
+	iType = UDF_UNDEFINED;
+}
+
+//----------------------------------------------------------------------------------
+// Retrieves the item name
+char* CDataField::GetName()
+{
+	return iSelfObjectName;
+}
+
+//----------------------------------------------------------------------------------
+// Returns boolean for whether the passed string matches the name of the field
+int CDataField::IsItem(char* anItemName)
+{
+	int difference = 0;
+
+	// check params
+	assert( anItemName != NULL );
+
+	// compare string
+	difference = strncmp( anItemName, iSelfObjectName, MAXNAMELENGTH );
+	return ((difference == 0) ? 1 : 0);
+}
+
+//----------------------------------------------------------------------------------
+// Set string value
+void CDataField::SetValue(char* aValue)
+{
+	// first free previous value
+	if(iFieldValue != NULL) 
+	{
+		free(iFieldValue);
+		iFieldValueLength = 0;
+	}
+
+	// set the type
+	iType = UDF_STRING;
+
+	// if the value is null then we still want an empty string -- otherwise just copy the string
+	if( aValue == NULL ) {
+		iFieldValue = malloc( 1 );
+		((char*)iFieldValue)[0] = 0;
+		iFieldValueLength = 1;
+	} else {
+		iFieldValue = malloc(strlen(aValue) + 1 );
+ 		strcpy((char*)iFieldValue, aValue);
+		iFieldValueLength = strlen((char*)iFieldValue) + 1;
+	}
+}
+
+//----------------------------------------------------------------------------------
+// Sets integer value 
+void CDataField::SetValue(int aValue)
+{
+	// first free previous value
+	if(iFieldValue != NULL) 
+	{
+		free(iFieldValue);
+		iFieldValueLength = 0;
+	}
+
+	// now copy new value
+	iType = UDF_STRING;
+	iFieldValue = malloc( MAXINTEGERSTRINGLEN + 1 );
+	sprintf((char*)iFieldValue, "%d", aValue);
+	iFieldValueLength = (MAXINTEGERSTRINGLEN + 1);
+}
+
+//----------------------------------------------------------------------------------
+// Sets buffer value 
+void CDataField::SetValue(void *aValue, int aLen)
+{
+	// first free previous value
+	if(iFieldValue != NULL)
+	{
+		free(iFieldValue);
+		iFieldValueLength = 0;
+	}
+
+	// now copy new value
+	iType = UDF_BUFFER;
+	iFieldValue = malloc(aLen);
+	memcpy(iFieldValue, aValue, aLen);
+	iFieldValueLength = aLen;
+}
+
+//----------------------------------------------------------------------------------
+// Returns the string value from the object (could contain anything)
+char* CDataField::GetStrValue()
+{
+	return (char*)iFieldValue;
+}
+
+//----------------------------------------------------------------------------------
+// Returns an integer value from the object 
+int CDataField::GetIntValue()
+{
+	int intvalue = 0;
+
+	if( iFieldValue != NULL )
+	{
+		intvalue = atoi((char*)iFieldValue);
+	}
+	return intvalue;	
+}
+
+//----------------------------------------------------------------------------------
+// Returns a value from the buffer
+void* CDataField::GetBufValue( int *aLen )
+{
+	assert( aLen != NULL );
+	*aLen = iFieldValueLength;
+	return iFieldValue;
+}
+
+//----------------------------------------------------------------------------------
+// Sets the type of the item (i.e. command, error code etc)
+void CDataField::SetType( TFieldType aType )
+{
+	iType = aType;
+}
+
+//----------------------------------------------------------------------------------
+//returns the type
+TFieldType CDataField::GetType()
+{
+	return iType;
+}
+
+//----------------------------------------------------------------------------------
+void CDataField::PrintField( FILE *aFile )
+{
+	if( iType == UDF_STRING ) {
+		fprintf( aFile, "%s: %s\n", iSelfObjectName, iFieldValue );
+	} else if( iType == UDF_BUFFER ) {
+		fprintf( aFile, "%s: %d byte buffer\n", iSelfObjectName, iFieldValueLength );
+	} else {
+		fprintf( aFile, "%s: unknown contents\n", iSelfObjectName );
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataField.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CDataField.h
+*
+*/
+
+
+
+#ifndef __UCCSCDATAFIELD_H__
+#define __UCCSCDATAFIELD_H__
+
+
+/***********************************************************************************
+ *
+ * System Includes
+ *
+ **********************************************************************************/
+#include <stdio.h>
+
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define MAXNAMELENGTH	128
+
+
+/***********************************************************************************
+ *
+ * Types
+ *
+ **********************************************************************************/
+typedef enum {
+	UDF_UNDEFINED,
+	UDF_STRING,
+	UDF_INTEGER,
+	UDF_BUFFER
+} TFieldType;
+
+
+/***********************************************************************************
+ *
+ * CDataField
+ *
+ **********************************************************************************/
+class CDataField
+{
+	public:
+
+		// Methods
+		CDataField( char* aName );
+		~CDataField();
+
+		char* GetName();				// Get the name of the field
+		int IsItem(char* anItemName);	// Return boolean whether this item has the given name
+
+		// set field value
+		void SetValue(char* aValue);
+		void SetValue(int aValue);
+		void SetValue(void *aValue, int aLen);
+
+		// retrieve field value
+		char* GetStrValue();	
+		int GetIntValue();
+		void* GetBufValue( int *aLen );
+
+		// set and get type
+		void SetType(TFieldType aType);
+		TFieldType GetType();
+
+		// debug
+		void PrintField( FILE *aFile );
+
+	private:
+	
+		//variables
+		void* iFieldValue;
+		int iFieldValueLength;
+		char iSelfObjectName[MAXNAMELENGTH];
+		TFieldType iType;
+};
+
+#endif //__UCCSCDATAFIELD_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataRecord.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,457 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CDataRecord.cpp
+* System Includes
+*
+*/
+
+
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_CDataRecord.h"
+#include "UCCS_ErrorCodes.h"
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: Constructor
+ *
+ **********************************************************************************/
+CDataRecord::CDataRecord()
+{
+	int i;
+
+	// allocate a list to hold the fields
+	iFieldList = (CDataField**)malloc( sizeof(CDataField*) * INITIALFIELDCOUNT );
+	memset( iFieldList, 0, (sizeof(CDataField*)*INITIALFIELDCOUNT) );
+
+	// initialise state
+	iCapacity = INITIALFIELDCOUNT;
+	iDataFields = 0;
+	iField = -1;
+	iLastFieldReturned = -1;
+
+	// initialise all members
+	for( i = 0; i < iCapacity; i++) {
+		assert( iFieldList[i] == NULL );
+		iFieldList[i] = NULL;
+	}
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: Destructor
+ *
+ **********************************************************************************/
+CDataRecord::~CDataRecord()
+{
+	// Delete all remaining fields
+	for(int a = 0; a < iCapacity; a++) {	
+		if(iFieldList[a] != NULL) {
+			delete iFieldList[a];
+			iFieldList[a] = NULL;
+		}
+	}
+	
+	// free the list
+	free( iFieldList );
+	iFieldList = NULL;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: NewField() - Creates a new record using the string value passed.
+ *
+ **********************************************************************************/
+int CDataRecord::NewField( char* aDataFieldName, char* aValue )
+{
+	int pos = 0;
+
+	// get a free slot in the list
+	pos = GetFreeSlot();
+	if( pos == -1 ) {
+		return UCCS_RECORDFULL;
+	}
+
+	// create the field and set it's init value
+	iFieldList[pos] = new CDataField( aDataFieldName );
+	iFieldList[pos]->SetValue( aValue );
+
+	// update the state
+	iDataFields++;	
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: NewField() - Creates a new record using the integer value passed.
+ *
+ **********************************************************************************/
+int CDataRecord::NewField(char* aDataFieldName, int aValue)
+{
+	int pos = 0;
+
+	// get a free slot in the list
+	pos = GetFreeSlot();
+	if( pos == -1 ) {
+		assert( pos != -1 );
+		return UCCS_RECORDFULL;
+	}
+
+	// create the field and set it's init value
+	iFieldList[pos] = new CDataField( aDataFieldName );
+	iFieldList[pos]->SetValue( aValue );
+
+	// update the state
+	iDataFields++;
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: NewField() - Creates a new record using the length value passed.
+ *
+ **********************************************************************************/
+int CDataRecord::NewField(char* aDataFieldName, void* aBuffer, int aLen)
+{
+	int pos = 0;
+	
+	// get a free slot in the list
+	pos = GetFreeSlot();
+	if( pos == -1 ) {
+		assert( pos != -1 );
+		return UCCS_RECORDFULL;
+	}
+
+	// create the field and set it's init value
+	iFieldList[pos] = new CDataField( aDataFieldName );
+	iFieldList[pos]->SetValue( aBuffer, aLen );
+	
+	// update the state
+	iDataFields++;
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: DeleteField() - Removes data item object of the parameter name.
+ *
+ **********************************************************************************/
+int CDataRecord::DeleteField(char* aDataFieldName)
+{
+	int err = 0;
+
+	// Retrieve the item
+	err = GetField( aDataFieldName );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Update state
+	delete iFieldList[iField];
+	iFieldList[iField] = NULL;
+	iDataFields -= 1;
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: ChangeFieldData() - Alters the data item data.
+ *
+ **********************************************************************************/
+int CDataRecord::ChangeFieldData( char* aDataFieldName, char* aDataFieldValue )
+{
+	int err = 0;
+
+	// Retrieve the item
+	err = GetField( aDataFieldName );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Set the new value
+	(iFieldList[iField])->SetValue( aDataFieldValue );
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: ChangeFieldData() - Alters the data item data.
+ *
+ **********************************************************************************/
+int CDataRecord::ChangeFieldData( char* aDataFieldName, int aDataFieldValue )
+{
+	int err = 0;
+
+	// Retrieve the item
+	err = GetField( aDataFieldName );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Set the new value
+	(iFieldList[iField])->SetValue( aDataFieldValue );
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: ChangeFieldData() - Alters the data item data.
+ *
+ **********************************************************************************/
+int CDataRecord::ChangeFieldData(char* aDataField, void* aDataFieldValue, int aDataFieldLen )
+{
+	int err = 0;
+	
+	// Retrieve the item
+	err = GetField( aDataField );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Set the new value
+	(iFieldList[iField])->SetValue( aDataFieldValue, aDataFieldLen );
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: GetFieldAsInt() - Returns the field as an integer.
+ *
+ **********************************************************************************/
+int CDataRecord::GetFieldAsInt(char* aFieldName, int* aValue)
+{
+	int err = 0;
+
+	// Check params
+	assert( aValue != NULL );
+
+	// Retrieve the item
+	err = GetField( aFieldName );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Retrieve the value
+	*aValue = (iFieldList[iField])->GetIntValue();
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: GetFieldAsString() - Returns the field as a string.
+ *
+ **********************************************************************************/
+int CDataRecord::GetFieldAsString(char* aFieldName, char** aValue)
+{
+	int err = 0;
+
+	// Check params
+	assert( aValue != NULL );
+	*aValue = NULL;
+
+	// Retrieve the item
+	err = GetField( aFieldName );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Retrieve the value
+	*aValue = (iFieldList[iField])->GetStrValue();
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: GetFieldAsBuffer() - Returns the field as a buffer.
+ *
+ **********************************************************************************/
+int CDataRecord::GetFieldAsBuffer(char* aFieldName, void** aValue, int* aLen)
+{
+	int err = 0;
+	
+	// Check params
+	assert( aValue != NULL );
+	assert( aLen != NULL );
+
+	// Retrieve the item
+	err = GetField( aFieldName );
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// Retrieve the value
+	*aValue = (iFieldList[iField])->GetBufValue( aLen );
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: GetFieldCount() - Retrieve the number of active items in the list.
+ *
+ **********************************************************************************/
+int CDataRecord::GetFieldCount()
+{
+	int i;
+	int count = 0;
+
+	// do a consistency check on the number of fields -- this should be taken out
+	// once system test is passed.
+	for( i = 0; i < iCapacity; i++ ) {
+		if( iFieldList[i] != NULL ) 
+			count++;
+	}
+	assert( iDataFields == count );
+
+	// return the stored value
+	return iDataFields;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: GetFirstField()
+ *
+ **********************************************************************************/
+CDataField *CDataRecord::GetFirstField()
+{
+	int i;
+	for( i = 0; i < iCapacity; i++ ) {
+		if( iFieldList[i] != NULL ) {
+			iLastFieldReturned = i;
+			return iFieldList[i];
+		}
+	}
+	return NULL;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: GetNextField()
+ *
+ **********************************************************************************/
+CDataField *CDataRecord::GetNextField()
+{
+	int i;
+	for( i = (iLastFieldReturned + 1); i < iCapacity; i++ ) {
+		if( iFieldList[i] != NULL ) {
+			iLastFieldReturned = i;
+			return iFieldList[i];
+		}
+	}
+	return NULL;
+}
+
+
+/***********************************************************************************
+ *
+ * PRIVATE METHODS: List Manipulation. Only these functions may modify iField
+ *
+ **********************************************************************************/
+
+/***********************************************************************************
+ *
+ * GetFreeSlot() - returns the index of a free slot also places the 
+ * index in the iField member
+ *
+ **********************************************************************************/
+int CDataRecord::GetFreeSlot()
+{
+	int i;
+	int oldcapacity;
+
+	// loop through the iFieldList array and look for a free slot
+	for( i = 0; i < iCapacity; i++ ) {
+		if( iFieldList[i] == NULL ) {
+			iField = i;
+			return i;
+		}
+	}
+
+	// search failed, no spaces left. Allocate more space.
+	oldcapacity = iCapacity;
+	iCapacity *= CAPACITYINCREASEFACTOR;
+	iFieldList = (CDataField**)realloc( iFieldList, iCapacity*sizeof(CDataField*) );
+	for( i = oldcapacity; i < iCapacity; i++ ) {
+		iFieldList[i] = NULL;
+	}
+	iField = oldcapacity;
+	return oldcapacity;
+}
+
+
+/***********************************************************************************
+ *
+ * GetField() - returns the index of a field with the matching name
+ *
+ **********************************************************************************/
+int CDataRecord::GetField( char* aDataFieldName )
+{
+	int i, match;
+
+	// loop through the iFieldList array and check for a name match
+	for( i = 0; i < iCapacity; i++ ) {
+		if( iFieldList[i] != NULL ) {
+			match = iFieldList[i]->IsItem( aDataFieldName );
+			if( match ) {
+				iField = i;
+				return UCCS_OK;
+			}
+		}
+	}
+
+	// otherwise 
+	return UCCS_FIELDNOTFOUND;
+}
+
+
+/***********************************************************************************
+ *
+ * DEBUG METHODS: Print the record
+ *
+ **********************************************************************************/
+void CDataRecord::PrintRecord( FILE *aFile )
+{
+	int i;
+	for( i = 0; i < iCapacity; i++ ) {
+		if( iFieldList[i] != NULL ) {
+			fprintf( aFile, "    " );
+			iFieldList[i]->PrintField( aFile );
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataRecord.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_CDataRecord.h
+*
+*/
+
+
+
+#ifndef __UCCSCDATARECORD_H__
+#define __UCCSCDATARECORD_H__
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_CDataField.h"
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define INITIALFIELDCOUNT			16
+#define CAPACITYINCREASEFACTOR		2
+
+/***********************************************************************************
+ *
+ * CDataRecord Class Definition -- this class will act as the 'library' of data 
+ * items it has under it's control. It instantiates the items itself and retains
+ * responsibility for the memory.
+ *
+ **********************************************************************************/
+class CDataRecord
+{
+	public:
+
+		//methods
+		CDataRecord();
+		~CDataRecord();
+
+		// Create new field in the record
+		int NewField(char* aDataFieldName, char* aDataFieldValue);				// for string values
+		int NewField(char* aDataFieldName, int aDataFieldValue);				// for integer values
+		int NewField(char* aDataFieldName, void* aBuffer, int aDataFieldLen);	// for opaque buffers
+
+		// Delete a field from the record
+		int DeleteField(char* aDataFieldName);
+
+		// Change the value 
+		int ChangeFieldData(char* aDataField, char* aDataFieldValue);		
+		int ChangeFieldData(char* aDataField, int aDataFieldValue);		
+		int ChangeFieldData(char* aDataField, void* aDataFieldValue, int aDataFieldLen );		
+		
+		// Get the value -- used by the service manager (and others) to extract info.
+		int GetFieldAsInt(char* aFieldName, int* aValue);
+		int GetFieldAsString(char* aFieldName, char** aValue);
+		int GetFieldAsBuffer(char* aFieldName, void** aBuf, int* aLen);
+
+		// Allow people to traverse records
+		CDataField *GetFirstField();
+		CDataField *GetNextField();
+
+		// Get the number of fields in the record
+		int GetFieldCount();
+		
+		// debug
+		void PrintRecord( FILE *aFile );
+
+	private:
+
+		// Methods -- internal list manipulation functions
+		int GetFreeSlot();
+		int GetField(char* aDataFieldName);
+
+		// Variables
+		int iCapacity;
+		int iDataFields;							// number of fields in the record
+		CDataField **iFieldList;					// the list of item 
+		int iField;									//acts as an index for the array (above)
+		int iLastFieldReturned;
+};
+
+//----------------------------------------------------------------------------------
+
+#endif __UCCSCDATARECORD_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CExecuteCommand.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,754 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+/****************************************************************************************
+ *
+ * System Includes
+ *
+ ***************************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include <windows.h>
+
+/****************************************************************************************
+ *
+ * Local Includes
+ *
+ ***************************************************************************************/
+#include "UCCS_CExecuteCommand.h"
+
+
+/****************************************************************************************
+ *
+ * Definitions
+ *
+ ***************************************************************************************/
+#define REPEATCOMMANDWAITPERIOD		2000
+
+
+/********************************************************************************
+ *
+ * Macro Functions
+ *
+ ********************************************************************************/
+#define NOT_IS_WHITESPACE(c)		((c != '\t')&&(c != '\n')&&(c != 0)&&(c != ' '))
+ 
+/****************************************************************************************
+ *
+ * File-scope variables
+ *
+ ***************************************************************************************/
+static const char *iCommandStrings[] = {	"<invalid>", 
+											"quit", 
+											"runcmd", 
+											"assign",
+											"waitfor", 
+											"waitforsignal", 
+											"rendezvous", 
+											"require", 
+											"requirenot", 
+											"check", 
+											"checknot", 
+											"showenvironment", 
+											"waitfornot", 
+											"signal", 
+											NULL };
+
+/****************************************************************************************
+ *
+ * PUBLIC FUNCTION: GetScriptCommandString
+ *
+ ***************************************************************************************/
+const char *GetScriptCommandString( int aCommandID )
+{
+	// make sure the command ID is valid
+	if( (aCommandID < UC_QUIT) || (aCommandID > UC_SIGNAL) ) {
+		return NULL;
+	}
+	
+	// return the string
+	return iCommandStrings[aCommandID];
+}
+
+
+/****************************************************************************************
+ *
+ * Construction
+ *
+ ***************************************************************************************/
+CExecuteCommand::CExecuteCommand( CSynchronisation *aSync, IOutput *aOutput )
+{
+	// check params
+	assert( aOutput != NULL );
+	assert( aSync != NULL );
+
+	// init vars
+	iSync = aSync;
+	iOutput = aOutput;
+	iLastResult = NULL;
+	iCommandContextSize = 0;
+
+	// create objs
+	iEnvironment = new CDataRecord();
+	assert( iEnvironment != NULL );
+	iServiceManager = new CServiceManager( aOutput );
+	assert( iServiceManager != NULL );
+	iCommandDecoder = new CCommandDecoder( iEnvironment );
+	assert( iCommandDecoder != NULL );
+}
+
+
+CExecuteCommand::~CExecuteCommand()
+{
+	ClearCommandContext();
+	if( iLastResult != NULL ) {
+		delete iLastResult;
+	}
+	delete iCommandDecoder;
+	delete iServiceManager;
+	delete iEnvironment;
+}
+
+
+/****************************************************************************************
+ *
+ * Public Methoid: Execute Command -- parse into (command, argument)
+ *
+ ***************************************************************************************/
+int CExecuteCommand::ExecuteCommand( char *aCommandLine )
+{
+	char *command, *arguments;
+
+	// check the params
+	assert( aCommandLine != NULL );
+
+	// parse the line into (commandPtr, argumentPtr)
+	for( command = aCommandLine, arguments = aCommandLine; NOT_IS_WHITESPACE(*arguments) && (*arguments != 0); arguments++ )
+			;
+
+	// check for no arguments (fine for quit) -- otherwise null the command and set the arg ptr
+	if( *arguments == 0 ) {
+		arguments = NULL;
+	} else {
+		*arguments = 0;
+		arguments++;
+	}
+
+
+	// call the handler
+	return ExecuteCommand( command, arguments );
+}
+
+
+/****************************************************************************************
+ *
+ * Public Method: Execute Command -- deals with contexts and waitfors
+ *
+ ***************************************************************************************/
+int CExecuteCommand::ExecuteCommand( char *aCommand, char *aArgs )
+{
+	int i;
+	int err;
+	int match;
+	TUccsCommand command;
+	CDataRecord *command_arguments;
+
+	// resolve the command
+	for( i = 0; iCommandStrings[i] != NULL; i++ ) {
+		match = strcmp( aCommand, iCommandStrings[i] );
+		if( match == 0 ) {
+			break;
+		}
+	}
+
+	// if no match is found then error
+	if( iCommandStrings[i] == 0 ) {
+		return UCCS_UNKNOWNCOMMAND;
+	}
+	command = (TUccsCommand)i;
+
+	// create a new request record
+	command_arguments = new CDataRecord();
+
+	// create a data object from the argument string
+	err = iCommandDecoder->ParseCommandToRecord(aArgs, command_arguments);
+	if( err != UCCS_OK ) {
+		return err;
+	}
+
+	// if the command is a run command then we clear the context
+	if( command == UC_RUNCMD ) {
+		ClearCommandContext();
+	}
+
+	// add the command to the context
+	AddToCommandContext( command, command_arguments );
+
+	// now execute the command for the first time
+	err = InternalExecuteCommand( command, command_arguments );
+
+	// if the result was NOT UCCS_REPLAYCOMMAND then just return
+	if( err != UCCS_REPLAYCOMMAND ) {
+		return err;
+	}
+
+
+	// NOTE: if we get here then we are asked to replay
+
+	// Run each command in the context again in order. If an error occurs then exit. If someone
+	// asks to wait again then start agani
+	for( i = 0; i < iCommandContextSize; i++ ) {
+		err = InternalExecuteCommand( iCommandContextCommands[i], iCommandContextArgs[i] );
+		if( err == UCCS_REPLAYCOMMAND ) {
+			i = -1;
+			continue;
+		} else if( err != UCCS_OK ) {
+			return err;
+		}
+	}
+
+	// done
+	return UCCS_OK;
+}
+
+/****************************************************************************************
+ *
+ * Public Method: Execute Command -- dispatch commands to appropriate 
+ * handlers
+ *
+ ***************************************************************************************/
+int CExecuteCommand::InternalExecuteCommand( TUccsCommand aCmd, CDataRecord *aArgs )
+{
+	int err;
+
+	// let the output know that we are executing a command
+	if( aCmd != UC_RUNCMD )
+	{
+		iOutput->ExecuteCommand( aCmd, aArgs );
+	}
+
+	// pass the command to the appropriate handler
+	switch( aCmd ) {
+
+	case UC_QUIT:
+		err = UCCS_QUIT;
+		break;
+
+	case UC_RUNCMD:
+		err = HandleRunCmd( aArgs );
+		break;
+
+	case UC_ASSIGN:
+		err = HandleAssignment( aArgs );
+		break;
+
+	case UC_WAITFOR:
+		err = HandleWaitFor( aArgs );
+		break;
+
+	case UC_REQUIRE:
+		err = HandleRequire( aArgs );
+		break;
+
+	case UC_REQUIRENOT:
+		err = HandleRequireNot( aArgs );
+		break;
+
+	case UC_CHECK:
+		err = HandleCheck( aArgs );
+		break;
+
+	case UC_CHECKNOT:
+		err = HandleCheckNot( aArgs );
+		break;
+
+	case UC_WAITFORSIGNAL:
+		err = HandleWaitForSignal( aArgs );
+		break;
+
+	case UC_RENDEZVOUS:
+		err = HandleRendezvous( aArgs );
+		break;
+
+	case UC_PRINTENVIRONMENT:
+		iOutput->DisplayEnvironment( iEnvironment );
+		err = UCCS_OK;
+		break;
+
+	case UC_WAITFORNOT:
+		err = HandleWaitForNot( aArgs );
+		break;
+
+	case UC_SIGNAL:
+		err = HandleSignal( aArgs );
+		break;
+	}
+
+	// output the result
+	iOutput->ExecuteCommandResult( err );
+	
+	// should always get here
+	return err;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleRunCmd
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleRunCmd( CDataRecord *aArgs )
+{
+	int err;
+	CDataRecord *result = NULL;
+
+	// run the command
+	err = iServiceManager->IssueCommand( aArgs, &result );
+	
+	// if the command fails then return the error
+	if( err != UCCS_OK && err != UCCS_ERROR_NONE ) {
+			return err;
+	}
+	assert( result != NULL );
+
+	// otherwise this is success -- let the output know
+	iOutput->ExecuteCommandReply( result );
+
+	// otherwise we clear the previous saved command and result
+	if( iLastResult != NULL ) {
+		delete iLastResult;
+	}
+
+	// now save this command and result
+	iLastResult = result;
+	iCommandDecoder->SetLastReply( iLastResult );
+
+	// done
+	return err;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandlePrintLastCommand
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandlePrintLastCommand( CDataRecord *aArgs )
+{
+	iOutput->DisplayLastCommand( iCommandContextArgs[0] );
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandlePrintLastResult
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandlePrintLastResult( CDataRecord *aArgs )
+{
+	iOutput->DisplayLastReply( iLastResult );
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleAssignment -- allows elements of the reply to be assigned. For
+ * each field (name1, value1) in the passed record we:
+ *
+ *	field_value = reply->GetField( name1 );
+ *	environment->NewField( value1, field_value );
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleAssignment( CDataRecord *aArgs )
+{
+	int err;
+//	char *source_field_name;
+	char *dest_field_name;
+	char *dest_field_value;
+	CDataField *element = NULL;
+
+	// now do the assignment -- first try and update, then a new
+	element = aArgs->GetFirstField();
+	while( element != NULL ) {
+		dest_field_name = element->GetName();
+		dest_field_value = element->GetStrValue();
+		err = iEnvironment->ChangeFieldData( dest_field_name, dest_field_value );
+		if( err == UCCS_FIELDNOTFOUND ) {
+			err = iEnvironment->NewField( dest_field_name, dest_field_value );
+			if( err != UCCS_OK ) {
+				return err;
+			}
+		} else if( err != UCCS_OK ) {
+			return err;
+		}
+		element = aArgs->GetNextField();
+	}
+
+
+	// done
+	return UCCS_OK;
+}
+
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleWaitFor. For each field in the args (namei, valuei)
+ *
+ * rv = reply->GetField(namei);
+ * if( rv != valuei ) 
+ *		repeat the last command with X second wait
+ *
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleWaitFor( CDataRecord *aArgs )
+{
+	char *field_name;
+	char *reference_value;
+	char *actual_value;
+	int err, match;
+	CDataField *element = NULL;
+
+	// make sure there is a previous reply and request
+	if( iLastResult == NULL ) {
+		return UCCS_NORESULT;
+	}
+
+	// now do the waitfor
+	element = aArgs->GetFirstField();
+	while( element != NULL ) {
+
+		field_name = element->GetName();
+		reference_value = element->GetStrValue();
+		err = iLastResult->GetFieldAsString( field_name, &actual_value );
+		if( err != UCCS_OK ) {
+			return err;
+		}
+		match = strcmp( reference_value, actual_value );
+		if( match != 0 ) {
+			Sleep( REPEATCOMMANDWAITPERIOD );
+			return UCCS_REPLAYCOMMAND;
+		}
+
+		element = aArgs->GetNextField();
+	}
+
+	// done
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleWaitForNot. For each field in the args (namei, valuei)
+ *
+ * rv = reply->GetField(namei);
+ * if( rv != valuei ) 
+ *		repeat the last command with X second wait
+ *
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleWaitForNot( CDataRecord *aArgs )
+{
+	char *field_name;
+	char *reference_value;
+	char *actual_value;
+	int err, match;
+	CDataField *element = NULL;
+
+	// make sure there is a previous reply and request
+	if( iLastResult == NULL ) {
+		return UCCS_NORESULT;
+	}
+
+	// now do the waitfornot
+	element = aArgs->GetFirstField();
+	while( element != NULL ) {
+
+		field_name = element->GetName();
+		reference_value = element->GetStrValue();
+		err = iLastResult->GetFieldAsString( field_name, &actual_value );
+		if( err != UCCS_OK ) {
+			return err;
+		}
+		match = strcmp( reference_value, actual_value );
+		if( match == 0 ) {
+			Sleep( REPEATCOMMANDWAITPERIOD );
+			return UCCS_REPLAYCOMMAND;
+		}
+
+		element = aArgs->GetNextField();
+	}
+
+	// done
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleRequire.  
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleRequire( CDataRecord *aArgs )
+{
+	int err, match;
+	char *field_name, *field_value, *actual_value;
+	CDataField *element;
+
+	// make sure there is a previous reply
+	if( iLastResult == NULL ) {
+		return UCCS_NORESULT;
+	}
+
+	// now do the require
+	element = aArgs->GetFirstField();
+	while( element != NULL ) {
+
+		field_name = element->GetName();
+		field_value = element->GetStrValue();
+		err = iLastResult->GetFieldAsString( field_name, &actual_value );
+		if( err != UCCS_OK ) {
+			return UCCS_REQUIREDVALUEERROR;
+		}
+		match = strcmp( actual_value, field_value );
+		if( match != 0 ) {
+			return UCCS_REQUIREDVALUEINCORRECT;
+		}
+
+		element = aArgs->GetNextField();
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleRequireNot.  
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleRequireNot( CDataRecord *aArgs )
+{
+	int err, match;
+	char *field_name, *field_value, *actual_value;
+	CDataField *element;
+
+	// make sure there is a previous reply
+	if( iLastResult == NULL ) {
+		return UCCS_NORESULT;
+	}
+
+	// now do the requirenot
+	element = aArgs->GetFirstField();
+	while( element != NULL ) {
+
+		field_name = element->GetName();
+		field_value = element->GetStrValue();
+		err = iLastResult->GetFieldAsString( field_name, &actual_value );
+		if( err != UCCS_OK ) {
+			return UCCS_REQUIREDNOTVALUEERROR;
+		}
+		match = strcmp( actual_value, field_value );
+		if( match == 0 ) {
+			return UCCS_REQUIREDNOTVALUEMATCH;
+		}
+
+		element = aArgs->GetNextField();
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleCheck.  
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleCheck( CDataRecord *aArgs )
+{
+	int err, match;
+	char *field_name, *field_value, *actual_value;
+	CDataField *element;
+
+	// make sure there is a previous reply
+	if( iLastResult == NULL ) {
+		return UCCS_NORESULT;
+	}
+
+	// now do the check
+	element = aArgs->GetFirstField();
+	while( element != NULL ) {
+
+		field_name = element->GetName();
+		field_value = element->GetStrValue();
+		err = iLastResult->GetFieldAsString( field_name, &actual_value );
+		if( err != UCCS_OK ) {
+			return UCCS_CHECKVALUEERROR;
+		}
+		match = strcmp( actual_value, field_value );
+		if( match != 0 ) {
+			return UCCS_CHECKVALUEINCORRECT;
+		}
+
+		element = aArgs->GetNextField();
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleCheckNot.  
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleCheckNot( CDataRecord *aArgs )
+{
+	int err, match;
+	char *field_name, *field_value, *actual_value;
+	CDataField *element;
+
+	// make sure there is a previous reply
+	if( iLastResult == NULL ) {
+		return UCCS_NORESULT;
+	}
+
+	// now do the checknot
+	element = aArgs->GetFirstField();
+	while( element != NULL ) {
+
+		field_name = element->GetName();
+		field_value = element->GetStrValue();
+		err = iLastResult->GetFieldAsString( field_name, &actual_value );
+		if( err != UCCS_OK ) {
+			return UCCS_CHECKNOTVALUEERROR;
+		}
+		match = strcmp( actual_value, field_value );
+		if( match == 0 ) {
+			return UCCS_CHECKNOTVALUEMATCH;
+		}
+
+		element = aArgs->GetNextField();
+	}
+	return UCCS_OK;
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleWaitForSignal.  
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleWaitForSignal( CDataRecord *aArgs )
+{
+	return iSync->WaitFromScript();
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleSignal.  
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleSignal( CDataRecord *aArgs )
+{
+	return iSync->SignalFromScript();
+}
+
+
+/****************************************************************************************
+ *
+ * Private Method: HandleRendezvous.  
+ *
+ ***************************************************************************************/
+int CExecuteCommand::HandleRendezvous( CDataRecord *aArgs )
+{
+	return iSync->RendezvousFromScript();
+}
+
+
+/****************************************************************************************
+ *
+ * PRIVATE METHODS: Manage the command contexts
+ *
+ ***************************************************************************************/
+void CExecuteCommand::ClearCommandContext()
+{
+	int i;
+	for( i = 0; i <iCommandContextSize; i++ ) {
+		assert( iCommandContextArgs[i] != NULL );
+		delete iCommandContextArgs[i];
+		iCommandContextArgs[i] = NULL;
+	}
+	iCommandContextSize = 0;
+}
+
+
+void CExecuteCommand::AddToCommandContext( TUccsCommand aCommand, CDataRecord *aRec )
+{
+	assert( aRec != NULL );
+	assert( iCommandContextSize < MAXRECENTCOMMANDS );
+	iCommandContextCommands[iCommandContextSize] = aCommand;
+	iCommandContextArgs[iCommandContextSize++] = aRec;
+}
+
+
+/****************************************************************************************
+ *
+ * PUBLIC METHODS: To get the value of an varible in the environment
+ *
+ ***************************************************************************************/
+int CExecuteCommand::GetEnvironmentVariable ( char *aVariableName, char *aOutputBuffer, int aOutputBufferSize )
+{
+	int ret, len;
+	char* fieldValue;
+
+	// Check params
+	assert ( aVariableName != NULL );
+	assert ( aOutputBuffer != NULL );
+	assert ( aOutputBufferSize > 0 );
+
+	// If there is nothing in the environment then return that env var not found Error
+	if ( iEnvironment == NULL )
+		return UCCS_NOENVIRONMENT;
+
+	// Query the environment for this variable name
+	ret = iEnvironment->GetFieldAsString( aVariableName, &fieldValue );
+	assert ( (ret == UCCS_OK) || (ret == UCCS_FIELDNOTFOUND) ); 
+	if( ret == UCCS_FIELDNOTFOUND ) 
+		return UCCS_VARIABLEDOESNOTEXIST;
+
+	// Now copy the fieldValue returned into the return output buffer
+	// First check we have sufficient memory to hold the value in the return buffer
+	len = strlen (fieldValue) + 1;
+
+	if ( len > aOutputBufferSize )
+		return UCCS_VARIABLEVALTOOLONG;
+
+	// Else we copy the data
+	memcpy( aOutputBuffer, fieldValue, len );
+
+	return UCCS_OK;
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CExecuteCommand.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* UCCS_CExecuteCommand - Executes commands on the service manager. Maintains the 
+* intercommand logic.
+*
+*/
+
+
+
+#ifndef __CEXECUTECOMMAND_H__
+#define __CEXECUTECOMMAND_H__
+
+
+/****************************************************************************************
+ *
+ * Local Includes
+ *
+ ***************************************************************************************/
+#include "UCCS_CServMgr.h"
+#include "UCCS_CCommandDecoder.h"
+#include "UCCS_CDataRecord.h"
+#include "CSynchronisation.h"
+
+/****************************************************************************************
+ *
+ * Definitions
+ *
+ ***************************************************************************************/
+#define MAXRECENTCOMMANDS 256
+
+/****************************************************************************************
+ *
+ * Types
+ *
+ ***************************************************************************************/
+
+/****************************************************************************************
+ *
+ * Prototypes
+ *
+ ***************************************************************************************/
+const char *GetScriptCommandString( int aCommandID );
+
+/****************************************************************************************
+ *
+ * CExecuteCommand
+ *
+ ***************************************************************************************/
+class CExecuteCommand
+{
+public:
+	CExecuteCommand( CSynchronisation *aSync, IOutput *aOutput );
+	~CExecuteCommand();
+	int ExecuteCommand( char *aCommandLine );
+	int GetEnvironmentVariable ( char *aVariableName, char *aOutputBuffer, int aOutputBufferSize );
+
+private:
+	int ExecuteCommand( char *aCommand, char *aArgs );
+	int InternalExecuteCommand( TUccsCommand aCmd, CDataRecord *aArgs );
+
+	int HandleHelp( CDataRecord *aArgs );
+	int HandleRunCmd( CDataRecord *aArgs );
+	int HandlePrintLastCommand( CDataRecord *aArgs );
+	int HandlePrintLastResult( CDataRecord *aArgs );
+	int HandleAssignment( CDataRecord *aArgs );
+	int HandleWaitFor( CDataRecord *aArgs );
+	int HandleWaitForNot( CDataRecord *aArgs );
+	int HandleRequire( CDataRecord *aArgs );
+	int HandleRequireNot( CDataRecord *aArgs );
+	int HandleCheck( CDataRecord *aArgs );
+	int HandleCheckNot( CDataRecord *aArgs );
+	int HandleWaitForSignal( CDataRecord *aArgs );
+	int HandleSignal( CDataRecord *aArgs );
+	int HandleRendezvous( CDataRecord *aArgs );
+	int HandleReset( CDataRecord *aArgs );
+	int HandleResetAll( CDataRecord *aArgs );
+
+	void AddToCommandContext( TUccsCommand aCommand, CDataRecord *aRec );
+	void ClearCommandContext();
+
+	CCommandDecoder *iCommandDecoder;
+	CServiceManager *iServiceManager;
+
+	TUccsCommand iCommandContextCommands[MAXRECENTCOMMANDS];
+	CDataRecord *iCommandContextArgs[MAXRECENTCOMMANDS];
+	int iCommandContextSize;
+	CDataRecord *iLastResult;
+	CDataRecord *iEnvironment;
+	IOutput *iOutput;
+	CSynchronisation *iSync;
+};
+
+#endif //__CEXECUTECOMMAND_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CServMgr.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,507 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCSServMgr.cpp
+* System Includes
+*
+*/
+
+
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "strncpynt.h"
+#include "UCCS_CServMgr.h"
+#include "UCCS_ErrorCodes.h"
+#include "UCCS_ServiceValues.h"
+#include "../ServiceStubs/Mobster.v2/CMobsterStub.h"
+#include "../ServiceStubs/Internal/CInternalStub.h"
+#include "../ServiceStubs/Ppp/CPppControllerStub.h"
+#include "../ServiceStubs/HostExecute/CHostExecuteStub.h"
+#include "../ServiceStubs/UuInterface/CUuinterfaceStub.h"
+#include "../ServiceStubs/MobileAgent/CMobileAgentServiceStub.h"
+#include "../ServiceStubs/ForeignAgent/CForeignAgentServiceStub.h"
+#include "../ServiceStubs/HomeAgent/CHomeAgentServiceStub.h"
+#include "../ServiceStubs/HostExecuteAsync/CHostExecuteAsyncStub.h"
+#include "../ServiceStubs/Test/CTestStub.h"
+//#include "..\ServiceStubs\TestService\CTestServiceStub.h"
+#include "../ServiceStubs/GPSSimulator/CAPICommandHandlerStub.h"
+#include "../ServiceStubs/GenericStub/CGenericStub.h"
+//#include "..\..\include\penstd.h"
+#include "CUCCIniFile.h"
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define UCC_INI_FILE	".\\UCC.ini"
+#define SERVICE_INI		"ini"
+#define SERVICE_HOST	"host"
+
+#define STARTUP_GENERIC_SERVICE_STUB(rpcid,ini,servicename) \
+			service = iServiceList[localserviceindex] = new CGenericStub(ini,servicename);	\
+			assert( service != NULL );														\
+			localerror = remoteerror = 0;													\
+			rv = service->StartUccsService( aServiceHost, &localerror, &remoteerror );		\
+			if( rv != 0 ) {																	\
+				delete iServiceList[localserviceindex];										\
+				iServiceList[localserviceindex] = NULL;										\
+			} else {																		\
+				strcpy( iServiceDescTable[localserviceindex].iHostname, aServiceHost );		\
+				iServiceDescTable[localserviceindex].iServiceID = rpcid;					\
+			}																				\
+			break;																
+
+#define STARTUP_SERVICE_STUB(rpcid,classname) \
+			service = iServiceList[localserviceindex] = new classname();	\
+			assert( service != NULL );													\
+			localerror = remoteerror = 0;												\
+			rv = service->StartUccsService( aServiceHost, &localerror, &remoteerror );	\
+			if( rv != 0 ) {																\
+				delete iServiceList[localserviceindex];									\
+				iServiceList[localserviceindex] = NULL;									\
+			} else {																	\
+				strcpy( iServiceDescTable[localserviceindex].iHostname, aServiceHost );	\
+				iServiceDescTable[localserviceindex].iServiceID = rpcid;				\
+			}
+
+#define STARTUP_SERVICE_STUB_CASE(rpcid,classname)	case rpcid: \
+			STARTUP_SERVICE_STUB(rpcid, classname);				\
+			break;																
+
+#define SHUTDOWN_SERVICE_STUB(rpcid,classname) \
+			delete ((classname*)(iServiceList[aLocalServiceID]));		\
+			iServiceList[aLocalServiceID] = NULL;						\
+			iServiceDescTable[aLocalServiceID].iHostname[0] = 0;		\
+			iServiceDescTable[aLocalServiceID].iServiceID = RPCSVC_INVALID;
+
+#define SHUTDOWN_SERVICE_STUB_CASE(rpcid,classname)		case rpcid:			\
+			SHUTDOWN_SERVICE_STUB(rpcid, classname);						\
+			break;
+
+/***********************************************************************************
+ *
+ * Construction 
+ *
+ **********************************************************************************/
+CServiceManager::CServiceManager( IOutput *aOutput )
+	: iNumGenericServices(0)
+{
+	// verify the params
+	assert( aOutput != NULL );
+	iOutput = aOutput;
+
+	// initialise the service list
+	for( int i = 0; i <= MAXSERVICES; i++ ) {
+		iServiceList[i] = NULL;
+	}
+
+	// *** This need refactoring into a private method ***
+	// Open the ucc.ini file
+	CUCCIniFile iniFile(UCC_INI_FILE);
+	vector<string> sections = iniFile.SectionNames();
+
+	// Check to see if there are any sections defined
+	iNumGenericServices = sections.size();
+	if( iNumGenericServices > 0 && iNumGenericServices<(MAXSERVICES-RPCSVC_LAST) )
+	{
+		for( int i=0 ; i<iNumGenericServices ; i++ )
+		{
+			// *** No error checking currently ***
+
+			// Set the service IID to the next available one
+			iGenericServices[i].iServiceID = RPCSVC_LAST+i;
+
+			// Set the service name to the section name
+			strcpy( iGenericServices[i].iServiceName, sections[i].c_str() );
+
+			// Retrieve the ini file location
+			string service_ini;
+			bool ret = iniFile.KeyValue(SERVICE_INI, sections[i].c_str(), service_ini);
+			assert( ret == true );
+			assert( service_ini.size() > 0 );
+			strcpy( iGenericServices[i].iIniFile, service_ini.c_str() );
+
+			// Retrieve the host name/ip address
+			string host;
+			ret = iniFile.KeyValue(SERVICE_HOST, sections[i].c_str(), host);
+			assert( ret == true );
+			assert( host.size() > 0 );
+			strcpy( iGenericServices[i].iHost, host.c_str() );
+		}
+	}
+}
+
+
+/***********************************************************************************
+ *
+ * Destruction
+ *
+ **********************************************************************************/
+CServiceManager::~CServiceManager()
+{
+	// shutdown all loaded services -- log any errors
+	ShutdownAll();
+
+	// verify all services are stopped (or trying to connect)
+	for( int i = 0; i < MAXSERVICES; i++ ) {
+		assert( (iServiceList[i] == NULL) || (iServiceDescTable[i].iServiceID == RPCSVC_INVALID) );
+	}
+}
+
+
+/***********************************************************************************
+ *
+ * ShutdownAll - Close the connections to all services
+ *
+ **********************************************************************************/
+int CServiceManager::ShutdownAll()
+{
+	int localserviceindex = 0;
+
+	//check each service and if it is alive then stop it
+	for( localserviceindex = 0; localserviceindex < MAXSERVICES; localserviceindex++ ) {
+		if( iServiceList[localserviceindex] != NULL ) {
+			LocalStopService( localserviceindex );
+		}
+	}
+	return UCCS_OK;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: ResetService -- resets a service by starting then stopping it
+ *
+ **********************************************************************************/
+int CServiceManager::ResetService( int aServiceID, char *aHostname )
+{
+	assert( !"Method withdrawn" );
+	return 0;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: ResetAllServices -- resets all the services in the oldservices
+ * list
+ *
+ **********************************************************************************/
+int CServiceManager::ResetAllServices()
+{
+	assert( !"Method withdrawn" );
+	return 0;
+}
+
+
+/***********************************************************************************
+ *
+ * PUBLIC METHOD: IssueCommand -- sends the command to the appropriate service
+ *
+ **********************************************************************************/
+int CServiceManager::IssueCommand( CDataRecord* aRequestRecord, CDataRecord** aReturnedDataRecord )
+{
+	int returncode = ERR_NONE;
+	int service_id;
+	int err;
+	int service_index;
+	char *service_name;
+	char *service_host;
+	IService *service = NULL;
+
+	// ensure that the passed buffer is set to NULL
+	assert( *aReturnedDataRecord == NULL );
+
+
+	// Look for the service name initially
+	//   if the name doesn't exist then revert to the legacy method
+	err = aRequestRecord->GetFieldAsString( "SVCNAME", &service_name );
+	if( err == UCCS_OK ) {
+		// If a generic service is being used then retrieve the 
+		// service id and service name from the generic services list.
+		bool found = false;
+		for( int i=0; i<iNumGenericServices; i++ )
+		{
+			if( strcmp(iGenericServices[i].iServiceName, service_name) == 0 )
+			{
+				service_id = iGenericServices[i].iServiceID;
+				service_host = iGenericServices[i].iHost;
+				found = true;
+				break;
+			}
+		}
+        if (!found)
+            return UCCS_NO_MATCHING_GENERIC_SERVICE_FOUND;
+	}
+	else
+	{
+		// retrieve the service id for the request 
+		err = aRequestRecord->GetFieldAsInt( "SVCID", &service_id );
+		if( err != UCCS_OK ) {
+			return UCCS_NOSERVICEID;
+		}
+
+		// verify that this is a valid service id 
+		if( (service_id <= RPCSVC_INVALID) || (service_id >= RPCSVC_LAST+iNumGenericServices) ) {
+			return UCCS_INVALIDSERVICEID;
+		}
+
+		// retrieve the hostname for the request
+		err = aRequestRecord->GetFieldAsString( "SVCHOST", &service_host ); 
+		if( err != UCCS_OK ) {
+			return UCCS_NOSERVICEHOST;
+		}
+	}
+
+	// execute command
+    // - performed within a loop to provide for a retry mechanism (eg. after new RPC connetion established)
+    for (int i=0; i < 2; i++)
+    {
+	    service_index = GetLocalServiceIndex( service_id, service_host );
+	    if( service_index == -1 )
+        {
+            // start service (RPC connect)
+		    err = LocalStartService(service_id, service_host);
+		    if (err != UCCS_OK) 
+			    return err;
+    	    service_index = GetLocalServiceIndex( service_id, service_host );
+	    }
+
+	    // get a pointer to the service 
+	    assert( service_index != -1 );	
+	    service = iServiceList[service_index];
+	    assert( service != NULL );	
+
+	    // now issue the command to the service
+	    *aReturnedDataRecord = service->IssueCommand( aRequestRecord );
+
+	    // Check the completion code and result
+	    int completion_code = ERR_NONE;
+	    err = (*aReturnedDataRecord)->GetFieldAsInt( STD_REPLY_FIELD_REQUESTCOMPLETIONCODE, &completion_code );
+	    if( err == UCCS_OK )
+	    {
+		    // If the completion code is ok, check the call result
+		    if( completion_code == ERR_NONE )
+		    {
+			    int call_result = ERR_NONE;
+			    err = (*aReturnedDataRecord)->GetFieldAsInt( "RESULT", &call_result );
+			    if( err == UCCS_OK )
+			    {
+				    returncode = call_result;
+                    break;  // no need to retry since it worked (either first or second time)
+			    }
+		    }
+		    else
+		    {
+			    returncode = completion_code;
+                err = LocalStopService(service_index);
+		    }
+	    }
+    } // for loop
+
+	return returncode;
+}
+
+
+/***********************************************************************************
+ *
+ * PRIVATE METHOD: StartService - creates and starts up a service. The passed id
+ * must map to an entry in the service table which stores the RPC service and 
+ * the host that the service is targetted at. 
+ *
+ **********************************************************************************/
+int CServiceManager::LocalStartService( int aServiceID, char *aServiceHost )
+{
+	int rv;
+	int i;
+	int localerror = 0;
+	int remoteerror = 0;
+	int localserviceindex = -1;
+	IService *service;
+
+	// look for a free index in the service table
+	for( i = 0; i < MAXSERVICES; i++ ) {
+		if( iServiceList[i] == NULL ) {
+			localserviceindex = i;
+			break;
+		}
+	}
+
+	// check that a slot was found
+	if( localserviceindex == -1 ) {
+		return UCCS_SERVICELISTFULL;
+	}
+	
+	// startup each legacy service
+	switch( aServiceID ) {
+
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_HOMEAGENT,		CHomeAgentServiceStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_FOREIGNAGENT,		CForeignAgentServiceStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_MOBILEAGENT,		CMobileAgentServiceStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_MOBSTER,			CMobsterServiceStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_UUINTERFACE,		CUuinterfaceStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_HOSTEXECUTE,		CHostExecuteStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_PPPCONTROLLER,	CPppControllerServiceStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_INTERNAL,			CInternalStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_HOSTEXECUTEASYNC,	CHostExecuteAsyncStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_TEST,				CTestStub );
+	STARTUP_SERVICE_STUB_CASE( RPCSVC_GPSSIMULATOR,		CAPICommandHandlerStub );
+
+	default:
+		{
+			// Check to see if it is a generic service stub
+			if( (aServiceID >= RPCSVC_LAST) &&
+				(aServiceID <= RPCSVC_LAST+iNumGenericServices) )
+			{
+				STARTUP_GENERIC_SERVICE_STUB(	(TRpcServiceID)aServiceID,
+												iGenericServices[aServiceID-RPCSVC_LAST].iIniFile,
+												iGenericServices[aServiceID-RPCSVC_LAST].iServiceName);
+			}
+			else
+			{
+				rv = ERR_INVALID_SERVICE;
+			}
+		}
+		break;
+	}
+
+	// update the status
+	iOutput->StartServiceResult( aServiceID, aServiceHost, rv, localerror, 0 );
+	return ((rv == ERR_NONE) ? UCCS_OK : UCCS_CANTSTARTSERVICE );
+}
+
+
+/***********************************************************************************
+ *
+ * PRIVATE METHOD: StopService - destroys the service object
+ *
+ **********************************************************************************/
+int CServiceManager::LocalStopService( int aLocalServiceID )
+{
+	int err;
+	int localerror;
+	int remoteerror;
+	TServiceTableEntry this_entry;
+
+	// check parameters
+	assert( (aLocalServiceID >= 0) && (aLocalServiceID < MAXSERVICES) );
+	localerror = remoteerror = 0;
+
+
+	// get the service
+	if( iServiceList[aLocalServiceID] == NULL ) {
+		return UCCS_INVALIDSERVICEINDEX;
+	}
+
+	// save this entry in-case 
+	this_entry.iServiceID = iServiceDescTable[aLocalServiceID].iServiceID;
+	STRNCPY_NULL_TERMINATE( this_entry.iHostname, iServiceDescTable[aLocalServiceID].iHostname, MAXHOSTNAME );
+
+	// stop the service and log the result
+	err = (iServiceList[aLocalServiceID])->StopUccsService( &localerror, &remoteerror );
+
+	// regardless of success we still want to destroy the object
+	switch( iServiceDescTable[aLocalServiceID].iServiceID ) {
+
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_HOMEAGENT,			CHomeAgentServiceStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_FOREIGNAGENT,		CForeignAgentServiceStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_MOBILEAGENT,			CMobileAgentServiceStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_MOBSTER,				CMobsterServiceStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_UUINTERFACE,			CUuinterfaceStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_HOSTEXECUTE,			CHostExecuteStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_PPPCONTROLLER,		CPppControllerServiceStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_INTERNAL,			CInternalStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_HOSTEXECUTEASYNC,	CHostExecuteAsyncStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_TEST,				CTestStub );
+	SHUTDOWN_SERVICE_STUB_CASE( RPCSVC_GPSSIMULATOR,		CAPICommandHandlerStub );
+
+	// this means that the other thread is trying to connect to the service as 
+	// we speak - if we just ignore this then it should be ok?
+	case RPCSVC_INVALID:
+		break;
+
+	default:
+		{
+			// Check to see if it is a generic service stub
+			if( (iServiceDescTable[aLocalServiceID].iServiceID >= RPCSVC_LAST) &&
+				(iServiceDescTable[aLocalServiceID].iServiceID <= RPCSVC_LAST+iNumGenericServices) )
+			{
+				SHUTDOWN_SERVICE_STUB( iServiceDescTable[aLocalServiceID].iServiceID, CGenericStub );
+			}
+			else
+			{
+				assert( !"INVALID CODE PATH" );
+			}
+		}
+		break;
+	}
+
+	// update the status
+	iOutput->StopServiceResult( this_entry.iServiceID, this_entry.iHostname, err, localerror, remoteerror );
+	return ((err == ERR_NONE) ? UCCS_OK : UCCS_CANTSTOPSERVICE );
+}
+
+
+/***********************************************************************************
+ *
+ * PRIVATE METHOD: GetLocalServiceIndex 
+ *
+ **********************************************************************************/
+int CServiceManager::GetLocalServiceIndex( int aServiceID, char *aServiceHost )
+{
+	int i;
+	int match;
+
+	// check params
+	assert( aServiceHost != NULL );
+	assert( (aServiceID > RPCSVC_INVALID) && (aServiceID < RPCSVC_LAST+iNumGenericServices) );
+
+	// now look for a match
+	for( i = 0; i < MAXSERVICES; i++ ) {
+
+		// make sure this index is active
+		if( iServiceList[i] == NULL ) {
+			continue;
+		}
+
+		// try and match
+		if( aServiceID != iServiceDescTable[i].iServiceID ) {
+			continue;
+		}
+		match = strcmp( iServiceDescTable[i].iHostname, aServiceHost );
+		if( match != 0 ) {
+			continue;
+		}
+
+		// we have a match
+		return i;
+	}
+
+	// done -- failed
+	return -1;
+}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CServMgr.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCSServMgr.h
+*
+*/
+
+
+
+#ifndef __UCCSSERVICEMANAGER_H__
+#define __UCCSSERVICEMANAGER_H__
+
+/***********************************************************************************
+ *
+ * Local Includes
+ *
+ **********************************************************************************/
+#include "UCCS_CDataRecord.h"
+#include "UCCS_Interfaces.h"
+#include "UCCS_ServiceValues.h"
+
+/***********************************************************************************
+ *
+ * Definition
+ *
+ **********************************************************************************/
+#define MAXSERVICES			128
+#define MAXHOSTNAME			256
+#define MAXINIPATH			1024
+#define MAXSERVICENAME		256
+
+/***********************************************************************************
+ *
+ * Types
+ *
+ **********************************************************************************/
+typedef struct 
+{
+	TRpcServiceID	iServiceID;
+	char			iHostname[MAXHOSTNAME];
+} TServiceTableEntry;
+
+typedef struct 
+{
+	int		iServiceID;
+	char	iServiceName[MAXSERVICENAME];
+	char	iIniFile[MAXINIPATH];
+	char	iHost[MAXHOSTNAME];
+} TGenericService;
+
+
+//----------------------------------------------------------------------------------
+//
+// Class used to communicate with the stub interfaces.
+// Class uses same methods as IService but methods here also have a service ID to use.
+//
+class CServiceManager
+{
+	public:
+
+		//constructor/destructor
+		CServiceManager( IOutput *aOutput );
+		~CServiceManager();
+		int ShutdownAll();
+		
+		// duplicated interface method - the only one to be seen from outside at this level
+		int IssueCommand(CDataRecord* aDataRecord, CDataRecord** aReturnedDataRecord);
+
+		// reset a service
+		int ResetService( int aServiceID, char *aHostname );
+		int ResetAllServices();
+
+	private:
+
+		// get the local service index
+		int GetLocalServiceIndex( int aServiceID, char *aServiceHost );
+
+		// duplicated interface methods used to dumultiplex for the higher layers
+		int LocalStartService( int aServiceID, char *aServiceHost );
+		int LocalStopService( int aLocalServiceIndex );
+		
+		//defines interface pointers to the service handlers
+		IService *iServiceList[MAXSERVICES];	
+		TServiceTableEntry iServiceDescTable[MAXSERVICES];
+		IOutput *iOutput;
+
+		// GenericStub Service id's
+		int iNumGenericServices;
+		TGenericService iGenericServices[MAXSERVICES];
+};
+
+//----------------------------------------------------------------------------------
+#endif __UCCSSERVICEMANAGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ErrorCodes.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* UCCS_ErrorCodes.cpp -- provides a function that translates error codes into
+* a string description.
+* System Includes
+* Local Includes
+*
+*/
+
+
+
+#include "UCCS_ErrorCodes.h"
+#include "../../include/penstd.h"
+
+
+/********************************************************************************
+ *
+ * GetPenstdErrorString()
+ *
+ ********************************************************************************/
+char *GetPenstdErrorString( int aErrorCode )
+
+{
+	switch( aErrorCode ) {
+	case ERR_NONE:
+		return "success";
+	case ERR_INVALID_ERROR_CODE:
+		return "THIS IS AN INVALID ERROR CODE";
+	case ERR_MISSING_PARAMETER:
+		return "there is a missing parameter";
+	case ERR_SERVICE_ALREADY_STARTED:
+		return "service already started";
+	case ERR_SERVICE_NOT_RUNNING:
+		return "service not running";
+	case ERR_ACTIVE_USER_SESSIONS:
+		return "active user sessions exist";
+	case ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS:
+		return "failed to remove active user sessions";
+	case ERR_FAILED_TO_CREATE_COMPONENT_MANAGER:
+		return "failed to create the component manager";
+	case ERR_FAILED_TO_RETRIEVE_KEY:
+		return "failed to retrieve the instance key from the arguments";
+	case ERR_INSTANCE_DOES_NOT_EXIST:
+		return "instance does not exist";
+	case ERR_INVALID_METHOD:
+		return "invalid method";
+	case ERR_CANNOT_CREATE_NEW_INSTANCE:
+		return "can't create a new instance";
+	case ERR_STUB_ALREADY_CONNECTED:
+		return "stub already connected to the service";
+	case ERR_FAILED_TO_CONNECT:
+		return "failed to connect to the service";
+	case ERR_STUB_NOT_CONNECTED:
+		return "stub not connected to a service";
+	case ERR_INVALID_RV_POINTER:
+		return "invalid rv pointer";
+	case ERR_RPC_ERROR:
+		return "rpc error";
+	case ERR_INVALID_SERVICE:
+		return "invalid service";
+	case ERR_INVALIDARG:
+		return "invalid argument";
+	case ERR_INVALIDSTATE:
+		return "invalid state";
+	case ERR_GENERAL:
+		return "general error";
+	case ERR_INVALID_CALL:
+		return "invalid call";
+	default:
+		return "(unknown error)";
+	}
+	return "(unknown error)";
+}
+
+
+/********************************************************************************
+ *
+ * GetUccsErrorString()
+ *
+ ********************************************************************************/
+char *GetUccsErrorString( TUCCSErrors aErrorCode )
+{
+	switch( aErrorCode ) {
+
+	// Script and BatchEngine Errors
+	case UCCS_OK:
+		return "Success";
+	case UCCS_SERVICELISTFULL:
+		return "The maximum number of services have already been started";
+    case UCCS_NO_MATCHING_GENERIC_SERVICE_FOUND:
+		return "No matching generic service found.  Please check spelling against service defined in ucc.ini";
+	case UCCS_NOSERVICEID:
+		return "The command must specify the target service (SVCID)";
+	case UCCS_INVALIDSERVICEID:
+		return "The specified target service (SVCID) is invalid";
+	case UCCS_CANTSTARTSERVICE:
+		return "Failed to connect to the service";
+	case UCCS_CANTSTOPSERVICE:
+		return "Failed to stop the service";
+	case UCCS_NOSERVICEHOST:
+		return "The command must specify the hostname of the target service (SVCHOST)";
+	case UCCS_INVALIDSERVICEINDEX:
+		return "INTERNAL_ERROR_CODE: UCCS_INVALIDSERVICEINDEX";
+	case UCCS_PARSERFAILEDTOSTOREVALUE:
+		return "An error occured while parsing the script command";
+	case UCCS_UNKNOWNCOMMAND:
+		return "This is not a known command";
+	case UCCS_REPLAYCOMMAND:
+		return "INTERNAL_ERROR_CODE: UCCS_REPLAYCOMMAND";
+	case UCCS_NORESULT:
+		return "No commands (runcmd) have been completed, therefore there is no result to check/waitfor";
+	case UCCS_QUIT:
+		return "INTERNAL_ERROR_CODE: UCCS_QUIT";
+	case UCCS_REQUIREDVALUEERROR:
+		return "Some of the required fields do not exist";
+	case UCCS_REQUIREDVALUEINCORRECT:
+		return "Some of the required field values do not match those returned";
+	case UCCS_REQUIREDNOTVALUEERROR:
+		return "Some of the required (not) fields do not exist";
+	case UCCS_REQUIREDNOTVALUEMATCH:
+		return "Some of the required (not) field values match those returned";
+	case UCCS_CHECKVALUEERROR:
+		return "Some of the check fields do not exist";
+	case UCCS_CHECKVALUEINCORRECT:
+		return "Some of the check field values do not match those returned";
+	case UCCS_CHECKNOTVALUEERROR:
+		return "Some of the check (not) fields do not exist";
+	case UCCS_CHECKNOTVALUEMATCH:
+		return "Some of the check (not) field values match those returned";
+	case UCCS_FIELDNOTFOUND:
+		return "An expected record field was not found";
+	case UCCS_SYSTEMERROR:
+		return "An system call has failed";
+	case UCCS_RECORDFULL:
+		return "The record is full";
+	case UCCS_NOMORECOMMANDS:
+		return "INTERNAL_ERROR: UCCS_NOMORECOMMANDS";
+	case UCCS_UNKNOWNCONTROLCOMMAND:
+		return "An unknown control command was received";
+	case UCCS_CLIENT_ERROR:
+		return "The client failed to execute the command";
+
+	// Control Command Errors
+	case UCCS_ALREADYSTARTEDUSECASE:
+		return "There is already an active use-case";
+	case UCCS_NOUSECASERUNNING:
+		return "There is no use-case active";
+	case UCCS_FAILEDTOCREATEEXECUTETHREAD:
+		return "SYSTEM_ERROR: The controller couldn't create a thread to execute the script";
+	case UCCS_COMMANDEXECUTIONNOTSTARTEDYET:
+		return "A use-case is being initialised";
+	case UCCS_SCRIPTFINISHED:
+		return "The active use-case script has completed";
+	case UCCS_CANTOPENSCRIPTFILE:
+		return "Failed to open the requested use-case script file";
+	case UCCS_CANTOPENOUTPUTFILE:
+		return "Failed to open the output files";
+	case UCCS_VARIABLEVALTOOLONG:
+		return "The buffer supplied to GetEnvironmentVariable is too small to hold the requested value";
+	case UCCS_VARIABLEDOESNOTEXIST:
+		return "The requested field does not exist in the current environment";
+	case UCCS_NOENVIRONMENT:
+		return "INTERNAL_ERROR: UCCS_NOENVIRONMENT";
+
+	// Other
+	case UCCS_LAST:
+		return "INTERNAL_ERROR: UCCS_LAST";
+	default:
+		// check for penstd error values
+		// - not sure if they are intended to come through as UCCS errors, but alas they do anyway
+		//   eg. -17 = missing param --> re-producible by having a mismatch in paramaeter names
+		return GetPenstdErrorString(aErrorCode);
+	}	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ErrorCodes.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_ErrorCodes.h
+*
+*/
+
+
+
+#ifndef __UCCSCERRORCODES_H__
+#define __UCCSCERRORCODES_H__
+
+
+/***********************************************************************************
+ *
+ * Types
+ *
+ **********************************************************************************/
+typedef enum {
+	UCCS_ERROR_NONE			= 0, // This is returned from the new services for no error
+	UCCS_OK					= 100,
+
+	// (2a) Returned by Invoke -- and then in turn by the execute command (IOutput::Error)
+	UCCS_SERVICELISTFULL = -300,					
+	UCCS_NOSERVICEID,
+	UCCS_INVALIDSERVICEID,					
+	UCCS_CANTSTARTSERVICE,
+	UCCS_CANTSTOPSERVICE,
+	UCCS_NOSERVICEHOST,
+	UCCS_INVALIDSERVICEINDEX,				
+    UCCS_NO_MATCHING_GENERIC_SERVICE_FOUND,
+
+	// (2b) Returned by ParseCommand -- and then in turn by the execute command (IOutput::Error)
+	UCCS_PARSERFAILEDTOSTOREVALUE,
+
+	// (2c) Returned by Execute Command (IOutput::Error)
+	UCCS_UNKNOWNCOMMAND,
+	UCCS_REPLAYCOMMAND,
+	UCCS_NORESULT,
+	UCCS_QUIT,
+	UCCS_REQUIREDVALUEERROR,
+	UCCS_REQUIREDVALUEINCORRECT,		
+	UCCS_REQUIREDNOTVALUEERROR,
+	UCCS_REQUIREDNOTVALUEMATCH,
+	UCCS_CHECKVALUEERROR,
+	UCCS_CHECKVALUEINCORRECT,
+	UCCS_CHECKNOTVALUEERROR,			
+	UCCS_CHECKNOTVALUEMATCH,
+
+	// (2d) Returned from other classes that eventually get returned by execute command
+	UCCS_FIELDNOTFOUND,
+	UCCS_SYSTEMERROR,
+	UCCS_RECORDFULL,
+	UCCS_NOMORECOMMANDS,				
+
+	// (2e) Errors that are only used direct to IOutput
+	UCCS_UNKNOWNCONTROLCOMMAND,
+	UCCS_CLIENT_ERROR,
+
+	// (3a) Errors returned to the control commands directly from CBatchEngine
+	UCCS_ALREADYSTARTEDUSECASE,
+	UCCS_NOUSECASERUNNING,
+	UCCS_FAILEDTOCREATEEXECUTETHREAD,
+	UCCS_COMMANDEXECUTIONNOTSTARTEDYET,
+	UCCS_SCRIPTFINISHED,
+
+	// (3b) Errors returned from other classes that eventually get returned to control commands
+	UCCS_CANTOPENSCRIPTFILE,
+	UCCS_CANTOPENOUTPUTFILE,				
+	UCCS_VARIABLEVALTOOLONG,
+	UCCS_VARIABLEDOESNOTEXIST,
+	UCCS_NOENVIRONMENT,
+
+	// (4) End
+	UCCS_LAST							
+} TUCCSErrors;
+
+
+/***********************************************************************************
+ *
+ * Definitions
+ *
+ **********************************************************************************/
+#define GetUccsErrorStringI(x)	GetUccsErrorString((TUCCSErrors)(x))
+
+
+/***********************************************************************************
+ *
+ * Prototypes
+ *
+ **********************************************************************************/
+char *GetUccsErrorString( TUCCSErrors aErrorCode );
+char *GetPenstdErrorString( int aErrorCode );
+
+
+#endif __UCCSCERRORCODES_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_Interfaces.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_Interfaces.h
+* Service interfaces
+*
+*/
+
+
+
+#ifndef __UCCSINTERFACES_H__
+#define __UCCSINTERFACES_H__
+
+
+/*************************************************************************************
+ *
+ * Local Includes
+ *
+ ************************************************************************************/
+#include "UCCS_CDataRecord.h"
+#include "../DeviceControlChannel/CommandControlErrors.h"
+
+
+/*************************************************************************************
+ *
+ * IRetrieveCommand - interface on the command retriever called by the batch engine
+ *
+ ************************************************************************************/
+class IRetrieveCommand
+{
+public:
+	virtual int StartUseCase( int aUsecaseID ) = 0;
+	virtual int EndUseCase() = 0;
+	virtual int GetNextCommand( char *aBuffer, int aLength ) = 0;
+};
+
+
+
+/*************************************************************************************
+ *
+ * IOutput - interface on the output object called by everyone
+ *
+ ************************************************************************************/
+typedef enum {
+	UC_INVALID,
+	UC_QUIT,
+	UC_RUNCMD,
+	UC_ASSIGN,
+	UC_WAITFOR,
+	UC_WAITFORSIGNAL,
+	UC_RENDEZVOUS,
+	UC_REQUIRE,
+	UC_REQUIRENOT,
+	UC_CHECK,
+	UC_CHECKNOT,
+	UC_PRINTENVIRONMENT,
+	UC_WAITFORNOT,
+	UC_SIGNAL,
+} TUccsCommand;
+
+
+class IOutput
+{
+public:
+	virtual void StartUsecase( int aID ) = 0;
+	virtual void EndUsecase( int aID, int aResult ) = 0;
+	virtual void Error( int aErrorCode, char *aErrorString ) = 0;
+	virtual void CompletedScript() = 0;
+
+	virtual void ExecuteCommand( TUccsCommand aCommand, CDataRecord *aArgs ) = 0;
+	virtual void ExecuteCommandResult( int aUccsErrorcode ) = 0;
+	virtual void ExecuteCommandReply( CDataRecord *aReply ) = 0;
+
+	virtual void DisplayHelp() = 0;
+	virtual void DisplayLastCommand( CDataRecord *aCommand ) = 0;
+	virtual void DisplayLastReply( CDataRecord *aResult ) = 0;
+	virtual void DisplayEnvironment( CDataRecord *aEnvironment ) = 0;
+
+	virtual void ExecuteString( char *aCommandLine ) = 0;
+	virtual void ExecuteStringResult( int aUccsErrorcode ) = 0;
+
+	virtual void StartServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused ) = 0;
+	virtual void StopServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused ) = 0;
+};
+
+
+/*************************************************************************************
+ *
+ * IPort - interface on the transport port called by the remote control
+ *
+ ************************************************************************************/
+class IPort
+{
+public:
+	virtual int OpenPort( char *aComPort ) = 0;
+	virtual void ClosePort() = 0;
+	virtual int ReceiveBytes( char *aBuff, int *aLength ) = 0;
+	virtual int SendBytes( char *aBuff, int *aLength ) = 0;
+};
+
+
+/*************************************************************************************
+ *
+ * IRemoteControl - interface on the remote control input guy called by the creator
+ * and the batch engine
+ *
+ ************************************************************************************/
+typedef enum {
+	RCI_NONE,
+	RCI_SERIAL,
+	RCI_SERVERSOCKET,
+	RCI_CONSOLE,
+	RCI_TCP
+} TRemoteControlTransport;
+
+class IRemoteControl
+{
+public:
+	virtual TCommandControlError Start( TRemoteControlTransport aTransport, char* aPortname, int *aErrorCode, int *aScriptError ) = 0;
+};
+
+
+/*************************************************************************************
+ *
+ * IService - interface on the service stubs called by the service manager
+ *
+ ************************************************************************************/
+class IService
+{
+
+	public:
+		virtual int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError ) = 0;
+		virtual int StopUccsService( int *aLocalerror, int *aRemoteError ) = 0;
+		virtual CDataRecord* IssueCommand(CDataRecord* aCommand) = 0;		//return result of the actual command
+		virtual int GetStatus() = 0;
+		//virtual int RegisterObserver(aNotify) = 0;
+};
+
+
+/*************************************************************************************
+ *
+ * MUccsControl - interface on the batch engine called by the remote controller
+ *
+ ************************************************************************************/
+class MUccsControl
+{
+public:
+	virtual int StartUsecase( int aUsecaseID ) = 0;
+	virtual int Signal( int aUsecaseID ) = 0;
+	virtual int Rendezvous( int aUseCaseID ) = 0;
+	virtual int Wait( int aUseCaseID ) = 0;
+	virtual int EndUsecase( int aUsecaseID, int aResult, int *aScriptResult ) = 0;
+	virtual int GetEnvVariable( char *aVariableName, char *aOutputBuffer, int aOutputBufferLen ) = 0;
+	virtual int RunCommand( char* aCommandLine ) = 0;
+};
+
+
+#endif __UCCSINTERFACES_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_Main.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,413 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_Main.cpp
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <windows.h>
+#include <direct.h>
+
+
+/********************************************************************************
+ *
+ * Local Includes
+ *
+ ********************************************************************************/
+#include "strncpynt.h"
+#include "UCCS_CBatchEngine.h"
+#include "HTMLOutput.h"
+#include "CRetrieveCommandFromFile.h"
+#include "CRetrieveCommandFromConsole.h"
+#include "../DeviceControlChannel/CUCCSCommandControl.h"
+#include "../DeviceControlChannel/CApplicationControlNull.h"
+#include "../DeviceControlChannel/CommandControlErrors.h"
+
+
+/********************************************************************************
+ *
+ * Definitions
+ *
+ ********************************************************************************/
+#define MAXCONTROLMODULEARGS 256
+#define MAXPATHLENGTH		 1024
+#define WAIT_TIME_RECEIVE_BYTES_ERROR 100
+
+
+/********************************************************************************
+ *
+ * Prototypes
+ *
+ ********************************************************************************/
+int ParseParameters( int argc, char *argv[] );
+int ProcessParameters();
+void PrintUsage();
+
+
+/********************************************************************************
+ *
+ * Types
+ *
+ ********************************************************************************/
+typedef enum {
+	OUTPUT_MODULE_HTML
+} TOutputModule;
+
+typedef enum {
+	INPUT_MODULE_FILE,
+} TInputModule;
+
+typedef enum {
+	CONTROL_MODULE_SERIAL,
+	CONTROL_MODULE_CONSOLE,
+	CONTROL_MODULE_TCP,
+	CONTROL_MODULE_AUTO
+} TControlModule;
+
+typedef struct {
+	TRemoteControlTransport iRemoteControlTransport;
+	TOutputModule	iOutputModule;
+	TInputModule	iInputModule;
+	TControlModule	iControlModule;
+	char			iControlModuleArgs[MAXCONTROLMODULEARGS];
+	int				iUseAlternateScriptDirectory;
+	char			iAlternateScriptDirectory[MAXPATHLENGTH];
+} TControllerArgs;
+
+typedef enum {
+	OPT_HELP,
+
+	// Control moduless
+	OPT_SERIALCONTROL,
+	OPT_CONSOLECONTROL,
+	OPT_TCPCONTROL,
+	OPT_AUTOCONTROL,
+
+	// Input modules
+	OPT_FILEINPUT,
+
+	// Output modules
+	OPT_HTMLOUTPUT,
+
+	// Options
+	OPT_SCRIPTDIR
+} TCommandOptions;
+
+
+/********************************************************************************
+ *
+ * File-scope variables
+ *
+ ********************************************************************************/
+static TControllerArgs gControllerArgs;
+static char *gOptionStrings[] = {	"--help", 
+									"--serialcontrol", 
+									"--consolecontrol", 
+									"--tcpcontrol",
+									"--autocontrol", 
+									"--fileinput",  
+									"--htmloutput", 
+									"--scriptdir", 
+									NULL };
+
+// Module Classes
+static CRetrieveCommandFromFile gRetrieveCommandFromFile;
+static CHTMLOutput gHtmlOutput;
+static CUCCSCommandControl *gApplicationControlPC;
+static CApplicationControlNull *gApplicationControlNull;
+static CBatchEngine *gBatchEngine;
+
+// Module Interfaces
+static IOutput *gOutput;
+static IRetrieveCommand *gInput;
+static IRemoteControl *gRemoteControl;
+
+
+/********************************************************************************
+ *
+ * Main() program entry point
+ *
+ ********************************************************************************/
+int main(int argc, char* argv[])
+{
+	int err, errcode, rv = 0, script_error;
+	TCommandControlError channel_execution_error;
+
+	// parse the parameters
+	err = ParseParameters( argc, argv );
+	if( err != 0 ) {
+		PrintUsage();
+		return -1;
+	}
+
+	// process the parameters 
+	err = ProcessParameters();
+	if( err != 0 ) {
+		return -1;
+	}
+
+	// print a welcome banner
+	fprintf( stdout, "------------------------------------------------------------------\n" );
+	fprintf( stdout, "\n" );
+	fprintf( stdout, " Network Emulator - Use Case Controller\n" );
+	fprintf( stdout, "\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"TestService\"  methodid=\"1\"\n");
+	fprintf( stdout, " eg. runcmd svcname=\"TestService\"  methodid=\"10\" call=\"TestCallOne\" param1=\"one\" param2=\"two\"\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"SyncService\"  methodid=\"1\"\n");
+	fprintf( stdout, " eg. runcmd svcname=\"SyncService\"  methodid=\"10\" call=\"StartSyncTestCase\"\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"ExeService\"   methodid=\"1\"\n");
+	fprintf( stdout, " eg. runcmd svcname=\"ExeService\"   methodid=\"2\"\n");
+	fprintf( stdout, " eg. runcmd svcname=\"ExeService\"   methodid=\"10\" call=\"Start\"       cmd=\"cmd\" args=\"\"\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"ExeService\"   methodid=\"10\" call=\"Start\"       cmd=\"cmd\" args=\"\" isDefault=\"true\"\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"ExeService\"   methodid=\"10\" call=\"Stop\"        handle=\"0\"\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"IperfService\" methodid=\"10\" call=\"StartServer\" isDefault=\"true\"\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"PcapService\"  methodid=\"10\" call=\"StartCapture\" isDefault=\"true\" outputFileName=\"test10\"\n" );
+	fprintf( stdout, " eg. runcmd svcname=\"PcapService\"  methodid=\"10\" call=\"StopCapture\"  isDefault=\"true\"\n" );
+	
+	fprintf( stdout, "------------------------------------------------------------------\n\n" );
+
+	// start the remote control module listening for commands
+	while( 1 ) {
+		channel_execution_error = gRemoteControl->Start( gControllerArgs.iRemoteControlTransport, gControllerArgs.iControlModuleArgs, &errcode, &script_error );
+		if( channel_execution_error == EAC_RECEIVEBYTESERROR ) {
+			Sleep( WAIT_TIME_RECEIVE_BYTES_ERROR );
+		}
+
+		if( (script_error != 0) && (gRemoteControl == gApplicationControlNull) ) {
+			fprintf( stderr, "WARNING: Script error occured, last error was '%s' (%d)\n", GetUccsErrorString((TUCCSErrors)script_error), script_error );
+		}
+	}
+
+	// if err is not quit then print an error
+	if( channel_execution_error != EAC_QUIT ) {
+		fprintf( stdout, "WARNING: Controller completed with errors: '%s' (%d, %d)\n", GetCommandControlErrorString(channel_execution_error), channel_execution_error, errcode );
+		rv = -2;
+	}
+
+
+	// now cleanup all the objects (just delete)
+	gOutput = NULL;
+	gInput = NULL;
+	gRemoteControl = NULL;
+	delete gBatchEngine;
+	gBatchEngine = NULL;
+	if( gApplicationControlPC != NULL ) {
+		delete gApplicationControlPC;
+		gApplicationControlPC = NULL;
+	}
+	if( gApplicationControlNull != NULL ) {
+		delete gApplicationControlNull;
+		gApplicationControlNull = NULL;
+	}
+
+	// done
+	return rv;
+}
+
+
+/********************************************************************************
+ *
+ * Parse parameters
+ *
+ ********************************************************************************/
+int ParseParameters( int argc, char *argv[] )
+{
+	int match, i, j;
+
+	// set the arguments to default values
+	gControllerArgs.iControlModule = CONTROL_MODULE_CONSOLE;
+	gControllerArgs.iControlModuleArgs[0] = 0;
+	gControllerArgs.iInputModule = INPUT_MODULE_FILE;
+	gControllerArgs.iOutputModule = OUTPUT_MODULE_HTML;
+	gControllerArgs.iUseAlternateScriptDirectory = 0;
+	gControllerArgs.iAlternateScriptDirectory[0] = 0;
+	gControllerArgs.iRemoteControlTransport = RCI_CONSOLE;
+
+	// Parse the parameters to get the configuration information
+	for( i = 1; i < argc; i++ ) {
+
+		// search for a matching option string
+		for( j = 0; gOptionStrings[j] != NULL; j++ ) {
+			match = strcmp( argv[i], gOptionStrings[j] );
+			if( match == 0 )
+				break;
+		}
+
+		// if no option found then continue with the next token
+		if( match != 0 ) {
+			fprintf( stderr, "WARNING: unknown option '%s' (ignoring).\n", argv[i] );
+			continue;
+		}
+
+		// otherwise parse each option
+		switch( j ) {
+
+			// just print the usage
+		case OPT_HELP:
+			return -1;
+
+			// use an alternate script directory
+		case OPT_SCRIPTDIR:
+			if( i == (argc-1) ) {
+				fprintf( stderr, "ERROR: --scriptdir requires a directory name to be specified.\n" );
+				return -1;
+			}
+			gControllerArgs.iUseAlternateScriptDirectory = 1;
+			STRNCPY_NULL_TERMINATE( gControllerArgs.iAlternateScriptDirectory, argv[++i], MAXPATHLENGTH );
+			break;
+
+			// use the serial control
+		case OPT_SERIALCONTROL:
+			if( i == (argc-1) ) {
+				fprintf( stderr, "ERROR: --serialcontrol requires a portname to be specified (e.g. --serialcontrol COM2).\n" );
+				return -1;
+			}
+			gControllerArgs.iRemoteControlTransport = RCI_SERIAL;
+			gControllerArgs.iControlModule = CONTROL_MODULE_SERIAL;
+			STRNCPY_NULL_TERMINATE( gControllerArgs.iControlModuleArgs, argv[++i], MAXCONTROLMODULEARGS );
+			break;
+
+			// use the control control
+		case OPT_CONSOLECONTROL:
+			gControllerArgs.iRemoteControlTransport = RCI_CONSOLE;
+			gControllerArgs.iControlModule = CONTROL_MODULE_CONSOLE;
+			break;
+
+			// use the wintunnel control
+		case OPT_TCPCONTROL:
+			if( i == (argc-1) ) {
+				fprintf( stderr, "ERROR: --tcpcontrol requires a portname to be specified (e.g. --tcpcontrol 110).\n" );
+				return -1;
+			}
+			gControllerArgs.iRemoteControlTransport = RCI_TCP;
+			gControllerArgs.iControlModule = CONTROL_MODULE_TCP;
+			STRNCPY_NULL_TERMINATE( gControllerArgs.iControlModuleArgs, argv[++i], MAXCONTROLMODULEARGS );
+			break;
+
+			// use the auto control
+		case OPT_AUTOCONTROL:
+			if( i == (argc-1) ) {
+				fprintf( stderr, "ERROR: --autocontrol requires a config string (i.e. <sid>[:<rc>[:<int>]]).\n" );
+				return -1;
+			}
+			gControllerArgs.iRemoteControlTransport = RCI_NONE;
+			gControllerArgs.iControlModule = CONTROL_MODULE_AUTO;
+			STRNCPY_NULL_TERMINATE( gControllerArgs.iControlModuleArgs, argv[++i], MAXCONTROLMODULEARGS );
+			break;
+
+			// input from a script file
+		case OPT_FILEINPUT:
+			gControllerArgs.iInputModule = INPUT_MODULE_FILE;
+			break;
+
+			// output to html
+		case OPT_HTMLOUTPUT:
+			gControllerArgs.iOutputModule = OUTPUT_MODULE_HTML;
+			break;
+		}
+	}
+
+	// done - success
+	return 0;
+}
+
+
+/********************************************************************************
+ *
+ * Process parameters
+ *
+ ********************************************************************************/
+int ProcessParameters()
+{
+	int err;
+
+	// use alternate directory
+	if( gControllerArgs.iUseAlternateScriptDirectory != 0 ) {
+		err = _chdir( gControllerArgs.iAlternateScriptDirectory );
+		if( err != 0 ) {
+			fprintf( stderr, "ERROR: failed to set directory '%s' - %s.\n", gControllerArgs.iAlternateScriptDirectory, strerror(errno) );
+			return -1;
+		}
+	}
+
+	// set the output module pointer
+	gOutput = &gHtmlOutput;
+
+	// set the script command input module 
+	gInput = &gRetrieveCommandFromFile;
+
+	// create the batchengine
+	gBatchEngine = new CBatchEngine( gInput, gOutput );
+	assert( gBatchEngine != NULL );
+
+	// create the remote channel
+	if( gControllerArgs.iControlModule == CONTROL_MODULE_SERIAL ) {
+		gApplicationControlPC = new CUCCSCommandControl( gBatchEngine, gOutput );
+		assert( gApplicationControlPC != NULL );
+		gRemoteControl = gApplicationControlPC;
+	}
+	if( gControllerArgs.iControlModule == CONTROL_MODULE_CONSOLE ) {
+		gApplicationControlPC = new CUCCSCommandControl( gBatchEngine, gOutput );
+		assert( gApplicationControlPC != NULL );
+		gRemoteControl = gApplicationControlPC;
+	}
+	if( gControllerArgs.iControlModule == CONTROL_MODULE_TCP ) {
+		gApplicationControlPC = new CUCCSCommandControl( gBatchEngine, gOutput );
+		assert( gApplicationControlPC != NULL );
+		gRemoteControl = gApplicationControlPC;
+	}
+	if( gControllerArgs.iControlModule == CONTROL_MODULE_AUTO ) {
+		gApplicationControlNull = new CApplicationControlNull( gBatchEngine, gOutput );
+		assert( gApplicationControlNull != NULL );
+		gRemoteControl = gApplicationControlNull;
+	}
+
+	// done - success
+	return 0;
+}
+
+
+/********************************************************************************
+ *
+ * PrintUsage
+ *
+ ********************************************************************************/
+void PrintUsage()
+{
+	fprintf( stderr, "\n" );
+	fprintf( stderr, "usage: uccs [options]\n" );
+	fprintf( stderr, "\n" );
+
+	fprintf( stderr, "CONTROL COMMAND OPTIONS:\n" );
+	fprintf( stderr, "\t--serialcontrol <comport>\n" );
+	fprintf( stderr, "\t\tControl commands are sent over a serial cable.\n" );
+	fprintf( stderr, "\t--consolecontrol\n" );
+	fprintf( stderr, "\t\tControl commands are entered into the console.\n" );
+	fprintf( stderr, "\t--tcpcontrol <port number>\n" );
+	fprintf( stderr, "\t\tControl commands are sent over tcp/ip using WinTunnel.\n" );
+	fprintf( stderr, "\t--autocontrol <use-case-id>[:<rendezvous-count>[:<interactive_flag>]]\n" );
+	fprintf( stderr, "\t\tControl commands are automatically entered.\n" );
+	fprintf( stderr, "\n" );
+
+	fprintf( stderr, "GENERAL OPTIONS:\n" );
+	fprintf( stderr, "\t--scriptdir <pathname>\n" );
+	fprintf( stderr, "\t\tAlternate directory to look for script files and put output files.\n" );
+	fprintf( stderr, "\n" );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ServiceValues.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: UCCS_ServiceValues.h
+*
+*/
+
+
+
+#ifndef __UCCSSERVICEVALUES_H__
+#define __UCCSSERVICEVALUES_H__
+
+typedef enum {
+	RPCSVC_INVALID,				// 0
+	RPCSVC_NULL,
+	RPCSVC_HOMEAGENT,
+	RPCSVC_FOREIGNAGENT,
+	RPCSVC_MOBILEAGENT,
+	RPCSVC_MOBSTER,				// 5
+	RPCSVC_UUINTERFACE,
+	RPCSVC_PPPCONTROLLER,
+	RPCSVC_HOSTEXECUTE,
+	RPCSVC_INTERNAL,
+	RPCSVC_HOSTEXECUTEASYNC,	// 10
+	RPCSVC_TEST,
+	RPCSVC_TESTSERVICE,
+	RPCSVC_GPSSIMULATOR,
+//	RPCSVC_GENERICSTUB,
+	RPCSVC_LAST
+} TRpcServiceID;
+
+#endif __UCCSSERVICEVALUES_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CApplicationControlNull.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+#include <assert.h>
+
+
+/**********************************************************************************************
+ *
+ * Local Includes
+ *
+ *********************************************************************************************/
+#include "CApplicationControlNull.h"
+#include "../Core/UCCS_ErrorCodes.h"
+
+
+/**********************************************************************************************
+ *
+ * Defines
+ *
+ *********************************************************************************************/
+#define MAXTOKENS 64
+
+
+/**********************************************************************************************
+ *
+ * Constructor
+ *
+ *********************************************************************************************/
+CApplicationControlNull::CApplicationControlNull( MUccsControl *aCallBackService, IOutput *aOutput )
+{
+	assert( aCallBackService != NULL );
+	assert( aOutput != NULL );
+	iOutput = aOutput;
+	iCallBackService = aCallBackService;
+}
+
+/**********************************************************************************************
+ *
+ * Destructor
+ *
+ *********************************************************************************************/
+CApplicationControlNull::~CApplicationControlNull()
+{
+}
+
+
+/**********************************************************************************************
+ *
+ * Run() -- the main routine called to run the serial listener.
+ *
+ *********************************************************************************************/
+TCommandControlError CApplicationControlNull::Start( TRemoteControlTransport aTransport, char* aPortname, int *aErrorCode, int *aScriptError )
+{
+	int err, i;
+	static int execution_count = 0;
+
+	// check params
+	assert( aScriptError != NULL );
+	*aScriptError = 0;
+
+	// check the parameters are valid
+	if( aPortname == NULL ) {
+		return EAC_INVALIDPORT;
+	}
+
+	// only run once -- then exit
+	if( execution_count > 0 ) {
+		return EAC_QUIT;
+	}
+	execution_count++;
+
+	// parse the params
+	err = ParseArgumentString( aPortname );
+	if( err == -1 ) {
+		return EAC_INVALIDPORT;
+	}
+
+	// start the use-case
+	err = iCallBackService->StartUsecase( iArgs.iUsecaseID );
+	if( err != UCCS_OK ) {
+		*aErrorCode = err;
+		return EAC_STARTUSECASEFAILED;
+	}
+
+	// run rendezvous the set number of times - wait for user input before each one 
+	// if the interactive flag is set. The last rendezvous is never interactive.
+	for( i = 0; i < iArgs.iRendezvousCount; i++ ) {
+		if( (iArgs.iInteractiveFlag != 0) && (i != (iArgs.iRendezvousCount-1)) ) {
+			fprintf( stdout, "Press enter to rendezvous.\n" );
+			getchar();
+		}
+		err = iCallBackService->Rendezvous( iArgs.iUsecaseID );
+		if( err != UCCS_OK ) {
+			*aErrorCode = err;
+			return EAC_RENDEZVOUSFAILED;
+		}
+	}
+
+	// put in a wait so that the other thread has time to finish up
+	Sleep( 1000 );
+
+	// end use-case 
+	err = iCallBackService->EndUsecase( iArgs.iUsecaseID, 0, aScriptError );
+	*aErrorCode = err; 
+	if( ( err != UCCS_OK ) ){
+		return EAC_ENDUSECASEFAILED;
+	}
+
+	// done
+	return EAC_SUCCESS;
+}
+
+
+/**********************************************************************************************
+ *
+ * ParseArgumentString() - portname should be a string:
+ * "<usecaseid>[:<rendezvous count>[:<interactive_flag>]]"
+ *
+ *********************************************************************************************/
+int CApplicationControlNull::ParseArgumentString( char *str )
+{
+	char *ptr, *tokens[MAXTOKENS];
+	int token_count = 0, i;
+
+	// check params
+	assert( str != NULL );
+
+	// tokenise the string based on the ':' delimiter
+	for( ptr = str, i = 0; i < MAXTOKENS; i++ ) {
+		tokens[i] = ptr;
+		ptr = strchr( ptr, ':' );
+		if( ptr == NULL ) 
+			break;
+		*ptr = 0;
+		ptr++;
+	}
+	token_count = i + 1;
+
+	// check that at least one token was found
+	if( token_count == 0 ) {
+		return -1;
+	}
+
+	// initialise the optional args to their defaults
+	iArgs.iRendezvousCount = 1;
+	iArgs.iInteractiveFlag = 0;
+
+	// now convert the tokens into meaningful things
+	iArgs.iUsecaseID = atoi(tokens[0]);
+	if( token_count > 1 ) {
+		iArgs.iRendezvousCount = atoi(tokens[1]);
+	}
+	if( token_count > 2 ) {
+		iArgs.iInteractiveFlag = atoi(tokens[2]);
+	}
+
+	// done - success
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CApplicationControlNull.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CApplicationControlNull
+*
+*/
+
+
+
+#ifndef __CAPPLICATIONCONTROLNULL_H__
+#define __CAPPLICATIONCONTROLNULL_H__
+
+
+/*************************************************************************************
+ *
+ * Local Includes
+ *
+ ************************************************************************************/
+#include "CommandControlErrors.h"
+#include "../Core/UCCS_Interfaces.h"
+
+
+/*************************************************************************************
+ *
+ * Types
+ *
+ ************************************************************************************/
+typedef struct {
+	int iUsecaseID;
+	int iRendezvousCount;
+	int iInteractiveFlag;
+} TArgs;
+
+
+/*************************************************************************************
+ *
+ * class CApplicationControlNull
+ *
+ ************************************************************************************/
+class CApplicationControlNull : public IRemoteControl
+{
+public:
+	CApplicationControlNull( MUccsControl *aCallBackService, IOutput *aOutput );	
+	~CApplicationControlNull();
+
+	// from IRemoteControl
+	virtual TCommandControlError Start( TRemoteControlTransport aTransport, char* aPortname, int *aErrorCode, int *aScriptError );
+
+private:
+	int ParseArgumentString( char *str );
+
+	MUccsControl *iCallBackService;
+	IOutput *iOutput;
+	TArgs iArgs;
+};
+
+#endif // __CAPPLICATIONCONTROLNULL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CConsolePort.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,384 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CConsolePort
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+/*********************************************************************
+ *
+ * Local Includes
+ *
+ ********************************************************************/
+#include "CConsolePort.h"
+#include "../Core/UCCS_ErrorCodes.h"
+#include "CProtocolTypes.h"
+
+/*********************************************************************
+ *
+ * File-scope statics
+ *
+ ********************************************************************/
+char *gKnownCommands[] = { "RUBBISH", "startusecase", "signal", "rendezvous", "endusecase", "quit", "waitforsignal", "runcmd", NULL };
+
+
+/*********************************************************************
+ *
+ * Construction
+ *
+ ********************************************************************/
+CConsolePort::CConsolePort()
+	: iReadingData(0), iUcid(0), iCommand(0)
+{
+	memset( iCommandLine, 0x00, sizeof(iCommandLine) );
+}
+
+
+CConsolePort::~CConsolePort()
+{
+}
+
+
+/*********************************************************************
+ *
+ * OpenPort() -- 
+ *
+ ********************************************************************/
+int CConsolePort::OpenPort( char *port )
+{
+	return 0;
+}
+
+
+/*********************************************************************
+ *
+ * ClosePort() --
+ *
+ ********************************************************************/
+void CConsolePort::ClosePort()
+{
+}
+
+/*********************************************************************
+ *
+ *  ReadData() 
+ *
+ ********************************************************************/
+int CConsolePort::ReadData( char* aBuff, int *aSize)
+{
+	int rand_uid = 1;
+	int eng_result = 0;
+
+	TEndUsecaseRequest* endusecase;
+	TRunCommandRequest* runcommand;
+	// Note we are using the startusecase structure for all the commands, as they 
+	// are identical in the data they contain.
+	TStartUsecaseRequest* othercases;
+
+	// If the command we are reading the header for is Endusecase, then we 
+	// have 8 bytes of data as opposed to 4, like the rest of the commands.
+	// Therefore, need to distinguish between the commands.
+
+	// If the Endusecase case
+	if (iCommand == 4)
+	{
+		endusecase = (TEndUsecaseRequest*)aBuff;
+		endusecase->iUsecaseID = iUcid;
+		endusecase->iResult = eng_result;
+		*aSize = sizeof(endusecase);
+		iReadingData = 0;
+		return 0;
+	}
+	else if( iCommand == 7 )
+	{
+		runcommand = (TRunCommandRequest*)aBuff;
+		if( strlen(iCommandLine) > 0 )
+		{
+			memset( runcommand->iCommandLine, 0x00, sizeof(MAXCOMMANDLINELEN) );
+			strcpy( runcommand->iCommandLine, iCommandLine );
+			memset( iCommandLine, 0x00, sizeof(iCommandLine) );
+		}
+		runcommand->iResult = eng_result;
+		*aSize = sizeof(runcommand);
+		iReadingData = 0;
+		return 0;
+	}
+	else 
+	{	
+		othercases = (TStartUsecaseRequest*)aBuff;
+		othercases->iUsecaseID = iUcid; 
+		*aSize = sizeof(othercases);
+		iReadingData = 0;
+		return 0;
+	}
+}
+
+/*********************************************************************
+ *
+ *  ReadHeader() 
+ *
+ ********************************************************************/
+int CConsolePort::ReadHeader( char* aBuff, int *aSize)
+{
+	int uid;
+	int rand_uid = 1;
+	int eng_result = 0;
+	int ret;
+
+	TPHeader *header = (TPHeader*)aBuff;
+
+	do { 
+	
+		// Get the next command
+		iCommand  = ParseNextLine( &uid );
+		
+		// If we have encountered an invalid command return 
+		if( (iCommand == -2) ) 
+		{
+			return -1; //EInvalidCommand
+		}
+		
+		header->iUid = rand_uid;
+		ret = GetTPCommand(iCommand, &(header->iCmdID));
+		if ( ret != 0 )
+		{
+			return -1; //EInvalidCommand
+		}	
+
+		// If the command is startusecase, for every other command we just ignore this
+		if( iCommand == 1 ) 
+		{
+			iUcid = uid;
+		}
+
+		// If the command is endusecase - iDataLen is 8 - as currently we have 4 bytes 
+		// for the uid and 4 for the result.
+		if(iCommand == 4 )
+		{
+			header->iDataLen = E8DataLen;
+		}
+		else 
+		{
+			header->iDataLen = E4DataLen;
+		}	
+		
+		// 4 bytes each for each field in the header.
+		*aSize = sizeof(*header);
+	} while( iCommand == -1 );
+
+	return 0;
+}
+
+ 
+/*********************************************************************
+ *
+ *  ReceiveBytes() 
+ *
+ ********************************************************************/
+int CConsolePort::ReceiveBytes( char* aBuff, int *aSize)
+{
+	int ret = 0;
+
+	// If we are just the data part of the frame iReadingFlag is true
+	if( iReadingData == 1 ) 
+	{
+		ret = ReadData( aBuff, aSize );
+		if ( ret != 0 )
+			return -1;
+	
+	}
+	else
+	{
+		// Else we are reading the header - so get the next command
+		ret = ReadHeader( aBuff, aSize );
+		if ( ret != 0 )
+			return -1;
+
+		// Set the flag to true now that we have read the header,
+		// so that the data part is read in the next iteration.
+		iReadingData = 1;
+	}
+	
+	// Return 
+	return ret;
+}
+
+
+/*********************************************************************
+ *
+ *  SendBytes() 
+ *
+ ********************************************************************/
+int CConsolePort::SendBytes( char *aBuff, int *aSize )
+{
+	int data_base_index;
+	TPHeader* header;
+	int *engine_result, *script_result;
+
+	// extract the info from the buffer
+	header = (TPHeader*)aBuff;
+	data_base_index = sizeof(TPHeader);
+	engine_result = ((int*)(&aBuff[data_base_index]));
+	script_result = ((int*)(&aBuff[data_base_index+4]));
+
+	// print out the information for the endusecase command
+	if( header->iCmdID == CMD_REP_ENDUSECASEID ) {
+		assert( header->iDataLen == E8DataLen );
+		if( (*script_result) == 0 ) {
+			fprintf( stdout, "  %s - No script errors occured.\n\n", GetUccsErrorStringI(*engine_result) );
+		} else if( ((*script_result) > UCCS_OK) && ((*script_result) < UCCS_LAST) ) {
+			fprintf( stdout, "  %s - %s\n\n", GetUccsErrorStringI(*engine_result), GetUccsErrorStringI(*script_result) );
+		} else {
+			fprintf( stdout, "  %s - %d\n\n", GetUccsErrorStringI(*engine_result), *script_result );
+		}
+		*aSize = 8;
+	}
+
+	// print out the information for all other commands 
+	if( header->iCmdID != CMD_REP_ENDUSECASEID ) 
+	{
+		assert ( header->iDataLen == E4DataLen );
+		if (*engine_result < 0)
+			fprintf(stdout, "Error! %s (%d)\n\n", GetUccsErrorStringI(*engine_result), *engine_result);
+		else
+			fprintf(stdout, "Success! (0x%08x)\n\n", *engine_result);
+		*aSize = 4;
+	}
+
+	// done
+	return 0;
+}
+
+
+/*********************************************************************
+ *
+ * ParseNextLine() 
+ *
+ ********************************************************************/
+int CConsolePort::ParseNextLine( int *uid )
+{
+	char *cp;
+	char cline[MAXLINESIZE];
+	char command[MAXLINESIZE];
+	int token_count;
+	int i;
+	int match;
+
+	// check param
+	assert( uid != NULL );
+
+	// write a litte prompt
+	fprintf( stdout, "> " );
+
+	// read the line 
+	cp = fgets( cline, MAXLINESIZE, stdin );
+	if( cp == NULL ) {
+		return -2;
+	}
+
+	// tokenise the line
+	token_count = sscanf( cline, "%s %d\n", command, uid );
+
+	// if there are no tokens then leave
+	if( token_count <= 0 ) {
+		return -1;
+	}
+
+	// otherwise try and match the token
+	for( i = 0; gKnownCommands[i] != NULL; i++ ) {
+		match = strcmp( gKnownCommands[i], command );
+		if( match == 0 ) {
+			break;
+		}
+	}
+
+	// If runcmd then set the command line data
+	if( i == 7 )
+	{
+		if( strlen(iCommandLine) > 0 )
+		{
+			memset( iCommandLine, 0x00, sizeof(iCommandLine) );
+		}
+		strcpy( iCommandLine, cline );
+	}
+
+	// check that a command was found
+	if( gKnownCommands[i] == NULL ) {
+		fprintf( stderr, "WARNING: unknown command '%s' (ignoring)\n\n", command );
+		return -1;
+	}
+
+	// otherwise we have a command -- if startusecase then make sure that it has a uid
+	if( (i == 1) && (token_count == 1) ) {
+		fprintf( stderr, "WARNING: command '%s' requires a use case ID argument\n\n", gKnownCommands[i] );
+		return -1;
+	}
+
+	// OK -- return the command
+	return i;
+}
+
+
+/*********************************************************************
+ *
+ * GetTPCommand() 
+ *
+ ********************************************************************/
+int CConsolePort::GetTPCommand( int aCommandID, TPCommand* aTPCommand )
+{
+
+	switch (aCommandID)
+	{
+		case 1:		// startusecase
+			*aTPCommand = CMD_REQ_STARTUSECASEID;
+			break;
+		
+		case 2:		// signal
+			*aTPCommand = CMD_REQ_SIGNALID;
+			break;
+		
+		case 3:		// rendezvous
+			*aTPCommand = CMD_REQ_RENDEZVOUSID;
+			break;
+
+		case 4:		// endusecase
+			*aTPCommand = CMD_REQ_ENDUSECASEID;
+			break;
+
+		case 5:		// quit	
+			*aTPCommand = CMD_QUITID;
+			break;
+
+		case 6:		// waitforsignal
+			*aTPCommand = CMD_REQ_WAITID;
+			break;
+
+		case 7:		// runcmd
+			*aTPCommand = CMD_REQ_RUNCOMMAND;
+			break;
+
+		default:
+			return -1;
+	}
+
+	return 0;
+}
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CConsolePort.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CConsolePort
+*
+*/
+
+
+
+#ifndef __CCONSOLEPORT_H__
+#define __CCONSOLEPORT_H__
+
+/*********************************************************************
+ *
+ * Definitions
+ *
+ ********************************************************************/
+#define MAXLINESIZE 1024
+
+/*************************************************************************************
+ *
+ * Local Includes
+ *
+ ************************************************************************************/
+#include <windows.h>
+#include "CProtocolTypes.h"
+#include "../Core/UCCS_Interfaces.h"
+
+#define E8DataLen	8
+#define E4DataLen	4
+
+/*************************************************************************************
+ *
+ * CNetworkPort Definition
+ *
+ ************************************************************************************/
+class CConsolePort : public IPort
+{
+public:
+	CConsolePort();
+	~CConsolePort();
+
+	int OpenPort( char *port );
+	void ClosePort();
+	int ReceiveBytes( char *aBuff, int *aLength );
+	int SendBytes( char *aBuff, int *aLength );
+
+private:
+	int ParseNextLine( int *uid );
+	int GetTPCommand( int aCommandID, TPCommand* aTPCommand );
+	int ReadHeader( char* aBuff, int *aSize);
+	int ReadData( char* aBuff, int *aSize);
+
+	int iReadingData;	
+	int iUcid;			// Member variable to reocrd the last usecase id read on the commandline
+	int iCommand;		// Member varaible to record the last command read on the commandline
+	char iCommandLine[MAXLINESIZE];
+
+};
+
+#endif //__CCONSOLEPORT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CFrameBuffer.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <assert.h>
+#include <string.h>
+
+/**********************************************************************************************
+ *
+ * Local Includes
+ *
+ *********************************************************************************************/
+#include "CFrameBuffer.h"
+
+/**********************************************************************************************
+ *
+ * Defines
+ *
+ *********************************************************************************************/
+
+/**********************************************************************************************
+ *
+ * Static Method
+ *
+ *********************************************************************************************/
+TFBError CFrameBuffer::createSendBuffer(int aUID, TPCommand aSendCommand, int aDataLength, char* aData, char* aFrame, int* aFrameSize)
+{
+	int totalFrameSize, i, data_base_index;
+	TPHeader *header;
+
+	// Check params
+	assert ( aData != NULL);
+	assert ( aFrame != NULL);
+	assert ( aFrameSize != NULL);
+
+	// Calculate the size of the resultant frame buffer
+	totalFrameSize = ( sizeof(TPHeader) + aDataLength);
+
+	// Check that the frame data will fit into the allocated frame size 
+	if ( totalFrameSize > *aFrameSize )
+	{
+		return TFB_BUFFERTOOSMALL;
+	}
+
+	header = (TPHeader*)aFrame;
+
+	// Now create the packet											
+	header->iUid = aUID;					// Add the UID
+	header->iCmdID = aSendCommand;			// Add the command id
+	header->iDataLen = aDataLength;			// Add the length
+
+	for( i = 0, data_base_index = sizeof(TPHeader); i < aDataLength; i++ ) 
+	{
+		aFrame[data_base_index + i] = aData[i];
+	}
+
+	// Set the final frame size to the actual size of the frame we have created.
+	*aFrameSize = totalFrameSize;
+
+	return TFB_SUCCESS;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CFrameBuffer.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CFrameBuffer Class
+*
+*/
+
+
+
+#ifndef _CFrameBuffer_H
+#define _CFrameBuffer_H
+
+/*****************************************************************************
+ *
+ * System Includes 
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+#include "CProtocolTypes.h"
+
+/*****************************************************************************
+ *
+ *  Types
+ *
+ ****************************************************************************/
+typedef enum {
+	TFB_SUCCESS,
+	TFB_INVALIDARGS,
+	TFB_BUFFERTOOSMALL
+} TFBError;
+
+/*****************************************************************************
+ *
+ *  Defines
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Class Definition
+ *
+ ****************************************************************************/
+class CFrameBuffer
+{
+public:
+
+	static TFBError createSendBuffer (int aUID, TPCommand aSendCommand, int aDataLength, char* aData, char* aFrame, int* aFrameSize);
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CProtocolTypes.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Switches
+*
+*/
+
+
+
+#ifndef __CPROTOCOLTYPE_H__
+#define __CPROTOCOLTYPE_H__
+
+/*************************************************************************************
+ *
+ * Defines
+ *
+ ************************************************************************************/
+#define MAXVARNAMELEN		60
+#define MAXCOMMANDLINELEN	1024
+
+/*************************************************************************************
+ *
+ * Types
+ *
+ ************************************************************************************/
+typedef enum {
+	CMD_REQ_STARTUSECASEID,
+	CMD_REQ_SIGNALID,
+	CMD_REQ_RENDEZVOUSID,
+	CMD_REQ_WAITID,
+	CMD_REQ_ENDUSECASEID,
+	CMD_REQ_GETVARIABLENAMEID,
+	CMD_REQ_RUNCOMMAND,
+	CMD_REP_STARTUSECASEID,
+	CMD_REP_SIGNALID,
+	CMD_REP_RENDEZVOUSID,
+	CMD_REP_WAITID,
+	CMD_REP_ENDUSECASEID,
+	CMD_REP_GETVARIABLENAMEID,
+	CMD_REP_RUNCOMMAND,
+	CMD_QUITID,
+	CMD_UNKNOWN
+}TPCommand;
+
+typedef struct {
+	int iUid;
+	TPCommand iCmdID;
+	int iDataLen;
+} TPHeader;
+
+/*************************************************************************************
+ * Request Structs
+ ************************************************************************************/
+
+typedef struct {
+	int iUsecaseID;
+} TStartUsecaseRequest;
+
+typedef struct {
+	int iUsecaseID;
+} TSignalRequest;
+
+typedef struct {
+	int iUsecaseID;
+} TRendezvousRequest;
+
+typedef struct {
+	int iUsecaseID;
+} TWaitRequest;
+
+typedef struct {
+	int iUsecaseID;
+	int iResult;
+} TEndUsecaseRequest;
+
+typedef struct {
+	char iVariableName[MAXVARNAMELEN] ;
+} TGetVariableNameRequest;
+
+typedef struct {
+	char iCommandLine[MAXCOMMANDLINELEN] ;
+	int iResult;
+} TRunCommandRequest;
+
+/*************************************************************************************
+ * Reply Requests
+ ************************************************************************************/
+
+typedef struct {
+	int iResult;
+} TStartUsecaseReply;
+
+typedef struct {
+	int iResult;
+} TSignalReply;
+
+typedef struct {
+	int iResult;
+} TRendezvousReply;
+
+typedef struct {
+	int iResult;
+} TWaitReply;
+
+typedef struct {
+	int iCommandResult;
+	int iScriptResult;
+} TEndUsecaseReply;
+
+typedef struct {
+	char iVariableValue[MAXVARNAMELEN] ;
+	int iResult;
+} TGetVariableNameReply;
+
+typedef struct {
+	int iResult;
+} TRunCommandReply;
+
+#endif //__CPROTOCOLTYPE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CSerialPort.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSerialPort -- encapsulates the details of using the serial port as 
+* a communications channel
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+/*********************************************************************
+ *
+ * Local Includes
+ *
+ ********************************************************************/
+#include "CSerialPort.h"
+
+/*********************************************************************
+ *
+ * Construction
+ *
+ ********************************************************************/
+CSerialPort::CSerialPort()
+{
+	iComPort = INVALID_HANDLE_VALUE;
+}
+
+
+CSerialPort::~CSerialPort()
+{
+	assert( iComPort == INVALID_HANDLE_VALUE );
+}
+
+
+/*********************************************************************
+ *
+ * OpenComPort() -- open a com port, set the timeouts, set the config
+ *
+ ********************************************************************/
+int CSerialPort::OpenPort( char *aComPort )
+{
+	int err;
+
+	// Open the COM Port
+	iComPort = CreateFile( aComPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH, NULL );
+	if( iComPort == INVALID_HANDLE_VALUE ) {
+		err = GetLastError();
+		return err;
+	}
+
+	// Set the timeouts
+	COMMTIMEOUTS CommTimeOuts;
+	CommTimeOuts.ReadIntervalTimeout = 0;
+	CommTimeOuts.ReadTotalTimeoutMultiplier = 0;
+    CommTimeOuts.ReadTotalTimeoutConstant = 0;
+	CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
+	CommTimeOuts.WriteTotalTimeoutConstant = 0;
+	err = SetCommTimeouts( iComPort, &CommTimeOuts );
+	if( err == 0 ) {
+		err = GetLastError();
+		CloseHandle( iComPort );
+		iComPort = INVALID_HANDLE_VALUE;
+		return err;
+	}
+
+	// Configure the COM port 
+	DCB dcb;
+	GetCommState(iComPort, &dcb);
+	dcb.DCBlength			= sizeof(dcb); 
+	dcb.BaudRate			= CBR_115200;
+	dcb.fBinary				= TRUE;
+	dcb.fParity				= NOPARITY;
+	dcb.fOutxCtsFlow		= TRUE;
+	dcb.fOutxDsrFlow		= FALSE;
+	dcb.fDtrControl			= DTR_CONTROL_ENABLE;	
+	dcb.fDsrSensitivity		= FALSE;
+	dcb.fTXContinueOnXoff	= TRUE;
+	dcb.fOutX				= FALSE;
+	dcb.fInX				= FALSE;
+	dcb.fErrorChar			= FALSE;
+	dcb.fNull				= FALSE;
+	dcb.fRtsControl			= RTS_CONTROL_HANDSHAKE;
+	dcb.fAbortOnError		= TRUE;
+	dcb.XonLim				= 100;
+	dcb.XoffLim				= 100;
+	dcb.ByteSize			= 8;
+	dcb.Parity				= NOPARITY;
+	dcb.StopBits			= ONESTOPBIT;
+	dcb.XonChar				= 17;
+	dcb.XoffChar			= 19;
+	err = SetCommState( iComPort, &dcb );	
+	if( err == 0 ) {
+		err = GetLastError();
+		CloseHandle( iComPort );
+		iComPort = INVALID_HANDLE_VALUE;
+		return err;
+	}
+
+	// Success
+	return 0;
+}
+
+
+/*********************************************************************
+ *
+ * CloseComPort() -- close an open com port.
+ *
+ ********************************************************************/
+void CSerialPort::ClosePort()
+{
+	// if the port isn't open then just return
+	if( iComPort == INVALID_HANDLE_VALUE ) 
+		return;
+	
+	// close the port
+	CloseHandle( iComPort );
+	iComPort = INVALID_HANDLE_VALUE;
+}
+
+
+/*********************************************************************
+ *
+ *  ReceiveBytes() -- read specified number of bytes from the comport
+ *
+ ********************************************************************/
+int CSerialPort::ReceiveBytes( char* aBuff, int *aSize)
+{
+	int err;
+	int original_size;
+	unsigned long iBytesRead;
+
+	// check the state and the params
+	assert( iComPort != INVALID_HANDLE_VALUE );
+	assert( aBuff != NULL );
+	assert( aSize != NULL );
+
+	// receive bytes
+	original_size = *aSize;
+	err = ReadFile( iComPort, aBuff, *aSize, &iBytesRead, NULL );
+
+	// set aSize to the number actually read
+	*aSize = iBytesRead;
+
+	// check for errors
+	if( err == 0 )  {
+		err = GetLastError();
+		return err;
+	}
+		
+	// this condition should have generated an error -- lets make sure
+	assert( *aSize == original_size );
+	return 0;
+}
+
+
+/*********************************************************************
+ *
+ *  SendBytes() -- write the specified number of bytes to the COMport
+ *
+ ********************************************************************/
+int CSerialPort::SendBytes( char *aBuff, int *aSize )
+{
+	int ret;
+	DWORD dwModemStatus, dwBytes = 0;
+
+	// check state and params
+	assert( iComPort != INVALID_HANDLE_VALUE );
+	assert( aBuff != NULL );
+	assert( aSize != NULL );
+
+	// write bytes to the port
+	ret = GetCommModemStatus( iComPort, &dwModemStatus );
+	ret = WriteFile( iComPort, (LPVOID)aBuff, *aSize, &dwBytes, NULL );
+
+	// set aSize to the number actually written
+	*aSize = dwBytes;
+
+	// check for errors
+	if( ret == 0 ) {
+		ret = GetLastError();
+		return ret;
+	}
+	
+	// done	
+	return 0;	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CSerialPort.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CSerialPort
+*
+*/
+
+
+
+#ifndef __CSERIALPORT_H__
+#define __CSERIALPORT_H__
+
+/*************************************************************************************
+ *
+ * Includes
+ *
+ ************************************************************************************/
+#include <windows.h>
+#include "../Core/UCCS_Interfaces.h"
+
+/*************************************************************************************
+ *
+ * CSerialPort Definition
+ *
+ ************************************************************************************/
+class CSerialPort : public IPort
+{
+public:
+	CSerialPort();
+	~CSerialPort();
+
+	int OpenPort( char *aComPort );
+	void ClosePort();
+	int ReceiveBytes( char *aBuff, int *aLength );
+	int SendBytes( char *aBuff, int *aLength );
+
+private:
+	HANDLE iComPort;
+};
+
+#endif //__MUCCSCONTROL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CTcpPort.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "CTcpPort.h"
+
+CTcpPort::CTcpPort()
+: iPort(0)
+{
+}
+
+CTcpPort::~CTcpPort()
+{
+}
+
+int CTcpPort::OpenPort( char *aPort )
+{
+	WORD version;
+	WSADATA wsaData;
+
+	version = MAKEWORD( 2, 2 );
+	if( WSAStartup( version, &wsaData ) )
+	{
+		return WSAGetLastError();
+	}
+
+	// Create a socket
+	iLocalSock = socket( AF_INET, SOCK_STREAM, 0 ) ;
+	if( iLocalSock == INVALID_SOCKET )
+	{
+		return WSAGetLastError();
+	}
+
+	// Set iPort for later use
+	iPort = atoi( aPort );
+
+	// Set the socket
+	iLocalAddr.sin_family = AF_INET;		
+	iLocalAddr.sin_port = htons( iPort );
+	iLocalAddr.sin_addr.S_un.S_addr = inet_addr( "0.0.0.0" );
+
+	// Bind
+	if( bind(iLocalSock,(struct sockaddr*)&iLocalAddr, sizeof(SOCKADDR_IN)) != 0 )
+	{	
+		return WSAGetLastError();
+	}
+
+	// Listen to the socket
+	if( listen( iLocalSock, 1 ) == SOCKET_ERROR ) 
+	{
+		return WSAGetLastError();
+	}
+	
+	// Wait for the next connection
+	int remote_addr_len = sizeof(iRemoteAddr);
+	iRemoteSock = accept( iLocalSock, (struct sockaddr*)&iRemoteAddr, &remote_addr_len );
+	if( iRemoteSock == INVALID_SOCKET ) 
+	{
+		return WSAGetLastError();
+	}
+
+	return 0;
+}
+
+void CTcpPort::ClosePort()
+{
+	closesocket(iRemoteSock);
+	closesocket(iLocalSock);
+	WSACleanup();
+}
+
+int CTcpPort::ReceiveBytes( char *aBuff, int *aLength )
+{
+	int received_byte_count = 0;
+	int bytes_to_receive = *aLength;
+	int bytes_received_this_round = 1;
+
+	while( received_byte_count < bytes_to_receive )
+	{
+		bytes_received_this_round = recv( iRemoteSock, &(aBuff[received_byte_count]), bytes_to_receive - received_byte_count, 0 );
+		if( bytes_received_this_round == SOCKET_ERROR )
+		{
+			*aLength = received_byte_count;
+			return WSAGetLastError();
+		}
+		else if( bytes_received_this_round == 0 )
+		{
+			// The socket has been killed
+
+			// Now close it at this end
+			closesocket(iRemoteSock);
+			closesocket(iLocalSock);
+			WSACleanup();
+
+			// Wait for a new connection
+			char port[20];
+			sprintf(port, "%d", iPort);
+			int ret = OpenPort( port );
+			if( ret != 0 )
+			{
+				return ret;
+			}
+		}
+
+		received_byte_count += bytes_received_this_round;
+	}
+
+	*aLength = received_byte_count;
+	return 0;
+}
+
+int CTcpPort::SendBytes( char *aBuff, int *aLength )
+{
+	int bytes_sent_this_round;
+	int total_bytes_to_send = *aLength;
+	int total_bytes_sent = 0;
+
+	while( total_bytes_sent < total_bytes_to_send )
+	{
+		bytes_sent_this_round = send( iRemoteSock, &(aBuff[total_bytes_sent]), total_bytes_to_send - total_bytes_sent, 0 );
+		if( bytes_sent_this_round == SOCKET_ERROR )
+		{
+			return WSAGetLastError();
+		}
+		total_bytes_sent += bytes_sent_this_round;
+	}
+	return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CTcpPort.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CTcpPort
+*
+*/
+
+
+
+#ifndef __CTCPPORT_H__
+#define __CTCPPORT_H__
+
+#include <windows.h>
+#include "../Core/UCCS_Interfaces.h"
+
+class CTcpPort : public IPort
+{
+public:
+	CTcpPort();
+	~CTcpPort();
+
+	int OpenPort( char *aPort );
+	void ClosePort();
+	int ReceiveBytes( char *aBuff, int *aLength );
+	int SendBytes( char *aBuff, int *aLength );
+
+private:
+	SOCKET iLocalSock;
+	SOCKADDR_IN iLocalAddr;
+	SOCKET iRemoteSock;
+	SOCKADDR_IN iRemoteAddr;
+	int iPort;
+};
+
+#endif //__CTCPPORT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandControl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,267 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+#include <assert.h>
+
+/**********************************************************************************************
+ *
+ * Local Includes
+ *
+ *********************************************************************************************/
+#include "CUCCSCommandControl.h"
+#include "../Core/UCCS_ErrorCodes.h"
+
+/**********************************************************************************************
+ *
+ * Defines
+ *
+ *********************************************************************************************/
+
+/**********************************************************************************************
+ *
+ * Constructor
+ *
+ *********************************************************************************************/
+CUCCSCommandControl::CUCCSCommandControl( MUccsControl *aCallBackService, IOutput *aOutput )
+{
+	assert( aCallBackService != NULL );
+	assert( aOutput != NULL );
+
+	iOutput = aOutput;
+	iCallBackService = aCallBackService;
+	iStopFlag = 0;
+}
+
+/**********************************************************************************************
+ *
+ * Destructor
+ *
+ *********************************************************************************************/
+CUCCSCommandControl::~CUCCSCommandControl()
+{
+}
+
+/**********************************************************************************************
+ *
+ * Start() -- the main routine called to run the serial listener.
+ *
+ *********************************************************************************************/
+TCommandControlError CUCCSCommandControl::Start( TRemoteControlTransport aTransport, char *aPortname, int *aErrorCode, int *aScriptError )
+{
+	int dataLength, script_result;
+	TCommandControlError return_value = EAC_SUCCESS;
+	int engine_result = 0;
+	char commandBuffer[KMAXDATALENGTH];
+	char *cmdbptr;
+	TPCommand commandID;
+	TCPError protErr;
+
+	// Pointers to all structures to receive data for an ID.
+	TStartUsecaseRequest *startusecase_data;
+	TSignalRequest *signal_data;
+	TRendezvousRequest *rendezvous_data;
+	TWaitRequest *wait_data;
+	TEndUsecaseRequest *endusecase_data;
+	TGetVariableNameRequest *variablename_data;
+	TRunCommandRequest *runcommand_data;
+
+	// Pointers to all structures used in a reply to a request
+	TStartUsecaseReply startusecase_rep;
+	TSignalReply signal_rep;
+	TRendezvousReply rendezvous_rep;
+	TWaitReply wait_rep;
+	TEndUsecaseReply endusecase_rep;
+	TGetVariableNameReply variablename_rep;
+	TRunCommandReply runcommand_rep;
+	cmdbptr = &(commandBuffer[0]);
+
+	//Check params
+	assert ( aPortname != NULL );
+	assert ( aErrorCode!= NULL );
+	assert ( aScriptError != NULL );
+	*aScriptError = 0;
+	iTransport = aTransport;
+
+	// Initialise the transport
+	protErr = iProtocol.initialise( aTransport, aPortname, iOutput );
+	if (protErr != TCP_SUCCESS)
+	{
+		*aErrorCode = protErr;
+		return EAC_ERRINITTRANSPORT;
+	}
+
+	// receive bytes -- forever really
+	while( 1 ) {
+
+		// check the end flag
+		if( iStopFlag != 0 ) {
+			break;
+		}
+
+		// receive the command id and data via iProtocol
+		dataLength = KMAXDATALENGTH;
+		protErr = iProtocol.receiveMessage (&commandID, &dataLength, cmdbptr);
+
+		// if there is an error in the protocol we cannot recover. 
+		if (protErr != TCP_SUCCESS)
+		{
+			return_value =  EAC_RECEIVEBYTESERROR;
+			*aErrorCode = protErr;
+			break;
+		}
+
+		// msg for serial clients
+		LocalUpdateMessageIn(commandID, cmdbptr);
+
+		// now handle the command
+		switch( commandID ) {
+
+			case CMD_REQ_STARTUSECASEID:
+				startusecase_data = (TStartUsecaseRequest*)cmdbptr;
+				engine_result = iCallBackService->StartUsecase( startusecase_data->iUsecaseID );
+				startusecase_rep.iResult = engine_result;
+				protErr = iProtocol.sendReply(CMD_REP_STARTUSECASEID, sizeof(startusecase_rep), &startusecase_rep);
+				break;
+
+			case CMD_REQ_SIGNALID:
+				signal_data = (TSignalRequest*)cmdbptr;
+				engine_result = iCallBackService->Signal( signal_data->iUsecaseID );
+				signal_rep.iResult = engine_result;
+				protErr = iProtocol.sendReply(CMD_REP_SIGNALID, sizeof(signal_rep), &signal_rep);
+				break;
+			
+			case CMD_REQ_RENDEZVOUSID:
+				rendezvous_data = (TRendezvousRequest*)cmdbptr;
+				engine_result = iCallBackService->Rendezvous( rendezvous_data->iUsecaseID );
+				rendezvous_rep.iResult = engine_result;
+				protErr = iProtocol.sendReply(CMD_REP_RENDEZVOUSID, sizeof(rendezvous_rep), &rendezvous_rep);
+				break;
+				
+			case CMD_REQ_WAITID:
+				wait_data = (TWaitRequest*)cmdbptr;
+				engine_result = iCallBackService->Wait( wait_data->iUsecaseID );
+				wait_rep.iResult = engine_result;
+				protErr = iProtocol.sendReply(CMD_REP_WAITID, sizeof(wait_rep), &wait_rep);
+				break;	
+
+			case CMD_REQ_ENDUSECASEID:
+				endusecase_data = (TEndUsecaseRequest*)cmdbptr;
+				engine_result = iCallBackService->EndUsecase( endusecase_data->iUsecaseID, endusecase_data->iResult, &script_result);
+				endusecase_rep.iCommandResult = engine_result;
+				endusecase_rep.iScriptResult = script_result;
+				protErr = iProtocol.sendReply(CMD_REP_ENDUSECASEID, sizeof(endusecase_rep), &endusecase_rep);
+				iStopFlag = 1;
+				break;
+
+			case CMD_REQ_GETVARIABLENAMEID:
+				variablename_data = (TGetVariableNameRequest*)cmdbptr;
+				engine_result = iCallBackService->GetEnvVariable(variablename_data->iVariableName, variablename_rep.iVariableValue, MAXVARNAMELEN );
+				variablename_rep.iResult = engine_result;
+				protErr = iProtocol.sendReply(CMD_REP_GETVARIABLENAMEID, sizeof(variablename_rep), &variablename_rep);
+				break;
+
+			case CMD_QUITID:
+				protErr = TCP_FAILED;
+				return_value = EAC_QUIT;
+				break;	
+
+			case CMD_REQ_RUNCOMMAND:
+				runcommand_data = (TRunCommandRequest*)cmdbptr;
+				engine_result = iCallBackService->RunCommand( runcommand_data->iCommandLine );
+				runcommand_rep.iResult = engine_result;
+				protErr = iProtocol.sendReply(CMD_REP_RUNCOMMAND, sizeof(runcommand_rep), &runcommand_rep);
+				break;
+
+			default:
+				iOutput->Error( UCCS_UNKNOWNCONTROLCOMMAND, NULL );
+				protErr = TCP_SUCCESS;
+				return_value = EAC_SUCCESS;
+		}
+
+		// print the message
+		LocalUpdateMessageOut( engine_result );
+
+		// if there was an error in the transport then exit
+		if( protErr != TCP_SUCCESS  ) {
+			if( return_value != EAC_QUIT ) {
+				return_value = EAC_PROCESSINGFAILED;
+			}
+			break;
+		}
+	}
+
+	// done
+	iProtocol.disconnect();
+	iStopFlag = 0;
+	*aErrorCode = protErr;
+	return return_value;
+	
+}		
+
+
+/**********************************************************************************************
+ *
+ * Helper: Print messages when we are in serial mode
+ *
+ *********************************************************************************************/
+void CUCCSCommandControl::LocalUpdateMessageIn(int aCommandId, char *aMsg)
+{
+	static char *cmdIdStrings[] = 
+	{
+		"StartUseCase (request)",		// CMD_REQ_STARTUSECASEID,
+		"Signal  (request)",			// CMD_REQ_SIGNALID,
+		"Rendezvous  (request)",		// CMD_REQ_RENDEZVOUSID,
+		"WaitForSignal (request)",		// CMD_REQ_WAITID,
+		"EndUseCase (request)",			// CMD_REQ_ENDUSECASEID,
+		"GetVariableName (request)",	// CMD_REQ_GETVARIABLENAMEID,
+		"Run (request)",				// CMD_REQ_RUNCOMMAND
+		"StartUseCase (response)",		// CMD_REP_STARTUSECASEID,
+		"Signal (response)"				// CMD_REP_SIGNALID,
+		"Rendezvous (response)",		// CMD_REP_RENDEZVOUSID,
+		"WaitForSignal  (response)",	// CMD_REP_WAITID,
+		"EndUseCase (response)",		// CMD_REP_ENDUSECASEID,
+		"GetVariableName (response)",	// CMD_REP_GETVARIABLENAMEID,
+		"Run (response)",				// CMD_REP_RUNCOMMAND,
+		"Quit",							// CMD_QUITID,
+		"Unknown",						// CMD_UNKNOWN
+	};
+
+	// don't display for console;  - consolidate o/p
+	if (iTransport != RCI_CONSOLE)
+	{
+		// display msg - belongs within protocol implementation?
+		fprintf(stdout, "\n%s\n", aMsg);
+
+		if (aCommandId > CMD_UNKNOWN)
+			fprintf(stdout, "Error! unsupported command identifier %d\n", aCommandId);
+		else
+			fprintf(stdout, " command; \"%s\" (%d)\n", cmdIdStrings[aCommandId], aCommandId);
+	}
+}
+
+void CUCCSCommandControl::LocalUpdateMessageOut(int aResult)
+{
+	// don't display for console;  - consolidate o/p
+	if( iTransport != RCI_CONSOLE)
+		fprintf(stdout, " result; \"%s\" (%d)\n", GetUccsErrorStringI(aResult), aResult);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandControl.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CUCCSCommandControl Class
+*
+*/
+
+
+
+#ifndef _CUCCSCommandControl_H
+#define _CUCCSCommandControl_H
+
+/*****************************************************************************
+ *
+ * System Includes 
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+#include "CommandControlErrors.h"
+#include "../Core/UCCS_Interfaces.h"
+#include "CProtocolTypes.h"
+#include "CUCCSCommandProtocol.h"
+
+/*****************************************************************************
+ *
+ *  Types
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ *
+ *  Defines
+ *
+ ****************************************************************************/
+#define KMAXDATALENGTH			4096
+
+
+/*****************************************************************************
+ *
+ * Class Definition
+ *
+ ****************************************************************************/
+class CUCCSCommandControl : public IRemoteControl
+{
+public:
+	CUCCSCommandControl( MUccsControl *aCallBackService, IOutput *aOutput );	
+	~CUCCSCommandControl();
+	void LocalUpdateMessageIn( int aCommandId, char *aMsg);
+	void LocalUpdateMessageOut( int aCommandId );
+
+	// from IRemoteControl
+	virtual TCommandControlError Start( TRemoteControlTransport aTransport, char* aPortname, int *aErrorCode, int *aScriptError );
+	
+private:
+	CUCCSCommandProtocol iProtocol;
+	MUccsControl *iCallBackService;
+	IOutput *iOutput;
+	int iStopFlag;
+	TRemoteControlTransport iTransport;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandProtocol.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,218 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <time.h>
+#include <assert.h>
+
+/**********************************************************************************************
+ *
+ * Local Includes
+ *
+ *********************************************************************************************/
+#include "CUCCSCommandProtocol.h"
+#include "CFrameBuffer.h"
+#include "strncpynt.h"
+
+/**********************************************************************************************
+ *
+ * Defines
+ *
+ *********************************************************************************************/
+
+/**********************************************************************************************
+ *
+ * Constructor
+ *
+ *********************************************************************************************/
+CUCCSCommandProtocol::CUCCSCommandProtocol()
+{
+	iPort = NULL;
+	iOutput = NULL;
+ 
+	// Seed the random number generator
+	srand( (unsigned)time(NULL) );
+}
+
+/**********************************************************************************************
+ *
+ * Destructor
+ *
+ *********************************************************************************************/
+CUCCSCommandProtocol::~CUCCSCommandProtocol()
+{
+}
+	
+/**********************************************************************************************
+ *
+ * Initialise
+ *
+ *********************************************************************************************/
+TCPError CUCCSCommandProtocol::initialise(TRemoteControlTransport aTransport, char* aRemoteHost, IOutput* aOutput)
+{
+	int ret;
+
+	// Check params are not equal to NULL
+	assert (aRemoteHost != NULL);
+	assert (strlen(aRemoteHost) < (KMAXPORTNAME -1));
+	assert (aOutput != NULL);
+
+	// Assign the params to the relevant member data.
+	if ( aTransport == RCI_SERIAL )
+	{	
+		iPort = &iSerialPort;
+	}
+	else if ( aTransport == RCI_CONSOLE)
+	{
+		iPort = &iConsolePort;
+	}
+	else if ( aTransport == RCI_TCP)
+	{
+		iPort = &iTcpPort;
+	}
+	else
+	{
+		return TCP_INVALIDTRANSPORT;
+	}
+
+	// Set the state members 
+	STRNCPY_NULL_TERMINATE( iRemoteHost, aRemoteHost, KMAXPORTNAME );
+	iOutput = aOutput;
+	iRand_UID = (unsigned)rand();
+
+	// Open the serial port
+	ret = iPort->OpenPort(iRemoteHost);
+	if( ret != 0 ) {
+		return TCP_FAILEDTOOPENPORT;
+	}
+	return TCP_SUCCESS;
+}
+
+/**********************************************************************************************
+ *
+ * Disconnect
+ *
+ *********************************************************************************************/
+TCPError CUCCSCommandProtocol::disconnect()				
+{
+	// Close the serial port.
+	iPort->ClosePort();
+	iPort = NULL;
+
+	return TCP_SUCCESS;
+}
+
+/**********************************************************************************************
+ *
+ * SendReply
+ *
+ *********************************************************************************************/	
+TCPError CUCCSCommandProtocol::sendReply( TPCommand aCommand, int aDataSize, void* aData )
+{
+	int iFrameSize, ret;
+	TFBError err;
+
+	if (!isValidCMDID(aCommand))
+		return TCP_INVALIDCMDID;
+	
+	iFrameSize = KMAXFRAMESIZE;
+	err = CFrameBuffer::createSendBuffer( iRand_UID, aCommand, aDataSize, (char*)aData, iFrame, &iFrameSize );
+	if ( err != TFB_SUCCESS)
+		return TCP_ERRCREATINGBUFFER;
+
+	ret = iPort->SendBytes(iFrame, &iFrameSize);
+	if ( ret != 0 )
+		return TCP_ERRSENDINGBYTES;
+
+	return TCP_SUCCESS;
+}
+
+/**********************************************************************************************
+ *
+ * ReceiveMessage
+ *
+ *********************************************************************************************/	
+TCPError CUCCSCommandProtocol::receiveMessage( TPCommand* aCommand, int* aDataLength, void* aData )
+{
+	int res, len;
+	TPHeader header;
+
+	len = sizeof(header);
+
+	// Read the first 12 bytes of header -  the uid, command and the data size.	
+	res = iPort->ReceiveBytes((char*)&header, &len );
+	if ( res != 0 )
+		return TCP_ERRRECVINGBYTES;
+	
+	// Decode the response
+	iRand_UID = header.iUid;        
+	*aCommand = header.iCmdID;       
+	*aDataLength = header.iDataLen; 
+	
+	// Get the rest
+	res = iPort->ReceiveBytes((char*)aData, aDataLength);
+	if ( res != 0 )
+		return TCP_ERRRECVINGBYTES;
+	
+	return TCP_SUCCESS;
+}
+
+/**********************************************************************************************
+ *
+ * Check IDs
+ *
+ *********************************************************************************************/	
+bool CUCCSCommandProtocol::isValidCMDID(TPCommand aCommand)
+{	
+	bool ret_val = true;
+
+	switch (aCommand) 
+	{
+		case CMD_REP_SIGNALID:
+			break;
+
+		case CMD_REP_RENDEZVOUSID:
+			break;
+
+		case CMD_REP_WAITID:
+			break;
+   
+		case CMD_REP_STARTUSECASEID:
+			break;
+
+		case CMD_REP_ENDUSECASEID:
+			break;
+
+		case CMD_REP_GETVARIABLENAMEID:
+			break;
+
+		case CMD_QUITID:
+			break;
+
+		case CMD_REP_RUNCOMMAND:
+			break;
+
+		default:
+			ret_val = false;
+			break;
+   }
+
+	return ret_val;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandProtocol.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CUCCSCommandProtocol Class
+*
+*/
+
+
+
+#ifndef _CUCCSCommandProtocol_H
+#define _CUCCSCommandProtocol_H
+
+/*****************************************************************************
+ *
+ * System Includes 
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Local Includes
+ *
+ ****************************************************************************/
+#include "../Core/UCCS_Interfaces.h"
+#include "CSerialPort.h"
+#include "CConsolePort.h"
+#include "CTcpPort.h"
+#include "CProtocolTypes.h"
+
+/*****************************************************************************
+ *
+ *  Types
+ *
+ ****************************************************************************/
+typedef enum {
+	TCP_SUCCESS,
+	TCP_ERRCREATINGBUFFER,
+	TCP_ERRRECVINGBYTES,
+	TCP_ERRSENDINGBYTES,
+	TCP_INVALIDCMDID,
+	TCP_INVALIDTRANSPORT,
+	TCP_FAILEDTOOPENPORT,
+	TCP_FAILED
+} TCPError;
+
+#define KMAXPORTNAME	64
+#define KMAXFRAMESIZE 1024
+
+/*****************************************************************************
+ *
+ * Class Definition
+ *
+ ****************************************************************************/
+class CUCCSCommandProtocol
+{
+public:
+	CUCCSCommandProtocol();
+	~CUCCSCommandProtocol();
+	
+	TCPError initialise(TRemoteControlTransport aTransport, char* aRemoteHost, IOutput* aOutput);
+	TCPError disconnect();				
+	
+	TCPError sendReply( TPCommand aCommand, int aDataSize, void* aData );
+	TCPError receiveMessage( TPCommand* aCommand, int* aDataLength, void* aData );
+
+private:
+	bool isValidCMDID(TPCommand aCommand);
+
+	CSerialPort iSerialPort;
+	CConsolePort iConsolePort;
+	CTcpPort iTcpPort;
+	IPort* iPort;
+	IOutput* iOutput;
+	int iRand_UID;						// The last recieved UID
+	char iRemoteHost[KMAXPORTNAME];
+	char iFrame[KMAXFRAMESIZE];
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CommandControlErrors.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* LocalIncludes
+*
+*/
+
+
+
+#include "CommandControlErrors.h"
+
+
+/*****************************************************************************
+ *
+ * PUBLIC FUNCTION: GetCommandControlErrorString
+ *
+ ****************************************************************************/
+char *GetCommandControlErrorString( TCommandControlError aErrorCode )
+{
+	switch( aErrorCode ) {
+
+	case EAC_SUCCESS:
+		return "Success";
+
+	case EAC_ERRINITTRANSPORT: 
+		return "Error initialising the transport";
+
+	case EAC_INVALIDPORT:
+		return "Invalid port string";
+
+	case EAC_FAILEDTOOPENPORT:
+		return "Failed to open the port";
+
+	case EAC_INVALIDTRANSPORT:
+		return "Invalid transport requested";
+
+	case EAC_RECEIVEBYTESERROR:
+		return "Error while trying to receive data";
+
+	case EAC_PROCESSINGFAILED:
+		return "Error while trying send reply";
+
+	case EAC_STARTUSECASEFAILED:
+		return "StartUsecase failed";
+
+	case EAC_RENDEZVOUSFAILED:
+		return "Rendezvous failed";
+
+	case EAC_ENDUSECASEFAILED:
+		return "EndUsecase failed";
+
+	case EAC_SCRIPTFAILED:
+		return "Script failed";
+
+	default:
+		return "Unknown error";
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CommandControlErrors.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CommandControlErrors
+*
+*/
+
+
+
+#ifndef __COMMANDCONTROLERRORS_H__
+#define __COMMANDCONTROLERRORS_H__
+
+
+/*****************************************************************************
+ *
+ *  Types
+ *
+ ****************************************************************************/
+typedef enum {
+	EAC_SUCCESS,		
+	EAC_ERRINITTRANSPORT,
+	EAC_INVALIDPORT,
+	EAC_FAILEDTOOPENPORT,
+	EAC_INVALIDTRANSPORT,
+	EAC_RECEIVEBYTESERROR,
+	EAC_PROCESSINGFAILED,
+	EAC_STARTUSECASEFAILED,
+	EAC_RENDEZVOUSFAILED,
+	EAC_ENDUSECASEFAILED,
+	EAC_SCRIPTFAILED,
+	EAC_QUIT
+} TCommandControlError;
+
+
+/*****************************************************************************
+ *
+ * Prototypes
+ *
+ ****************************************************************************/
+char *GetCommandControlErrorString( TCommandControlError aErrorCode );
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/HOWTO_AddService.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,22 @@
+
+ -- Adding Services to the UCCS --
+
+1.	The rest assumes you have written some client class for the service. This client can have
+	any arbitrary interface.
+	
+2.	Create a subdirectory and put all your service files in there.
+
+3.	Add the rpcgen files, etc.
+
+4.	Check that everything compiles and that you don't need to add libraries, include paths, etc.
+
+5.	Create a new object to be the service interface object. This must inherit and implement
+	the IService interface.
+	
+6.	Implement this class -- use existing classes as a guide.
+
+7.	Add a new RPC Service ID.
+
+8.	Add to the service table.
+
+9.	Add startup / shutdown code to the service manager for this service. 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/SCRIPT_Commands.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,80 @@
+
+ --**-- Quick reference guide for UCCS Commands (more for programmers) --**--
+
+
+(2) UC_QUIT
+
+Stops the script thread. It sets a flag which prevents the remote control from 
+waiting on the rendezvous semaphore again (since it will block forever) and
+signals the rendezvous semaphore to release it if that's where it is now. This
+does not stop the use-case -- it will keep running until the device side runs
+end use case. 
+
+
+(3) UC_RUNCMD
+
+Runs the command. Does lots of stuff.
+
+
+(4) UC_ASSIGN
+
+Adds the specified elements to the environment object. This is then used by the
+parser in future commands.
+
+
+(5) UC_WAITFOR
+
+Waits for fields of the last reply to be at a certain value. It checks the value
+of the fields, and if they are not equal then it goes back to the last runcmd
+and runs all subsequent commands.
+
+FIXME: need to check what happens if there haven't been any runcmd's yet -- both
+in the case that this is the first command, and when this is not the first but
+the previous are all non-runcmd
+
+
+(6) UC_WAITFORSIGNAL
+
+Waits for a signal from the device
+
+
+(7) UC_RENDEZVOUS
+
+Rendezvous with the device
+
+
+(8) UC_REQUIRE
+
+Require a field to be a particular value. If the field is not correct then this is equivalent
+to a quit command.
+
+
+(9)	UC_REQUIRENOT
+
+Same as above however the logical not
+
+
+(10) UC_CHECK
+
+Checks that a field is a particular value. It differs from require in that if the condition
+is not met, the script continues to run, however, a warning is output.
+
+
+(11) UC_CHECKNOT
+
+Logical not of the above operation.
+
+
+(12) UC_PRINTENVIRONMENT
+
+Prints out all the environment variables.
+
+
+(13) UC_WAITFORNOT
+
+Same as waitfor but not.
+
+
+(14) UC_SIGNAL
+
+Signal to device.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/CommonServiceStub/CServiceAgentBase.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,359 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* System Includes
+*
+*/
+
+
+
+#include <assert.h>
+#include <winsock2.h>
+#include <rpc/rpc.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CServiceAgentBase.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+#include "../../../SocketLibrary/socket_helper.h"
+#include "../../../include/penstd.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXBUFFERSIZE	2048
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CServiceAgentBase::CServiceAgentBase()
+{
+}
+
+
+CServiceAgentBase::~CServiceAgentBase()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * SECTION: Methods to construct and manipulated the reply
+ *
+ ******************************************************************************/
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: CreateBaseReply -- IService::IssueCommand() is required to
+ * return a valid request reply record. This record MUST MUST MUST contain a
+ * set of basic fields. This method creates _all_ the basic fields, some will 
+ * have to be updated later.
+ *
+ ******************************************************************************/
+CDataRecord *CServiceAgentBase::CreateBaseReply( CDataRecord *aRequest )
+{
+	CDataRecord *service_request_reply;
+	int err;
+	int service_id;
+	int method_id; 
+	char *service_host;
+	char *service_name;
+	char *call;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create the reply object
+	service_request_reply = new CDataRecord();
+	assert( service_request_reply != NULL );
+
+	// get the service name
+	err = aRequest->GetFieldAsString( "SVCNAME", &service_name );
+	if( err != UCCS_OK )
+	{
+		// If the service name does not exist then resort to the legacy method
+
+		// get the service id
+		err = aRequest->GetFieldAsInt( "SVCID", &service_id );
+		assert( err == UCCS_OK );
+		err = aRequest->GetFieldAsString( "SVCHOST", &service_host );
+		assert( err == UCCS_OK );
+		service_request_reply->NewField( STD_REPLY_FIELD_SERVICE_ID, service_id );
+		service_request_reply->NewField( STD_REPLY_FIELD_SERVICE_HOST, service_host );
+	}
+	else
+	{
+		service_request_reply->NewField( STD_REPLY_FIELD_SERVICE_NAME, service_name );
+	}
+
+	// get the methodid -- default to -1 if not there -- error must be caught by caller
+	method_id = -1;
+	aRequest->GetFieldAsInt( "METHODID", &method_id );
+
+	// now set all the values
+	service_request_reply->NewField( STD_REPLY_FIELD_METHODID, method_id );
+	service_request_reply->NewField( STD_REPLY_FIELD_REQUESTCOMPLETIONCODE, ERR_INVALID_ERROR_CODE);
+	service_request_reply->NewField( STD_REPLY_FIELD_REQUESTCOMPLETIONDESC, GetPenstdErrorString(ERR_INVALID_ERROR_CODE) );
+
+	// Check to see if this request is a new generic stub call and log the CALL value
+	err = aRequest->GetFieldAsString( "CALL", &call );
+	if( err == UCCS_OK )
+	{
+		service_request_reply->NewField( STD_REPLY_FIELD_CALL, call );
+	}
+
+	return service_request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: UpdateCompletionCode
+ *
+ ******************************************************************************/
+void CServiceAgentBase::UpdateCompletionCode( CDataRecord *aReply, int aError )
+{
+	int completion_code, err, rpc_error_int;
+	char *rpc_error_string;
+
+	// verify params
+	assert( aReply != NULL );
+
+	// a reply can only have it's completion code set once 
+	err = aReply->GetFieldAsInt( "REQUESTCOMPLETIONCODE", &completion_code );
+	assert( err == UCCS_OK );
+	assert( completion_code == ERR_INVALID_ERROR_CODE );
+
+	// now update the record
+	err = aReply->ChangeFieldData( STD_REPLY_FIELD_REQUESTCOMPLETIONCODE, aError );
+	assert( err == UCCS_OK );
+	err = aReply->ChangeFieldData( STD_REPLY_FIELD_REQUESTCOMPLETIONDESC, GetPenstdErrorString(aError) );
+	assert( err == UCCS_OK );
+
+	// add any custom fields
+	if( aError == ERR_RPC_ERROR ) {
+		rpc_error_string = GetLastRPCError( &rpc_error_int );
+		aReply->NewField( "RPC_ERROR_STRING", rpc_error_string );
+		aReply->NewField( "RPC_ERROR_INT", rpc_error_int );
+	}
+}
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: GetLastRPCError
+ *
+ ******************************************************************************/
+char *CServiceAgentBase::GetLastRPCError( int *aIntError )
+{
+	*aIntError = NULL;
+	return "(unimplemented)";
+}
+
+
+/*******************************************************************************
+ *
+ * SECTION: Stub Helpers
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: GetStringArgument
+ *
+ ******************************************************************************/
+int CServiceAgentBase::GetStringArgument( char *aFieldName, char **aOutput, int aParamIndex, int aOptional, CDataRecord *aRequest, CDataRecord *aReply )
+{
+	int err;
+
+	// check params
+	assert( aFieldName != NULL );
+	assert( aOutput != NULL );
+
+	// get the field 
+	err = aRequest->GetFieldAsString( aFieldName, aOutput );
+
+	// if missing and optional then ok -- DEFAULT IS ALWAYS BE NULL
+	if( (err != UCCS_OK) && (aOptional != 0) ) {
+		*aOutput = NULL;
+		return 0;
+	}
+
+	// otherwise a missing value is not allowed
+	if( err != UCCS_OK ) {
+		aReply->NewField( "MISSINGPARAMINDEX", aParamIndex );
+		UpdateCompletionCode( aReply, ERR_MISSING_PARAMETER );
+		return -1;
+	}
+		
+	// otherwise return OK
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: GetIntegerArgument
+ *
+ ******************************************************************************/
+int CServiceAgentBase::GetIntegerArgument( char *aFieldName, int *aOutput, int aParamIndex, int aOptional, CDataRecord *aRequest, CDataRecord *aReply )
+{
+	int err;
+
+	// check params
+	assert( aFieldName != NULL );
+	assert( aOutput != NULL );
+
+	// get the field 
+	err = aRequest->GetFieldAsInt( aFieldName, aOutput );
+
+	// if missing and optional then ok -- DEFAULT MUST ALWAYS BE NULL
+	if( (err != UCCS_OK) && (aOptional != 0) ) {
+		*aOutput = NULL;
+		return 0;
+	}
+
+	// otherwise a missing value is not allowed
+	if( err != UCCS_OK ) {
+		aReply->NewField( "MISSINGPARAMINDEX", aParamIndex );
+		UpdateCompletionCode( aReply, ERR_MISSING_PARAMETER );
+		return -1;
+	}
+		
+	// otherwise return OK
+	return 0;
+}
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: AddIteratedIntegerFieldName
+ *
+ ******************************************************************************/
+void CServiceAgentBase::AddIteratedIntegerFieldName( char *aFieldname, int aIndex, int aValue, CDataRecord *aReply )
+{
+	int err;
+	char fieldname[MAXBUFFERSIZE];
+
+	sprintf( fieldname, "%s_%d", aFieldname, aIndex );
+	err = aReply->NewField( fieldname, aValue );
+	assert( err == UCCS_OK );
+}
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: AddIteratedStringFieldName
+ *
+ ******************************************************************************/
+void CServiceAgentBase::AddIteratedStringFieldName( char *aFieldname, int aIndex, char *aValue, CDataRecord *aReply )
+{
+	int err;
+	char fieldname[MAXBUFFERSIZE];
+
+	sprintf( fieldname, "%s_%d", aFieldname, aIndex );
+	err = aReply->NewField( fieldname, aValue );
+	assert( err == UCCS_OK );
+}
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: AddressToInt
+ *
+ ******************************************************************************/
+int CServiceAgentBase::AddressToInt( char *aAddress )
+{
+	int is_ip, addr;
+	struct hostent *hostname;
+
+	// see if this is an IP address - if so then convert it and return
+	is_ip = is_ip_address( aAddress );
+	if( is_ip != 0 ) {
+		return inet_addr(aAddress);
+	}
+
+	// otherwise try and resolve it as a hostname (must be ipv4)
+	hostname = gethostbyname( aAddress );
+	if( hostname != NULL ) {
+		if( hostname->h_length == 4 ) {
+			addr = *((int*)(hostname->h_addr));
+			return addr;
+		}
+	}
+
+	// if this doesn't work then we just send zero to let if fail
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: IntToAddress
+ *
+ ******************************************************************************/
+char *CServiceAgentBase::IntToAddress( int aAddr )
+{
+	int haddr = ntohl(aAddr);
+	sprintf( iAddressString, "%d.%d.%d.%d", ((haddr>>24)&0x000000FF),
+		((haddr>>16)&0x000000FF),
+		((haddr>>8)&0x000000FF),
+		((haddr>>0)&0x000000FF) );
+	return iAddressString;
+}
+
+
+/*******************************************************************************
+ *
+ * PROTECTED METHOD: XdrFree
+ *
+ ******************************************************************************/
+void CServiceAgentBase::XdrFree( char **ptr, int *len )
+{
+	XDR x;
+
+	// check params
+	assert( ptr != NULL );
+	assert( *ptr!= NULL );
+	assert( len != NULL );
+
+	// set the operation
+	x.x_op = XDR_FREE;
+
+	// now call the free function
+	xdr_bytes( &x, ptr, len, 0xFFFFFFFF );
+
+	// done
+	*ptr = NULL;
+	*len = 0;
+	return;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/CommonServiceStub/CServiceAgentBase.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* CServiceAgentBase
+*
+*/
+
+
+
+#ifndef __CSERVICEAGENTBASE_H__
+#define __CSERVICEAGENTBASE_H__
+
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <rpc/rpc.h>
+#include <rpc/types.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../../Core/UCCS_ServiceValues.h"
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+#define GETSTRINGARGUMENT(field,token,index,optional,request,reply)		{	int _err; \
+																			_err = GetStringArgument(field,token,index,optional,request,reply); \
+																			if( _err != 0 ) \
+																				break; \
+																		}
+
+
+#define GETINTEGERARGUMENT(fieldname,var,index,optional,request,reply)		{	int _err; \
+						 														_err = GetIntegerArgument(fieldname,var,index,optional,request,reply); \
+																				if( _err != 0 ) \
+																					break; \
+																			}
+
+
+#define SETINTEGERRESULT( client_call_result, success_value, result, request)			{	int _err; \
+																							if( client_call_result == success_value ) { \
+																								_err = request->NewField( "RESULT", result ); \
+																								assert( _err == UCCS_OK ); \
+																							} \
+																						} 
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define STD_REPLY_FIELD_SERVICE_ID					"SVCID"
+#define STD_REPLY_FIELD_SERVICE_HOST				"SVCHOST"
+#define STD_REPLY_FIELD_SERVICE_NAME				"SVCNAME"
+#define STD_REPLY_FIELD_METHODID					"METHODID"
+#define STD_REPLY_FIELD_CALL						"CALL"
+#define STD_REPLY_FIELD_REQUESTCOMPLETIONCODE		"REQUESTCOMPLETIONCODE"
+#define STD_REPLY_FIELD_REQUESTCOMPLETIONDESC		"REQUESTCOMPLETIONDESC"
+
+#define STD_REPLY_FIELD_RESULT						"RESULT"
+
+
+/*******************************************************************************
+ *
+ * CServiceAgentBase
+ *
+ ******************************************************************************/
+class CServiceAgentBase
+{
+public:
+	CServiceAgentBase();
+	~CServiceAgentBase();
+
+protected:
+
+	// Stateless data transformers
+	char *IntToAddress( int aAddr );
+	int AddressToInt( char *aAddress );
+
+	// Extract named arguments from a record 
+	int GetStringArgument( char *aFieldName, char **aOutput, int aParamIndex, int aOptional, CDataRecord *aRequest, CDataRecord *aReply );
+	int GetIntegerArgument( char *aFieldName, int *aOutput, int aParamIndex, int aOptional, CDataRecord *aRequest, CDataRecord *aReply );
+
+	// Add return values to reply record
+	void AddIteratedIntegerFieldName( char *aFieldname, int aIndex, int aValue, CDataRecord *aReply );
+	void AddIteratedStringFieldName( char *aFieldname, int aIndex, char *aValue, CDataRecord *aReply );
+
+	// Update the standard fields of a reply record
+	CDataRecord *CreateBaseReply( CDataRecord *aRequest );
+	void UpdateCompletionCode( CDataRecord *aReply, int aPenStdErrorCode );
+	virtual char *GetLastRPCError( int *aRpcErrorInt );
+
+	// Misc helpers
+	void XdrFree( char **ptr, int *len );
+
+private:
+//	void AddCompletionCodeDesc( CDataRecord *aReply, TRequestCompletionCode aResult );
+	char iAddressString[32];
+};
+
+#endif //__CSERVICEAGENTBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CCFacontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,646 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCFacontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCFacontroller::CCFacontroller()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCFacontroller::~CCFacontroller()
+{
+	assert( cl == NULL );
+}
+
+char *CCFacontroller::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCFacontroller::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), FACONTROLLER, FACONTROLLER_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCFacontroller::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCFacontroller::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCFacontroller::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCFacontroller::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+int CCFacontroller::cstr_createagent( TResult *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_createagent_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+int CCFacontroller::dstr_removeagent( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removeagent_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+int CCFacontroller::startmobileagent( TStartAgentRequest aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *startmobileagent_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+int CCFacontroller::stopmobileagent( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopmobileagent_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+int CCFacontroller::getmobileagentstatus( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getmobileagentstatus_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+int CCFacontroller::setsingleoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setsingleoption_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+int CCFacontroller::removesingleoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *removesingleoption_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+int CCFacontroller::addlistoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *addlistoption_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+int CCFacontroller::removelistoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *removelistoption_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+int CCFacontroller::getstatus( int aArgs, TFaStatusInfo *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getstatus_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: destroytunnelid
+ * 
+ ***************************************************************************************/
+int CCFacontroller::destroytunnelid( TFaTunnelID aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *destroytunnelid_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listtunnels
+ * 
+ ***************************************************************************************/
+int CCFacontroller::listtunnels( int aArgs, TFaTunnelList *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *listtunnels_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: gettunnelinfo
+ * 
+ ***************************************************************************************/
+int CCFacontroller::gettunnelinfo( TGetTunnelRequest aArgs, TFaTunnelInfo *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *gettunnelinfo_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+int CCFacontroller::settimeout( TTimeoutRequest aArgs )
+{
+	struct rpc_err rerr;
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	settimeout_7( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CCFacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCFACONTROLLER_H__
+#define __CCFACONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "facontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCFacontroller
+ * 
+ ***************************************************************************************/
+class CCFacontroller
+{
+public:
+	// standard methods
+	CCFacontroller();
+	~CCFacontroller();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int cstr_createagent( TResult *rv );
+	int dstr_removeagent( int aArgs, int *rv );
+	int startmobileagent( TStartAgentRequest aArgs, TResult *rv );
+	int stopmobileagent( int aArgs, TResult *rv );
+	int getmobileagentstatus( int aArgs, TResult *rv );
+	int setsingleoption( TOptionDesc aArgs, TResult *rv );
+	int removesingleoption( TOptionDesc aArgs, TResult *rv );
+	int addlistoption( TOptionDesc aArgs, TResult *rv );
+	int removelistoption( TOptionDesc aArgs, TResult *rv );
+	int getstatus( int aArgs, TFaStatusInfo *rv );
+	int destroytunnelid( TFaTunnelID aArgs, TResult *rv );
+	int listtunnels( int aArgs, TFaTunnelList *rv );
+	int gettunnelinfo( TGetTunnelRequest aArgs, TFaTunnelInfo *rv );
+	int settimeout( TTimeoutRequest aArgs );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CForeignAgentServiceStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,558 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+#include <time.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "strncpynt.h"
+#include "CForeignAgentServiceStub.h"
+#include "CCFacontroller.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXBUFFERSIZE	2048
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CForeignAgentServiceStub::CForeignAgentServiceStub()
+{
+	iClientForeignAgent = new CCFacontroller();
+	assert( iClientForeignAgent != NULL );
+}
+
+
+CForeignAgentServiceStub::~CForeignAgentServiceStub()
+{
+	delete iClientForeignAgent;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CForeignAgentServiceStub::StartUccsService( char *aHostName, int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	// check params
+	assert( aHostName != NULL );
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+	
+	//copy to class variable so that startRPCservice can use it later on
+	iHostName = aHostName;
+
+	// connect to the remote service
+	client_stub_error = iClientForeignAgent->Connect( iHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CForeignAgentServiceStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+
+	// check params
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iClientForeignAgent->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CForeignAgentServiceStub::IssueCommand( CDataRecord* aRequest )
+{
+	int i, err, client_stub_error, method_id = -1;
+	CDataRecord *request_reply;
+	char *tmp_string;
+
+	int rv_integer, sarg_integer;
+	TComponentList rv_component_list;
+	TOptionDesc sarg_option;
+	TResult rv_result;
+	TStartupInfo sarg_startup_info;
+	TFaStatusInfo rv_fastatus;
+	TFaTunnelID sarg_tunnel_id;
+	TFaTunnelList rv_tunnel_list;
+	TTimeoutRequest sarg_timeout;
+	TStartAgentRequest sarg_start_agent_request;
+	TFaTunnelID *tmp_tunnel_id;
+	TGetTunnelRequest sarg_get_tunnel;
+	TFaTunnelInfo rv_tunnel_info;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+		
+		// extract the parameters
+		GETINTEGERARGUMENT( "BASEINTERFACEINDEX", &(sarg_startup_info.iBaseInterfaceIndex), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "NETMASK", &(sarg_startup_info.iNetworkMask), 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "STARTHOSTADDRESSRANGE", &(sarg_startup_info.iStartHostAddressRange), 3, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "STOPHOSTADDRESSRANGE", &(sarg_startup_info.iStopHostAddressRange), 4, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->ss_startuprpcservice( sarg_startup_info, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2:
+			
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+		
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// list_devices
+	case 30:
+
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "AGENTCOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "AGENTID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;		
+
+	// cstr_createagent
+	case 31:
+
+		//make the call and update the return value
+		client_stub_error = iClientForeignAgent->cstr_createagent( &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// dstr_removeagent
+	case 32:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientForeignAgent->dstr_removeagent( sarg_integer, &rv_integer ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// startmobileagent
+	case 3:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_start_agent_request.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "INTERFACE", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_start_agent_request.iLowerInterface, tmp_string, X_MAXINTERFACENAMESIZE );
+		GETINTEGERARGUMENT( "SOLICITATIONMODE", (int*)&(sarg_start_agent_request.iSolicitationMode), 3, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "INTERVAL", &(sarg_start_agent_request.iSolicitationInterval), 4, 1, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientForeignAgent->startmobileagent( sarg_start_agent_request, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// stopmobileagent
+	case 4: 
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientForeignAgent->stopmobileagent( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		break;
+
+	// getmobileagentstatus
+	case 5:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->getmobileagentstatus( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "FOREIGN_AGENT_PROCESS_STATUS", rv_result.iData0 );
+		break;
+
+	// setsingleoption
+	case 6:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "VALUE", &tmp_string, 3, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionValue, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionBlockStart[0] = sarg_option.iOptionBlockEnd[0] = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->setsingleoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// removesingleoption
+	case 33:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionValue[0] = sarg_option.iOptionBlockStart[0] = sarg_option.iOptionBlockEnd[0] = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->removesingleoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// addlistoption
+	case 7:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "VALUE", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionValue, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKSTART", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockStart, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKEND", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockEnd, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionToken[0] = 0;
+	
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->addlistoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// removelistoption
+	case 8:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKSTART", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockStart, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKEND", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockEnd, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionValue[0] = 0;
+	
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->removelistoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// getstatus
+	case 9:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientForeignAgent->getstatus( sarg_integer, &rv_fastatus ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_fastatus.iCallResult.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_fastatus.iCallResult.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_fastatus.iCallResult.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_fastatus.iCallResult.iData1 );
+		request_reply->NewField( "STATUS_ADVERTISEMENTS_SENT", rv_fastatus.iAdvertisementsSent );
+		request_reply->NewField( "STATUS_DISCARDED_MALFORMED", rv_fastatus.iDiscardedMalformed );
+		request_reply->NewField( "STATUS_DISCARDED_UNKNOWN_EXTENSION", rv_fastatus.iDiscardedUnknownExtension );
+		request_reply->NewField( "STATUS_DISCARDED_VENDOR", rv_fastatus.iDiscardedVendor );
+		request_reply->NewField( "STATUS_PENDING_REGISTRATION_REQUESTS", rv_fastatus.iPendingRegistrationRequests );
+		request_reply->NewField( "STATUS_REPLYS_ACCEPTED", rv_fastatus.iReplysAccepted );
+		request_reply->NewField( "STATUS_REPLYS_REJECTED", rv_fastatus.iReplysRejected );
+		request_reply->NewField( "STATUS_REQUESTS_ACCEPTED", rv_fastatus.iRequestsAccepted );
+		request_reply->NewField( "STATUS_REQUESTS_REJECTED", rv_fastatus.iRequestsRejected );
+		request_reply->NewField( "STATUS_TUNNEL_COUNT", rv_fastatus.iTunnelCount );
+		break;
+		
+
+	// destroytunnelid
+	case 11:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_tunnel_id.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "MNADDR", &tmp_string, 2, 0, aRequest, request_reply );
+		sarg_tunnel_id.iMobileNodeAddress = AddressToInt( tmp_string );
+
+		// make the call
+		client_stub_error = iClientForeignAgent->destroytunnelid( sarg_tunnel_id, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+
+	// listtunnels
+	case 12:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientForeignAgent->listtunnels( sarg_integer, &rv_tunnel_list ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "TUNNEL_COUNT", rv_tunnel_list.TFaTunnelList_len );
+		for( i = 0; i < (signed)(rv_tunnel_list.TFaTunnelList_len); i++ ) {
+			tmp_tunnel_id = &((rv_tunnel_list.TFaTunnelList_val)[i]);
+			AddIteratedIntegerFieldName( "TUNNEL_ID", i, tmp_tunnel_id->iID, request_reply );
+			AddIteratedStringFieldName( "TUNNEL_MOBILE_NODE_HOME_ADDRESS", i, IntToAddress(tmp_tunnel_id->iMobileNodeAddress), request_reply );
+			AddIteratedStringFieldName( "TUNNEL_HOME_AGENT_ADDRESS", i, IntToAddress(tmp_tunnel_id->iHomeAgentAddress), request_reply );
+		}		
+
+		// free the memory (if any was allocated)
+		if( rv_tunnel_list.TFaTunnelList_len > 0 ) {
+			XdrFree( (char**)&(rv_tunnel_list.TFaTunnelList_val), (int*)&(rv_tunnel_list.TFaTunnelList_len) );
+		}
+		break;
+
+	// settimeout
+	case 13:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_timeout.iAgentID), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "TIMEOUT", &(sarg_timeout.iTimeout), 2, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientForeignAgent->settimeout( sarg_timeout ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+		break;
+
+	// gettunnelinfo
+	case 15:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_get_tunnel.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "MOBILE_NODE_HOME_ADDRESS", &tmp_string, 2, 0, aRequest, request_reply );
+		sarg_get_tunnel.iMobileNodeAddress = AddressToInt( tmp_string );
+
+		//make the call and update the return value
+		client_stub_error = iClientForeignAgent->gettunnelinfo( sarg_get_tunnel, &rv_tunnel_info ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the result
+		request_reply->NewField( "RESULT", rv_tunnel_info.iCallResult.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_tunnel_info.iCallResult.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_tunnel_info.iCallResult.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_tunnel_info.iCallResult.iData1 );
+		request_reply->NewField( "MOBILE_NODE_ADDRESS", IntToAddress(rv_tunnel_info.iMobileNodeAddress) );
+		request_reply->NewField( "CAREOF_ADDRESS", IntToAddress(rv_tunnel_info.iCareofAddress) );
+		request_reply->NewField( "HOME_AGENT_ADDRESS", IntToAddress(rv_tunnel_info.iHomeAgentAddress) );
+		request_reply->NewField( "CREATION_TIME", ctime((time_t*)&(rv_tunnel_info.iCreationTime)) );
+		request_reply->NewField( "EXPIRATION_TIME", ctime((time_t*)&(rv_tunnel_info.iExpirationTime)) );
+		request_reply->NewField( "REFRESH_TIME", ctime((time_t*)&(rv_tunnel_info.iRefreshTime)) );
+		request_reply->NewField( "LAST_TIMESTAMP", ctime((time_t*)&(rv_tunnel_info.iLastTimestamp)) );
+		request_reply->NewField( "HOME_AGENT_ID", rv_tunnel_info.iPrivateHomeAgentID );
+		request_reply->NewField( "SPI", rv_tunnel_info.iSPI );
+		request_reply->NewField( "TIMEOUT", rv_tunnel_info.iTimeout );
+		break;
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CForeignAgentServiceStub::GetLastRPCError( int *aIntError )
+{
+	return iClientForeignAgent->GetLastRPCError( aIntError );
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CForeignAgentServiceStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CForeignAgentServiceStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CForeignAgentServiceStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CFOREIGNAGENTSERVICESTUB_H__
+#define __CFOREIGNAGENTSERVICESTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration. 
+ *
+ ******************************************************************************/
+class CCFacontroller;
+
+
+/*******************************************************************************
+ *
+ * CForeignAgentServiceStub
+ *
+ ******************************************************************************/
+class CForeignAgentServiceStub : public IService, public CServiceAgentBase
+{
+public:
+	CForeignAgentServiceStub();
+	~CForeignAgentServiceStub();
+
+	int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError );
+	int StopUccsService( int *aLocalerror, int *aRemoteError );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCFacontroller *iClientForeignAgent;
+	char* iHostName;
+};
+
+#endif //__CFOREIGNAGENTSERVICESTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,398 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __FACONTROLLER_H__
+#define __FACONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TComponentList(...);
+}
+#else
+bool_t xdr_facontroller_TComponentList();
+#endif
+
+#define X_MAXOPTIONTOKENSIZE 512
+#define X_MAXINTERFACENAMESIZE 64
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_DYNAMICS_CALL_FAILED -107
+#define ERR_CONFIG_FILE_ERROR -108
+#define ERR_POLICY_OUTPUT_PARSING_FAILED -110
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_NO_MORE_INTERFACES -112
+#define ERR_CREATE_INTERFACE_ERROR -113
+#define ERR_DESTROY_INTERFACE_ERROR -114
+#define ERR_INTEGER_ALLOCATOR_SETUP_ERROR -115
+
+enum TSoliticationMode {
+	SM_SEND_NEVER = -1,
+	SM_SEND_IN_RESPONSE_TO_SOLICITATION_ONLY = 0,
+	SM_SEND_REGULAR = 1,
+};
+typedef enum TSoliticationMode TSoliticationMode;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TSoliticationMode(...);
+}
+#else
+bool_t xdr_facontroller_TSoliticationMode();
+#endif
+
+
+struct TStartupInfo {
+	int iBaseInterfaceIndex;
+	int iNetworkMask;
+	int iStartHostAddressRange;
+	int iStopHostAddressRange;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TStartupInfo(...);
+}
+#else
+bool_t xdr_facontroller_TStartupInfo();
+#endif
+
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TResult(...);
+}
+#else
+bool_t xdr_facontroller_TResult();
+#endif
+
+
+struct TOptionDesc {
+	int iAgentID;
+	char iOptionFilename[X_MAXOPTIONTOKENSIZE];
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+typedef struct TOptionDesc TOptionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TOptionDesc(...);
+}
+#else
+bool_t xdr_facontroller_TOptionDesc();
+#endif
+
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+typedef struct TTimeoutRequest TTimeoutRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TTimeoutRequest(...);
+}
+#else
+bool_t xdr_facontroller_TTimeoutRequest();
+#endif
+
+
+struct TGetTunnelRequest {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+typedef struct TGetTunnelRequest TGetTunnelRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TGetTunnelRequest(...);
+}
+#else
+bool_t xdr_facontroller_TGetTunnelRequest();
+#endif
+
+
+struct TStartAgentRequest {
+	int iAgentID;
+	char iLowerInterface[X_MAXINTERFACENAMESIZE];
+	TSoliticationMode iSolicitationMode;
+	int iSolicitationInterval;
+};
+typedef struct TStartAgentRequest TStartAgentRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TStartAgentRequest(...);
+}
+#else
+bool_t xdr_facontroller_TStartAgentRequest();
+#endif
+
+
+struct TFaStatusInfo {
+	TResult iCallResult;
+	int iTunnelCount;
+	int iPendingRegistrationRequests;
+	int iRequestsRejected;
+	int iRequestsAccepted;
+	int iReplysAccepted;
+	int iReplysRejected;
+	int iDiscardedUnknownExtension;
+	int iDiscardedMalformed;
+	int iDiscardedVendor;
+	int iAdvertisementsSent;
+};
+typedef struct TFaStatusInfo TFaStatusInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaStatusInfo(...);
+}
+#else
+bool_t xdr_facontroller_TFaStatusInfo();
+#endif
+
+
+struct TFaTunnelID {
+	int iAgentID;
+	int iMobileNodeAddress;
+	int iHomeAgentAddress;
+	int iID;
+};
+typedef struct TFaTunnelID TFaTunnelID;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaTunnelID(...);
+}
+#else
+bool_t xdr_facontroller_TFaTunnelID();
+#endif
+
+
+struct TFaTunnelInfo {
+	TResult iCallResult;
+	u_int iMobileNodeAddress;
+	u_int iCareofAddress;
+	u_int iHomeAgentAddress;
+	int iPrivateHomeAgentID;
+	int iCreationTime;
+	int iExpirationTime;
+	int iRefreshTime;
+	int iLastTimestamp;
+	int iSPI;
+	int iTimeout;
+};
+typedef struct TFaTunnelInfo TFaTunnelInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaTunnelInfo(...);
+}
+#else
+bool_t xdr_facontroller_TFaTunnelInfo();
+#endif
+
+
+typedef struct {
+	u_int TFaTunnelList_len;
+	TFaTunnelID *TFaTunnelList_val;
+} TFaTunnelList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaTunnelList(...);
+}
+#else
+bool_t xdr_facontroller_TFaTunnelList();
+#endif
+
+
+#define FACONTROLLER ((u_long)0x34630207)
+#define FACONTROLLER_VERSION ((u_long)7)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_7( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_7();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_7( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_7();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_7( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_7();
+#endif /* __cplusplus */
+#define CSTR_CREATEAGENT ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_createagent_7( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_createagent_7();
+#endif /* __cplusplus */
+#define DSTR_REMOVEAGENT ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removeagent_7( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removeagent_7();
+#endif /* __cplusplus */
+#define STARTMOBILEAGENT ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *startmobileagent_7( TStartAgentRequest * arg, CLIENT *cl );
+}
+#else
+extern TResult *startmobileagent_7();
+#endif /* __cplusplus */
+#define STOPMOBILEAGENT ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopmobileagent_7( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopmobileagent_7();
+#endif /* __cplusplus */
+#define GETMOBILEAGENTSTATUS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getmobileagentstatus_7( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getmobileagentstatus_7();
+#endif /* __cplusplus */
+#define SETSINGLEOPTION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setsingleoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *setsingleoption_7();
+#endif /* __cplusplus */
+#define REMOVESINGLEOPTION ((u_long)33)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removesingleoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removesingleoption_7();
+#endif /* __cplusplus */
+#define ADDLISTOPTION ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *addlistoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *addlistoption_7();
+#endif /* __cplusplus */
+#define REMOVELISTOPTION ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removelistoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removelistoption_7();
+#endif /* __cplusplus */
+#define GETSTATUS ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TFaStatusInfo *getstatus_7( int * arg, CLIENT *cl );
+}
+#else
+extern TFaStatusInfo *getstatus_7();
+#endif /* __cplusplus */
+#define DESTROYTUNNELID ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *destroytunnelid_7( TFaTunnelID * arg, CLIENT *cl );
+}
+#else
+extern TResult *destroytunnelid_7();
+#endif /* __cplusplus */
+#define LISTTUNNELS ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern TFaTunnelList *listtunnels_7( int * arg, CLIENT *cl );
+}
+#else
+extern TFaTunnelList *listtunnels_7();
+#endif /* __cplusplus */
+#define GETTUNNELINFO ((u_long)15)
+#ifdef __cplusplus
+extern "C" {
+extern TFaTunnelInfo *gettunnelinfo_7( TGetTunnelRequest * arg, CLIENT *cl );
+}
+#else
+extern TFaTunnelInfo *gettunnelinfo_7();
+#endif /* __cplusplus */
+#define SETTIMEOUT ((u_long)13)
+#ifdef __cplusplus
+extern "C" {
+extern void *settimeout_7( TTimeoutRequest * arg, CLIENT *cl );
+}
+#else
+extern void *settimeout_7();
+#endif /* __cplusplus */
+
+#endif /* __FACONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../facontroller/facontroller.x"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "facontroller.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_7(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_facontroller_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_7(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_7(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_facontroller_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+cstr_createagent_7(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_CREATEAGENT, xdr_void, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+dstr_removeagent_7(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEAGENT, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+startmobileagent_7(argp, clnt)
+	TStartAgentRequest *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STARTMOBILEAGENT, xdr_facontroller_TStartAgentRequest, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+stopmobileagent_7(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPMOBILEAGENT, xdr_int, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+getmobileagentstatus_7(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETMOBILEAGENTSTATUS, xdr_int, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+setsingleoption_7(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETSINGLEOPTION, xdr_facontroller_TOptionDesc, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+removesingleoption_7(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, REMOVESINGLEOPTION, xdr_facontroller_TOptionDesc, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+addlistoption_7(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ADDLISTOPTION, xdr_facontroller_TOptionDesc, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+removelistoption_7(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, REMOVELISTOPTION, xdr_facontroller_TOptionDesc, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TFaStatusInfo *
+getstatus_7(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TFaStatusInfo res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETSTATUS, xdr_int, argp, xdr_facontroller_TFaStatusInfo, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+destroytunnelid_7(argp, clnt)
+	TFaTunnelID *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DESTROYTUNNELID, xdr_facontroller_TFaTunnelID, argp, xdr_facontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TFaTunnelList *
+listtunnels_7(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TFaTunnelList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LISTTUNNELS, xdr_int, argp, xdr_facontroller_TFaTunnelList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TFaTunnelInfo *
+gettunnelinfo_7(argp, clnt)
+	TGetTunnelRequest *argp;
+	CLIENT *clnt;
+{
+	static TFaTunnelInfo res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETTUNNELINFO, xdr_facontroller_TGetTunnelRequest, argp, xdr_facontroller_TFaTunnelInfo, &res, TIMEOUT);
+	return (&res);
+}
+
+
+void *
+settimeout_7(argp, clnt)
+	TTimeoutRequest *argp;
+	CLIENT *clnt;
+{
+	static char res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETTIMEOUT, xdr_facontroller_TTimeoutRequest, argp, xdr_void, &res, TIMEOUT);
+	return ((void *)&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,307 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "facontroller.h"
+
+
+bool_t
+xdr_facontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TSoliticationMode(xdrs, objp)
+	XDR *xdrs;
+	TSoliticationMode *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceIndex)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iNetworkMask)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iStartHostAddressRange)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iStopHostAddressRange)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iServiceResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSubComponentResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData0)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData1)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TOptionDesc(xdrs, objp)
+	XDR *xdrs;
+	TOptionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionFilename, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionToken, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionValue, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockStart, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockEnd, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TTimeoutRequest(xdrs, objp)
+	XDR *xdrs;
+	TTimeoutRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TGetTunnelRequest(xdrs, objp)
+	XDR *xdrs;
+	TGetTunnelRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TStartAgentRequest(xdrs, objp)
+	XDR *xdrs;
+	TStartAgentRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iLowerInterface, X_MAXINTERFACENAMESIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_facontroller_TSoliticationMode(xdrs, &objp->iSolicitationMode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSolicitationInterval)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaStatusInfo(xdrs, objp)
+	XDR *xdrs;
+	TFaStatusInfo *objp;
+{
+	if (!xdr_facontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelCount)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPendingRegistrationRequests)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsRejected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsAccepted)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iReplysAccepted)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iReplysRejected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedUnknownExtension)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedMalformed)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedVendor)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iAdvertisementsSent)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaTunnelID(xdrs, objp)
+	XDR *xdrs;
+	TFaTunnelID *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaTunnelInfo(xdrs, objp)
+	XDR *xdrs;
+	TFaTunnelInfo *objp;
+{
+	if (!xdr_facontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iCareofAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPrivateHomeAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCreationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExpirationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRefreshTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLastTimestamp)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSPI)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaTunnelList(xdrs, objp)
+	XDR *xdrs;
+	TFaTunnelList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TFaTunnelList_val, (u_int *)&objp->TFaTunnelList_len, ~0, sizeof(TFaTunnelID), (void*)xdr_facontroller_TFaTunnelID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,569 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __APICOMMANDHANDLER_H__
+#define __APICOMMANDHANDLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TComponentList(...);
+}
+#else
+bool_t xdr_APICommandHandler_TComponentList();
+#endif
+
+#define MAXFIELDLENGTH 128
+#define MAXSTRINGLENGTH 1024
+
+typedef int FIELD_ID;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_FIELD_ID(...);
+}
+#else
+bool_t xdr_FIELD_ID();
+#endif
+
+#define F_NUMBER_OF_FIELDS 56
+#define F_NULL_ID 0
+#define F_TIME 1
+#define F_STATUS 2
+#define F_DATE 3
+#define F_LATITUDE 4
+#define F_LAT_NORTH_SOUTH 5
+#define F_LONGITUDE 6
+#define F_LON_EAST_WEST 7
+#define F_SPEED_OVER_GROUND 8
+#define F_COURSE_OVER_GROUND 9
+#define F_MAGNETIC_VARIATION 10
+#define F_MAG_EAST_WEST 11
+#define F_MODE_INDICATOR 12
+#define F_OPERATION_MODE 13
+#define F_FIX_MODE 14
+#define F_SATELLITE_ONE 15
+#define F_SATELLITE_TWO 16
+#define F_SATELLITE_THREE 17
+#define F_SATELLITE_FOUR 18
+#define F_SATELLITE_FIVE 19
+#define F_SATELLITE_SIX 20
+#define F_SATELLITE_SEVEN 21
+#define F_SATELLITE_EIGHT 22
+#define F_SATELLITE_NINE 23
+#define F_SATELLITE_TEN 24
+#define F_SATELLITE_ELEVEN 25
+#define F_SATELLITE_TWELVE 26
+#define F_PDOP 27
+#define F_HDOP 28
+#define F_VDOP 29
+#define F_SATELLITES_IN_USE 30
+#define F_ANTENNA_ALTITUDE 31
+#define F_ANTENNA_METERS 32
+#define F_GEOIDAL_SEPARATION 33
+#define F_GEOIDAL_METERS 34
+#define F_DIFFERENTIAL_AGE 35
+#define F_DIFFERENTIAL_REF_ID 36
+#define F_GPS_QUALITY 37
+#define F_NUMBER_OF_SENTENCES 38
+#define F_SENTENCE_NUMBER 39
+#define F_SATELLITE_ID_NUMBER_ONE 40
+#define F_SATELLITE_ID_NUMBER_TWO 41
+#define F_SATELLITE_ID_NUMBER_THREE 42
+#define F_SATELLITE_ID_NUMBER_FOUR 43
+#define F_SATELLITE_ELEVATION_ONE 44
+#define F_SATELLITE_ELEVATION_TWO 45
+#define F_SATELLITE_ELEVATION_THREE 46
+#define F_SATELLITE_ELEVATION_FOUR 47
+#define F_SATELLITE_AZIMUTH_ONE 48
+#define F_SATELLITE_AZIMUTH_TWO 49
+#define F_SATELLITE_AZIMUTH_THREE 50
+#define F_SATELLITE_AZIMUTH_FOUR 51
+#define F_SATELLITE_SNR_ONE 52
+#define F_SATELLITE_SNR_TWO 53
+#define F_SATELLITE_SNR_THREE 54
+#define F_SATELLITE_SNR_FOUR 55
+#define F_CHECKSUM 56
+
+typedef int STATE;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_STATE(...);
+}
+#else
+bool_t xdr_STATE();
+#endif
+
+#define S_NULL 0
+#define S_VALUE 1
+#define S_OMIT 2
+#define S_CALCULATE 3
+
+typedef int NORTH_SOUTH;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_NORTH_SOUTH(...);
+}
+#else
+bool_t xdr_NORTH_SOUTH();
+#endif
+
+#define NORTH 0
+#define SOUTH 1
+
+typedef int EAST_WEST;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_EAST_WEST(...);
+}
+#else
+bool_t xdr_EAST_WEST();
+#endif
+
+#define EAST 0
+#define WEST 1
+
+typedef int SENTENCE_ID;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_SENTENCE_ID(...);
+}
+#else
+bool_t xdr_SENTENCE_ID();
+#endif
+
+#define RMC 1
+#define GGA 2
+#define GSA 3
+#define GNS 4
+#define GSV 5
+
+typedef int SATELLITE_ID;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_SATELLITE_ID(...);
+}
+#else
+bool_t xdr_SATELLITE_ID();
+#endif
+
+#define SAT_UNKNOWN -1
+#define SAT_FIRST 1
+#define SAT_TWO 2
+#define SAT_THREE 3
+#define SAT_FOUR 4
+#define SAT_FIVE 5
+#define SAT_SIX 6
+#define SAT_SEVEN 7
+#define SAT_EIGHT 8
+#define SAT_NINE 9
+#define SAT_TEN 10
+#define SAT_ELEVEN 11
+#define SAT_LAST 12
+
+typedef int ErrorCode;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_ErrorCode(...);
+}
+#else
+bool_t xdr_ErrorCode();
+#endif
+
+#define ERR_OK 0
+#define ERR_INVALID_FIELD -100
+#define ERR_NO_SUCH_FIELD -101
+#define ERR_INVALID_ID -102
+#define ERR_INVALID_INDEX -103
+#define ERR_DEFAULT_NOT_SET -104
+#define ERR_INVALID_DELAY -105
+#define ERR_BAD_SENTENCE -106
+#define ERR_RESET_FAILED -107
+#define ERR_CLEAR_FAILED -108
+#define ERR_SATELLITE_INVALID -109
+#define ERR_ADD_FAILED -110
+#define ERR_CONSTRUCT_FAILED -111
+#define ERR_INVALID_VALUE -112
+#define ERR_TOO_MANY_SATELLITES -113
+#define ERR_INVALID_PORT -114
+#define ERR_STOP_FAILED -115
+#define ERR_START_FAILED -116
+#define ERR_SERIAL_ERROR -117
+#define ERR_NOT_CONFIGURED -118
+#define ERR_INVALID_COURSE -119
+#define ERR_INVALID_CHUNK_SIZE -120
+#define ERR_UNKNOWN -121
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TStartupInfo(...);
+}
+#else
+bool_t xdr_APICommandHandler_TStartupInfo();
+#endif
+
+
+struct TPositionInfo {
+	double iLatitude;
+	bool_t iNS;
+	double iLongitude;
+	bool_t iEW;
+};
+typedef struct TPositionInfo TPositionInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TPositionInfo(...);
+}
+#else
+bool_t xdr_APICommandHandler_TPositionInfo();
+#endif
+
+
+struct TSatellite {
+	int iElevation;
+	int iAzimuth;
+	int iSNR;
+	int iId;
+};
+typedef struct TSatellite TSatellite;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TSatellite(...);
+}
+#else
+bool_t xdr_APICommandHandler_TSatellite();
+#endif
+
+
+struct TField {
+	int iFieldId;
+	int iState;
+	char iValue[MAXFIELDLENGTH];
+};
+typedef struct TField TField;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TField(...);
+}
+#else
+bool_t xdr_APICommandHandler_TField();
+#endif
+
+
+struct TAppendSentence {
+	int iSentenceId;
+	int iFrequency;
+};
+typedef struct TAppendSentence TAppendSentence;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TAppendSentence(...);
+}
+#else
+bool_t xdr_APICommandHandler_TAppendSentence();
+#endif
+
+
+struct TAppendString {
+	char iUserString[MAXSTRINGLENGTH];
+	int iFrequency;
+};
+typedef struct TAppendString TAppendString;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TAppendString(...);
+}
+#else
+bool_t xdr_APICommandHandler_TAppendString();
+#endif
+
+
+struct TAppendUserSentence {
+	TAppendSentence iAppendSentence;
+	struct {
+		u_int iUserFields_len;
+		TField *iUserFields_val;
+	} iUserFields;
+};
+typedef struct TAppendUserSentence TAppendUserSentence;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TAppendUserSentence(...);
+}
+#else
+bool_t xdr_APICommandHandler_TAppendUserSentence();
+#endif
+
+
+struct TCourse {
+	double iSpeed;
+	double iDirection;
+};
+typedef struct TCourse TCourse;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TCourse(...);
+}
+#else
+bool_t xdr_APICommandHandler_TCourse();
+#endif
+
+
+struct TAccuracy {
+	double iAccuracy;
+	double iHWConstant;
+};
+typedef struct TAccuracy TAccuracy;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_APICommandHandler_TAccuracy(...);
+}
+#else
+bool_t xdr_APICommandHandler_TAccuracy();
+#endif
+
+
+#define GPSSIMULATOR ((u_long)0x34630666)
+#define GPSSIMULATOR_VERSION ((u_long)1)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_10( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_10();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_10( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_10();
+#endif /* __cplusplus */
+#define LIST_CONNECTIONS ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_connections_1( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_connections_1();
+#endif /* __cplusplus */
+#define CSTR_STARTPROCESS ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern int *cstr_startprocess_1( char ** arg, CLIENT *cl );
+}
+#else
+extern int *cstr_startprocess_1();
+#endif /* __cplusplus */
+#define DSTR_REMOVEPROCESS ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removeprocess_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removeprocess_1();
+#endif /* __cplusplus */
+#define STARTSIMULATOR ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern int *startsimulator_1( void * arg, CLIENT *cl );
+}
+#else
+extern int *startsimulator_1();
+#endif /* __cplusplus */
+#define STOPSIMULATOR ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern int *stopsimulator_1( void * arg, CLIENT *cl );
+}
+#else
+extern int *stopsimulator_1();
+#endif /* __cplusplus */
+#define SETFIELDDEFAULT ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern int *setfielddefault_1( TField * arg, CLIENT *cl );
+}
+#else
+extern int *setfielddefault_1();
+#endif /* __cplusplus */
+#define SETSATELLITEDEFAULT ((u_long)13)
+#ifdef __cplusplus
+extern "C" {
+extern int *setsatellitedefault_1( TSatellite * arg, CLIENT *cl );
+}
+#else
+extern int *setsatellitedefault_1();
+#endif /* __cplusplus */
+#define POSITIONSET ((u_long)14)
+#ifdef __cplusplus
+extern "C" {
+extern int *positionset_1( TPositionInfo * arg, CLIENT *cl );
+}
+#else
+extern int *positionset_1();
+#endif /* __cplusplus */
+#define COURSESET ((u_long)15)
+#ifdef __cplusplus
+extern "C" {
+extern int *courseset_1( TCourse * arg, CLIENT *cl );
+}
+#else
+extern int *courseset_1();
+#endif /* __cplusplus */
+#define ACCURACYSET ((u_long)16)
+#ifdef __cplusplus
+extern "C" {
+extern int *accuracyset_1( TAccuracy * arg, CLIENT *cl );
+}
+#else
+extern int *accuracyset_1();
+#endif /* __cplusplus */
+#define SATELLITESET ((u_long)17)
+#ifdef __cplusplus
+extern "C" {
+extern int *satelliteset_1( TSatellite * arg, CLIENT *cl );
+}
+#else
+extern int *satelliteset_1();
+#endif /* __cplusplus */
+#define BATCHAPPENDSENTENCE ((u_long)18)
+#ifdef __cplusplus
+extern "C" {
+extern int *batchappendsentence_1( TAppendSentence * arg, CLIENT *cl );
+}
+#else
+extern int *batchappendsentence_1();
+#endif /* __cplusplus */
+#define BATCHAPPENDUSERSENTENCE ((u_long)19)
+#ifdef __cplusplus
+extern "C" {
+extern int *batchappendusersentence_1( TAppendUserSentence * arg, CLIENT *cl );
+}
+#else
+extern int *batchappendusersentence_1();
+#endif /* __cplusplus */
+#define BATCHSETDELAY ((u_long)20)
+#ifdef __cplusplus
+extern "C" {
+extern int *batchsetdelay_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *batchsetdelay_1();
+#endif /* __cplusplus */
+#define BATCHRESET ((u_long)21)
+#ifdef __cplusplus
+extern "C" {
+extern int *batchreset_1( void * arg, CLIENT *cl );
+}
+#else
+extern int *batchreset_1();
+#endif /* __cplusplus */
+#define SETCOMPORT ((u_long)22)
+#ifdef __cplusplus
+extern "C" {
+extern int *setcomport_1( char ** arg, CLIENT *cl );
+}
+#else
+extern int *setcomport_1();
+#endif /* __cplusplus */
+#define SETCHUNKMODE ((u_long)23)
+#ifdef __cplusplus
+extern "C" {
+extern int *setchunkmode_1( bool_t * arg, CLIENT *cl );
+}
+#else
+extern int *setchunkmode_1();
+#endif /* __cplusplus */
+#define SETCHUNKSIZE ((u_long)24)
+#ifdef __cplusplus
+extern "C" {
+extern int *setchunksize_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *setchunksize_1();
+#endif /* __cplusplus */
+#define SETCHUNKDELAY ((u_long)25)
+#ifdef __cplusplus
+extern "C" {
+extern int *setchunkdelay_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *setchunkdelay_1();
+#endif /* __cplusplus */
+#define STARTCOMMS ((u_long)26)
+#ifdef __cplusplus
+extern "C" {
+extern int *startcomms_1( void * arg, CLIENT *cl );
+}
+#else
+extern int *startcomms_1();
+#endif /* __cplusplus */
+#define STOPCOMMS ((u_long)27)
+#ifdef __cplusplus
+extern "C" {
+extern int *stopcomms_1( void * arg, CLIENT *cl );
+}
+#else
+extern int *stopcomms_1();
+#endif /* __cplusplus */
+#define BATCHAPPENDUSERSTRING ((u_long)28)
+#ifdef __cplusplus
+extern "C" {
+extern int *batchappenduserstring_1( TAppendString * arg, CLIENT *cl );
+}
+#else
+extern int *batchappenduserstring_1();
+#endif /* __cplusplus */
+
+#endif /* __APICOMMANDHANDLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../../../GPSSimulator/Dev/APICommandHandler/APICommandHandler.x"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,337 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "APICommandHandler.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_10(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_APICommandHandler_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_10(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_connections_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_CONNECTIONS, xdr_void, argp, xdr_APICommandHandler_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+cstr_startprocess_1(argp, clnt)
+	char **argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_STARTPROCESS, xdr_wrapstring, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+dstr_removeprocess_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEPROCESS, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+startsimulator_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STARTSIMULATOR, xdr_void, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+stopsimulator_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPSIMULATOR, xdr_void, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setfielddefault_1(argp, clnt)
+	TField *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETFIELDDEFAULT, xdr_APICommandHandler_TField, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setsatellitedefault_1(argp, clnt)
+	TSatellite *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETSATELLITEDEFAULT, xdr_APICommandHandler_TSatellite, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+positionset_1(argp, clnt)
+	TPositionInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, POSITIONSET, xdr_APICommandHandler_TPositionInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+courseset_1(argp, clnt)
+	TCourse *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, COURSESET, xdr_APICommandHandler_TCourse, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+accuracyset_1(argp, clnt)
+	TAccuracy *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ACCURACYSET, xdr_APICommandHandler_TAccuracy, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+satelliteset_1(argp, clnt)
+	TSatellite *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SATELLITESET, xdr_APICommandHandler_TSatellite, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+batchappendsentence_1(argp, clnt)
+	TAppendSentence *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, BATCHAPPENDSENTENCE, xdr_APICommandHandler_TAppendSentence, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+batchappendusersentence_1(argp, clnt)
+	TAppendUserSentence *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, BATCHAPPENDUSERSENTENCE, xdr_APICommandHandler_TAppendUserSentence, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+batchsetdelay_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, BATCHSETDELAY, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+batchreset_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, BATCHRESET, xdr_void, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setcomport_1(argp, clnt)
+	char **argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETCOMPORT, xdr_wrapstring, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setchunkmode_1(argp, clnt)
+	bool_t *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETCHUNKMODE, xdr_bool, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setchunksize_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETCHUNKSIZE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setchunkdelay_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETCHUNKDELAY, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+startcomms_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STARTCOMMS, xdr_void, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+stopcomms_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPCOMMS, xdr_void, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+batchappenduserstring_1(argp, clnt)
+	TAppendString *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, BATCHAPPENDUSERSTRING, xdr_APICommandHandler_TAppendString, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,299 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "APICommandHandler.h"
+
+
+bool_t
+xdr_APICommandHandler_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_FIELD_ID(xdrs, objp)
+	XDR *xdrs;
+	FIELD_ID *objp;
+{
+	if (!xdr_int(xdrs, objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_STATE(xdrs, objp)
+	XDR *xdrs;
+	STATE *objp;
+{
+	if (!xdr_int(xdrs, objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_NORTH_SOUTH(xdrs, objp)
+	XDR *xdrs;
+	NORTH_SOUTH *objp;
+{
+	if (!xdr_int(xdrs, objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_EAST_WEST(xdrs, objp)
+	XDR *xdrs;
+	EAST_WEST *objp;
+{
+	if (!xdr_int(xdrs, objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_SENTENCE_ID(xdrs, objp)
+	XDR *xdrs;
+	SENTENCE_ID *objp;
+{
+	if (!xdr_int(xdrs, objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_SATELLITE_ID(xdrs, objp)
+	XDR *xdrs;
+	SATELLITE_ID *objp;
+{
+	if (!xdr_int(xdrs, objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_ErrorCode(xdrs, objp)
+	XDR *xdrs;
+	ErrorCode *objp;
+{
+	if (!xdr_int(xdrs, objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TPositionInfo(xdrs, objp)
+	XDR *xdrs;
+	TPositionInfo *objp;
+{
+	if (!xdr_double(xdrs, &objp->iLatitude)) {
+		return (FALSE);
+	}
+	if (!xdr_bool(xdrs, &objp->iNS)) {
+		return (FALSE);
+	}
+	if (!xdr_double(xdrs, &objp->iLongitude)) {
+		return (FALSE);
+	}
+	if (!xdr_bool(xdrs, &objp->iEW)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TSatellite(xdrs, objp)
+	XDR *xdrs;
+	TSatellite *objp;
+{
+	if (!xdr_int(xdrs, &objp->iElevation)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iAzimuth)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSNR)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iId)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TField(xdrs, objp)
+	XDR *xdrs;
+	TField *objp;
+{
+	if (!xdr_int(xdrs, &objp->iFieldId)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iState)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iValue, MAXFIELDLENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TAppendSentence(xdrs, objp)
+	XDR *xdrs;
+	TAppendSentence *objp;
+{
+	if (!xdr_int(xdrs, &objp->iSentenceId)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iFrequency)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TAppendString(xdrs, objp)
+	XDR *xdrs;
+	TAppendString *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iUserString, MAXSTRINGLENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iFrequency)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TAppendUserSentence(xdrs, objp)
+	XDR *xdrs;
+	TAppendUserSentence *objp;
+{
+	if (!xdr_APICommandHandler_TAppendSentence(xdrs, &objp->iAppendSentence)) {
+		return (FALSE);
+	}
+	if (!xdr_array(xdrs, (char **)&objp->iUserFields.iUserFields_val, (u_int *)&objp->iUserFields.iUserFields_len, ~0, sizeof(TField), (void*)xdr_APICommandHandler_TField)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TCourse(xdrs, objp)
+	XDR *xdrs;
+	TCourse *objp;
+{
+	if (!xdr_double(xdrs, &objp->iSpeed)) {
+		return (FALSE);
+	}
+	if (!xdr_double(xdrs, &objp->iDirection)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_APICommandHandler_TAccuracy(xdrs, objp)
+	XDR *xdrs;
+	TAccuracy *objp;
+{
+	if (!xdr_double(xdrs, &objp->iAccuracy)) {
+		return (FALSE);
+	}
+	if (!xdr_double(xdrs, &objp->iHWConstant)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CAPICommandHandlerStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,654 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "CAPICommandHandlerStub.h"
+#include "APICommandHandler.h"
+
+CAPICommandHandlerStub::CAPICommandHandlerStub()
+{
+	iGPSSimulator = new CCGpssimulator();
+}
+
+CAPICommandHandlerStub::~CAPICommandHandlerStub()
+{
+	delete iGPSSimulator;
+}
+
+int CAPICommandHandlerStub::StartUccsService( char *aHostName,  int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	*aErrorCode = 0;
+	
+	// connect to the remote service
+	client_stub_error = iGPSSimulator->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+int CAPICommandHandlerStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iGPSSimulator->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+CDataRecord* CAPICommandHandlerStub::IssueCommand( CDataRecord* aRequest )
+{
+	int call_result, err, client_stub_error, method_id = -1;
+	
+	CDataRecord *request_reply;
+
+	TStartupInfo sarg_startup_info;
+	int rv_integer, sarg_integer;
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 )
+	{
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id )
+	{
+		// ss_startuprpcservice
+		case 1:
+			{
+				// extract the parameters
+				sarg_startup_info.iEmpty = 0;
+
+				// make the call and update the return value
+				client_stub_error = iGPSSimulator->ss_startuprpcservice( sarg_startup_info, &rv_integer );
+				UpdateCompletionCode( request_reply, client_stub_error );		
+				if( client_stub_error != ERR_NONE )
+				{
+					break;
+				}
+				// set any return information
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// sc_shutdownrpcservice
+		case 2: 
+			{
+				// extract the parameters
+				GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+
+				// make the call and update the return value
+				client_stub_error = iGPSSimulator->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+				UpdateCompletionCode( request_reply, client_stub_error );
+				if( client_stub_error != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// startsimulator		
+		case 10:
+			{
+				// Make the call and update the return values
+				call_result = iGPSSimulator->startsimulator( &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// stopsimulator		
+		case 11:
+			{
+				// Make the call and update the return values
+				call_result = iGPSSimulator->stopsimulator( &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// setfielddefault
+		case 12:
+			{
+				// Extract the parameters
+				int		fieldID;
+				int		state;
+				char*	value = NULL;
+	
+				GETINTEGERARGUMENT( "FIELD", &fieldID, 1, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "STATE", &state, 2, 0, aRequest, request_reply );
+				GETSTRINGARGUMENT( "VALUE", &value, 3, 1, aRequest, request_reply );
+
+				TField	field = {0,0,0};
+				field.iFieldId = fieldID;
+				field.iState = state;
+				if( value!=NULL )
+				{
+					strcpy( field.iValue, value );
+				}
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->setfielddefault( field, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// setsatellitedefault
+		case 13:
+			{
+				// Extract the parameters
+				int		elevation;
+				int		azimuth;
+				int		snr;
+				int		id;
+
+				GETINTEGERARGUMENT( "ELEVATION", &elevation, 1, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "AZIMUTH", &azimuth, 2, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "SNR", &snr, 3, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "SATID", &id, 4, 0, aRequest, request_reply );
+
+				TSatellite	satellite;
+				satellite.iAzimuth = azimuth;
+				satellite.iElevation = elevation;
+				satellite.iSNR = snr;
+				satellite.iId = id;
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->setsatellitedefault( satellite, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// positionset
+		case 14:
+			{
+				// Extract the parameters
+				char*	latitude;
+				char*	ns;
+				char*	longitude;
+				char*	ew;
+
+				GETSTRINGARGUMENT( "LATITUDE", &latitude, 1, 0, aRequest, request_reply );
+				GETSTRINGARGUMENT( "NS", &ns, 2, 0, aRequest, request_reply );
+				GETSTRINGARGUMENT( "LONGITUDE", &longitude, 3, 0, aRequest, request_reply );
+				GETSTRINGARGUMENT( "EW", &ew, 4, 0, aRequest, request_reply );
+
+				TPositionInfo	pos;
+				pos.iLatitude = atof( latitude );
+				pos.iNS = strcmp("N", ns)?1:0;
+				pos.iLongitude = atof( longitude );
+				pos.iEW = strcmp("E", ew)?1:0;
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->positionset( pos, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// courseset
+		case 15:
+			{
+				// Extract the parameters
+				int	speed;
+				int	direction;
+
+				GETINTEGERARGUMENT( "SPEED", &speed, 1, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "DIRECTION", &direction, 2, 0, aRequest, request_reply );
+
+				TCourse	course;
+				course.iSpeed = (double)speed;
+				course.iDirection = (double)direction;
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->courseset( course, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// accuracyset
+		case 16:
+			{
+				// Extract the parameters
+				char* accuracyStr;
+				char* hwconstantStr;
+				GETSTRINGARGUMENT( "ACCURACY", &accuracyStr, 1, 0, aRequest, request_reply );
+				GETSTRINGARGUMENT( "HWCONSTANT", &hwconstantStr, 1, 0, aRequest, request_reply );
+
+				// Make the call and update the return values
+				TAccuracy accuracy;
+				accuracy.iAccuracy = atof(accuracyStr);
+				accuracy.iHWConstant = atof(hwconstantStr);
+				call_result = iGPSSimulator->accuracyset( accuracy, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// satelliteset
+		case 17:
+			{
+				// Extract the parameters
+				int		elevation;
+				int		azimuth;
+				int		snr;
+				int		id;
+
+				GETINTEGERARGUMENT( "ELEVATION", &elevation, 1, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "AZIMUTH", &azimuth, 2, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "SNR", &snr, 3, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "SATID", &id, 4, 0, aRequest, request_reply );
+
+				TSatellite	satellite;
+				satellite.iAzimuth = azimuth;
+				satellite.iElevation = elevation;
+				satellite.iSNR = snr;
+				satellite.iId = id;
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->satelliteset( satellite, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// batchappendsentence
+		case 18:
+			{
+				// Extract the parameters
+				int		sentenceId;
+				int		frequency;
+
+				GETINTEGERARGUMENT( "SENTENCEID", &sentenceId, 1, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "FREQUENCY", &frequency, 2, 0, aRequest, request_reply );
+
+				TAppendSentence sentence;
+				sentence.iSentenceId = sentenceId;
+				sentence.iFrequency = frequency;
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->batchappendsentence( sentence, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// batchappendusersentence
+		case 19:
+			{
+				// Extract the parameters
+				int	sentenceId;
+				int	frequency = 1;
+				int numFields = 0;
+
+				GETINTEGERARGUMENT( "NUMFIELDS", &numFields, 1, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "SENTENCEID", &sentenceId, 2, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "FREQUENCY", &frequency, 3, 1, aRequest, request_reply );
+
+				TAppendSentence	sentence;
+				sentence.iSentenceId = sentenceId;
+				sentence.iFrequency = frequency;
+				TAppendUserSentence userSentence;
+				userSentence.iAppendSentence = sentence;
+
+				// Allocate enough space for the number of user fields
+				userSentence.iUserFields.iUserFields_len = numFields;
+				userSentence.iUserFields.iUserFields_val = new TField[numFields];
+				int count = 0;
+
+				// Check each possible field id to see if it has been entered in the script
+				for( int field_id = 1 ; field_id <= F_NUMBER_OF_FIELDS ; field_id++ )
+				{
+					string field_str;
+					switch( field_id )
+					{
+						case F_TIME:				field_str = "TIME"; break;
+						case F_STATUS:				field_str = "STATUS"; break;
+						case F_DATE:				field_str = "DATE"; break;
+						case F_LATITUDE:			field_str = "LATITUDE"; break;
+						case F_LAT_NORTH_SOUTH:		field_str = "LAT_NORTH_SOUTH"; break;
+						case F_LONGITUDE:			field_str = "LONGITUDE"; break;
+						case F_LON_EAST_WEST:		field_str = "LON_EAST_WEST"; break;
+						case F_SPEED_OVER_GROUND:	field_str = "SPEED"; break;
+						case F_COURSE_OVER_GROUND:	field_str = "COURSE"; break;
+						case F_MAGNETIC_VARIATION:	field_str = "MAGNETIC_VARIATION"; break;
+						case F_MAG_EAST_WEST:		field_str = "MAG_EAST_WEST"; break;
+						case F_MODE_INDICATOR:		field_str = "MODE_INDICATOR"; break;
+						case F_OPERATION_MODE:		field_str = "OPERATION_MODE"; break;
+						case F_FIX_MODE:			field_str = "FIX_MODE"; break;
+						case F_SATELLITE_ONE:		field_str = "SATELLITE_ONE"; break;
+						case F_SATELLITE_TWO:		field_str = "SATELLITE_TWO"; break;
+						case F_SATELLITE_THREE:		field_str = "SATELLITE_THREE"; break;
+						case F_SATELLITE_FOUR:		field_str = "SATELLITE_FOUR"; break;
+						case F_SATELLITE_FIVE:		field_str = "SATELLITE_FIVE"; break;
+						case F_SATELLITE_SIX:		field_str = "SATELLITE_SIX"; break;
+						case F_SATELLITE_SEVEN:		field_str = "SATELLITE_SEVEN"; break;
+						case F_SATELLITE_EIGHT:		field_str = "SATELLITE_EIGHT"; break;
+						case F_SATELLITE_NINE:		field_str = "SATELLITE_NINE"; break;
+						case F_SATELLITE_TEN:		field_str = "SATELLITE_TEN"; break;
+						case F_SATELLITE_ELEVEN:	field_str = "SATELLITE_ELEVEN"; break;
+						case F_SATELLITE_TWELVE:	field_str = "SATELLITE_TWELVE"; break;
+						case F_PDOP:				field_str = "PDOP"; break;
+						case F_HDOP:				field_str = "HDOP"; break;
+						case F_VDOP:				field_str = "VDOP"; break;
+						case F_SATELLITES_IN_USE:	field_str = "SATELLITES_IN_USE"; break;
+						case F_ANTENNA_ALTITUDE:	field_str = "ANTENNA_ALTITUDE"; break;
+						case F_ANTENNA_METERS:		field_str = "ANTENNA_METERS"; break;
+						case F_GEOIDAL_SEPARATION:	field_str = "GEOIDAL_SEPARATION"; break;
+						case F_GEOIDAL_METERS:		field_str = "GEOIDAL_METERS"; break;
+						case F_DIFFERENTIAL_AGE:	field_str = "DIFFERENTIAL_AGE"; break;
+						case F_DIFFERENTIAL_REF_ID:	field_str = "DIFFERENTIAL_REF_ID"; break;
+						case F_GPS_QUALITY:			field_str = "GPS_QUALITY"; break;
+						case F_NUMBER_OF_SENTENCES:	field_str = "NUMBER_OF_SENTENCES"; break;
+						case F_CHECKSUM:			field_str = "CHECKSUM"; break;
+						default:
+							break;
+					}
+					
+					// Append _STATE for each id for the state retrieval
+					string field_state_str = field_str + "_STATE";
+					char* field_state = NULL;
+					GETSTRINGARGUMENT( (char*)field_state_str.c_str(), &field_state, field_id+4, 1, aRequest, request_reply );
+
+					if( field_state != NULL && count<numFields )
+					{
+						userSentence.iUserFields.iUserFields_val[count].iFieldId = field_id;
+						userSentence.iUserFields.iUserFields_val[count].iState = atoi( field_state );
+
+						if( atoi(field_state) == S_VALUE )
+						{
+							char* field = NULL;
+							GETSTRINGARGUMENT( (char*)field_str.c_str(), &field, field_id+4+F_NUMBER_OF_FIELDS, 0, aRequest, request_reply );
+
+							if( field != NULL && count < numFields )
+							{
+								strcpy( userSentence.iUserFields.iUserFields_val[count++].iValue, field );
+							}							
+						}
+					}
+				}
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->batchappendusersentence( userSentence, &rv_integer );
+
+				// Cleanup the user fields now
+				delete[] userSentence.iUserFields.iUserFields_val;
+
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// batchsetdelay
+		case 20:
+			{
+				// Extract the parameters
+				int	delay;
+
+				GETINTEGERARGUMENT( "DELAY", &delay, 1, 0, aRequest, request_reply );
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->batchsetdelay( delay, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// batchreset
+		case 21:
+			{
+				// Make the call and update the return values
+				call_result = iGPSSimulator->batchreset( &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// setcomport
+		case 22:
+			{
+				// Extract the parameters
+				char*	port;
+	
+				GETSTRINGARGUMENT( "COMPORT", &port, 1, 0, aRequest, request_reply );
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->setcomport( port, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// setchunkmode
+		case 23:
+			{
+				// Extract the parameters
+				int	mode;
+	
+				GETINTEGERARGUMENT( "MODE", &mode, 1, 0, aRequest, request_reply );
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->setchunkmode( mode==0?false:true, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// setchunksize
+		case 24:
+			{
+				// Extract the parameters
+				int	size;
+	
+				GETINTEGERARGUMENT( "SIZE", &size, 1, 0, aRequest, request_reply );
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->setchunksize( size, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// setchunkdelay
+		case 25:
+			{
+				// Extract the parameters
+				int	delay;
+	
+				GETINTEGERARGUMENT( "DELAY", &delay, 1, 0, aRequest, request_reply );
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->setchunkdelay( delay, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// startcomms
+		case 26:
+			{
+				// Make the call and update the return values
+				call_result = iGPSSimulator->startcomms( &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// stopcomms
+		case 27:
+			{
+				// Make the call and update the return values
+				call_result = iGPSSimulator->stopcomms( &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// batchappenduserstring
+		case 28:
+			{
+				// Extract the parameters
+				char*	userString;
+				int		frequency;
+
+				GETSTRINGARGUMENT( "STRING", &userString, 1, 0, aRequest, request_reply );
+				GETINTEGERARGUMENT( "FREQUENCY", &frequency, 2, 0, aRequest, request_reply );
+
+				TAppendString sentence;
+				strcpy( sentence.iUserString, userString );
+				sentence.iFrequency = frequency;
+
+				// Make the call and update the return values
+				call_result = iGPSSimulator->batchappenduserstring( sentence, &rv_integer );
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// Any other method id results in an invalid method id result
+		default:
+			{
+				UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+			}
+			break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+int CAPICommandHandlerStub::GetStatus()
+{
+	return -1;
+}
+
+char *CAPICommandHandlerStub::GetLastRPCError( int *aIntError )
+{
+	return iGPSSimulator->GetLastRPCError( aIntError );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CAPICommandHandlerStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CAPICOMMANDHANDLERSTUB_H__
+#define __CAPICOMMANDHANDLERSTUB_H__
+
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+#include "CCGpssimulator.h"
+
+class CCGpssimulator;
+
+class CAPICommandHandlerStub : public IService, public CServiceAgentBase
+{
+public:
+	CAPICommandHandlerStub();
+	~CAPICommandHandlerStub();
+
+	int StartUccsService( char *aHostName, int* aLocalErr, int* aRemoteErr );
+	int StopUccsService(int* aLocalErr, int* aRemoteErr );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCGpssimulator*	iGPSSimulator;
+};
+
+#endif //__CAPICOMMANDHANDLERSTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CCGpssimulator.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,879 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCGpssimulator.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCGpssimulator::CCGpssimulator()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCGpssimulator::~CCGpssimulator()
+{
+	assert( cl == NULL );
+}
+
+char *CCGpssimulator::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCGpssimulator::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), GPSSIMULATOR, GPSSIMULATOR_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCGpssimulator::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_10( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_10( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_connections
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::list_connections( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_connections_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startprocess
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::cstr_startprocess( char *aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_startprocess_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeprocess
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::dstr_removeprocess( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removeprocess_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startsimulator
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::startsimulator( int *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *startsimulator_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopsimulator
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::stopsimulator( int *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopsimulator_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setfielddefault
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::setfielddefault( TField aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setfielddefault_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsatellitedefault
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::setsatellitedefault( TSatellite aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setsatellitedefault_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: positionset
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::positionset( TPositionInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *positionset_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: courseset
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::courseset( TCourse aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *courseset_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: accuracyset
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::accuracyset( TAccuracy aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *accuracyset_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: satelliteset
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::satelliteset( TSatellite aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *satelliteset_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: batchappendsentence
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::batchappendsentence( TAppendSentence aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *batchappendsentence_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: batchappendusersentence
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::batchappendusersentence( TAppendUserSentence aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *batchappendusersentence_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: batchsetdelay
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::batchsetdelay( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *batchsetdelay_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: batchreset
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::batchreset( int *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *batchreset_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setcomport
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::setcomport( char *aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setcomport_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setchunkmode
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::setchunkmode( bool_t aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setchunkmode_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setchunksize
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::setchunksize( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setchunksize_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setchunkdelay
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::setchunkdelay( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setchunkdelay_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startcomms
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::startcomms( int *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *startcomms_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopcomms
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::stopcomms( int *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopcomms_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: batchappenduserstring
+ * 
+ ***************************************************************************************/
+int CCGpssimulator::batchappenduserstring( TAppendString aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *batchappenduserstring_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CCGpssimulator.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCGPSSIMULATOR_H__
+#define __CCGPSSIMULATOR_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "APICommandHandler.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCGpssimulator
+ * 
+ ***************************************************************************************/
+class CCGpssimulator
+{
+public:
+	// standard methods
+	CCGpssimulator();
+	~CCGpssimulator();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_connections( TComponentList *rv );
+	int cstr_startprocess( char *aArgs, int *rv );
+	int dstr_removeprocess( int aArgs, int *rv );
+	int startsimulator( int *rv );
+	int stopsimulator( int *rv );
+	int setfielddefault( TField aArgs, int *rv );
+	int setsatellitedefault( TSatellite aArgs, int *rv );
+	int positionset( TPositionInfo aArgs, int *rv );
+	int courseset( TCourse aArgs, int *rv );
+	int accuracyset( TAccuracy aArgs, int *rv );
+	int satelliteset( TSatellite aArgs, int *rv );
+	int batchappendsentence( TAppendSentence aArgs, int *rv );
+	int batchappendusersentence( TAppendUserSentence aArgs, int *rv );
+	int batchsetdelay( int aArgs, int *rv );
+	int batchreset( int *rv );
+	int setcomport( char *aArgs, int *rv );
+	int setchunkmode( bool_t aArgs, int *rv );
+	int setchunksize( int aArgs, int *rv );
+	int setchunkdelay( int aArgs, int *rv );
+	int startcomms( int *rv );
+	int stopcomms( int *rv );
+	int batchappenduserstring( TAppendString aArgs, int *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CCGenericstub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,311 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCGenericstub.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCGenericstub::CCGenericstub( const int anIID, const int aVersion )
+	: iIID(anIID), iVersion(aVersion)
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCGenericstub::~CCGenericstub()
+{
+	assert( cl == NULL );
+}
+
+char *CCGenericstub::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCGenericstub::Connect( string aRemoteHost )
+{
+	int res = ERR_NONE;
+	// check that we are not already connected
+	if( cl != NULL )
+	{
+		res = ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	if( res == ERR_NONE )
+	{
+		// start the rpc library
+		res = rpc_nt_init();
+		if( res == ERR_NONE )
+		{
+			// connect to the service
+			cl = clnt_create( aRemoteHost.c_str(), iIID, iVersion, "tcp" );
+			if( cl == NULL )
+			{
+				rpc_nt_exit();
+				res = ERR_FAILED_TO_CONNECT;
+			}
+		}
+		else
+		{
+			res = ERR_RPC_ERROR;
+		}
+	}
+
+	// done
+	return res;
+}
+
+int CCGenericstub::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCGenericstub::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCGenericstub::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_connections
+ * 
+ ***************************************************************************************/
+int CCGenericstub::list_connections( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_connections_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startprocess
+ * 
+ ***************************************************************************************/
+int CCGenericstub::cstr_startprocess( char *aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_startprocess_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeprocess
+ * 
+ ***************************************************************************************/
+int CCGenericstub::dstr_removeprocess( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removeprocess_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: run_command
+ * 
+ ***************************************************************************************/
+int CCGenericstub::run_command( TCall aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *run_command_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CCGenericstub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCGENERICSTUB_H__
+#define __CCGENERICSTUB_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "GenericStub.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCGenericstub
+ * 
+ ***************************************************************************************/
+class CCGenericstub
+{
+public:
+	// standard methods
+	CCGenericstub( const int anIID, const int iVersion );
+	~CCGenericstub();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_connections( TComponentList *rv );
+	int cstr_startprocess( char *aArgs, int *rv );
+	int dstr_removeprocess( int aArgs, int *rv );
+	int run_command( TCall aArgs, int *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+	int iVersion;
+	int iIID;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CGenericStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CGENERICSTUB_H__
+#define __CGENERICSTUB_H__
+
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+#include "CUCCIniFile.h"
+
+#define MAXINIFILEPATH 1024
+
+class CCGenericstub;
+
+class CGenericStub : public IService, public CServiceAgentBase
+{
+public:
+	CGenericStub( char* aIniFile, char* aServiceName );
+	~CGenericStub();
+
+	int StartUccsService( char *aHostName, int* aLocalErr, int* aRemoteErr );
+	int StopUccsService(int* aLocalErr, int* aRemoteErr );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCGenericstub*	iGenericStub;
+	CUCCIniFile*	iIniFile;
+};
+
+#endif //__CGENERICSTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CGenericrStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,264 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CGenericStub.cpp
+*
+*/
+
+
+
+
+#include <assert.h>
+
+#include "CGenericStub.h"
+#include "CCGenericStub.h"
+#include "GenericStub.h"
+
+#define CALL_ID		"CallID"
+
+CGenericStub::CGenericStub( char* aIniFile, char* aServiceName )
+	: iIniFile(NULL)
+{
+	// Open the interface ini file
+	iIniFile = new CUCCIniFile( aIniFile );
+	assert( iIniFile != NULL );
+
+	// Retrieve the IID and version
+	int IID;
+	bool ret = iIniFile->KeyValue("ServiceIID", aServiceName, IID);
+	assert( ret == true );
+	assert( IID != 0 );
+	int version;
+	ret = iIniFile->KeyValue("Version", aServiceName, version);
+	assert( ret == true );
+	assert( version != 0 );
+	iGenericStub = new CCGenericstub( IID, version );
+}
+
+CGenericStub::~CGenericStub()
+{
+	delete iGenericStub;
+	delete iIniFile;
+}
+
+int CGenericStub::StartUccsService( char *aHostName,  int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	*aErrorCode = 0;
+	
+	// connect to the remote service
+	client_stub_error = iGenericStub->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+int CGenericStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iGenericStub->Disconnect();
+
+	// done
+	return client_stub_error;
+}
+
+CDataRecord* CGenericStub::IssueCommand( CDataRecord* aRequest )
+{
+	int call_result, err, client_stub_error, method_id = -1;
+	
+	CDataRecord *request_reply;
+
+	int rv_integer, sarg_integer;
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 )
+	{
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id )
+	{
+		// ss_startuprpcservice
+		case 1:
+			{
+				// extract the parameters
+				TStartupInfo sarg_startup_info;
+				sarg_startup_info.iEmpty = 0;
+
+				// make the call and update the return value
+				client_stub_error = iGenericStub->ss_startuprpcservice( sarg_startup_info, &rv_integer );
+				UpdateCompletionCode( request_reply, client_stub_error );		
+				if( client_stub_error != ERR_NONE )
+				{
+					break;
+				}
+				// set any return information
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// sc_shutdownrpcservice
+		case 2: 
+			{
+				// extract the parameters
+				GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+
+				// make the call and update the return value
+				client_stub_error = iGenericStub->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+				UpdateCompletionCode( request_reply, client_stub_error );
+				if( client_stub_error != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+
+		// RunCommand
+		case 10:
+			{
+				// Extract the call name first
+				char* callName = NULL;
+				GETSTRINGARGUMENT( "CALL", &callName, 1, 0, aRequest, request_reply );
+
+				if( callName == NULL )
+				{
+					UpdateCompletionCode( request_reply, ERR_INVALID_CALL );
+					return request_reply;
+				}
+
+				// Lookup the parameters for this call from the ini file
+				// Compare that they are all provided if required
+				vector<string> parameters = iIniFile->SectionParameters(callName);
+
+				// Retrieve the callID from the section by using the call name.
+				//   NOTE: Every call section must have a callID
+				TCall call;
+				bool ret = iIniFile->KeyValue(CALL_ID, callName, call.iCallID);
+				if( !ret )
+				{
+					UpdateCompletionCode( request_reply, ERR_INVALID_CALL );
+					return request_reply;
+				}
+
+				call.iParams.iParams_len = parameters.size()-1; // Don't count the CallID
+				call.iParams.iParams_val = new TParam[parameters.size()-1];
+
+				// Package up the call to be sent to the service
+				int paramNum = 2; // Start at 2 as the "CALL" is 1.
+				int callParamCount = 0;
+				for( int i=0 ; i<parameters.size() ; i++ )
+				{
+					if( parameters[i] != CALL_ID )
+					{
+						int		required;
+						ret = iIniFile->KeyValue(parameters[i], callName, required);
+						if( !ret )
+						{
+							delete[] call.iParams.iParams_val;
+							UpdateCompletionCode( request_reply, ERR_MISSING_PARAMETER );
+							return request_reply;
+						}
+
+						char*	paramValue = NULL;
+
+						// Retrieve the parameter from the i/p stream (eg. script, console, serial comms, ip comms, etc)
+						if (GetStringArgument((char *) parameters[i].c_str(), &paramValue, paramNum, true, aRequest, request_reply))
+							break;
+	
+						// Check to see if some data is present for the parameter
+						if( paramValue==NULL )
+						{
+							// If the parameter was required then retun an error
+							if( required==1 )
+							{
+								delete[] call.iParams.iParams_val;
+								UpdateCompletionCode( request_reply, ERR_MISSING_PARAMETER );
+								return request_reply;
+							}
+							// Else just decrement the number of parameters being sent to the service
+							call.iParams.iParams_len--;
+						}
+						else
+						{
+							// Update the parameter name within the call
+							if( parameters[i].size() > 0 && parameters[i].size() <= MAXPARAMNAMELENGTH )
+							{
+								strcpy(	call.iParams.iParams_val[callParamCount].iName,
+										parameters[i].c_str() );
+								
+							}
+							// Update the parameter value within the call
+							if( strlen(paramValue) <= MAXPARAMVALUELENGTH )
+							{
+								strcpy(	call.iParams.iParams_val[callParamCount].iValue,
+										paramValue );
+							}
+
+							// Increment the call parameter to update next
+							callParamCount++;
+						}
+						// Increment the script parameter number to retrieve next
+						paramNum++;
+					}
+				}
+
+				// Make the call and update the return values
+				call_result = iGenericStub->run_command( call, &rv_integer );
+
+				// Cleanup the parameters now
+				delete[] call.iParams.iParams_val;
+
+				UpdateCompletionCode( request_reply, call_result );
+				if( call_result != ERR_NONE )
+				{
+					break;
+				}
+				// set the return values
+				request_reply->NewField( "RESULT", rv_integer );
+			}
+			break;
+			
+		// Any other method id results in an invalid method id result
+		default:
+			{
+				UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+			}
+			break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+int CGenericStub::GetStatus()
+{
+	return -1;
+}
+
+char *CGenericStub::GetLastRPCError( int *aIntError )
+{
+	return iGenericStub->GetLastRPCError( aIntError );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __GENERICSTUB_H__
+#define __GENERICSTUB_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE                                 0
+
+// errors
+#define ERR_SERVICE_ALREADY_STARTED             -1
+#define ERR_SERVICE_NOT_RUNNING                 -2
+#define ERR_ACTIVE_USER_SESSIONS                -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS    -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER  -5
+#define ERR_FAILED_TO_RETRIEVE_KEY              -6
+#define ERR_INSTANCE_DOES_NOT_EXIST             -7
+#define ERR_INVALID_METHOD                      -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE          -9
+#define ERR_STUB_ALREADY_CONNECTED              -10
+#define ERR_FAILED_TO_CONNECT                   -11
+#define ERR_STUB_NOT_CONNECTED                  -12
+#define ERR_INVALID_RV_POINTER                  -13
+#define ERR_RPC_ERROR                           -14
+#define ERR_INVALID_SERVICE                     -15
+#define ERR_INVALID_ERROR_CODE                  -16
+#define ERR_MISSING_PARAMETER                   -17
+#define ERR_INVALID_CALL                        -18
+
+#define ERR_INVALIDARG                          -50
+#define ERR_INVALIDSTATE                        -51
+#define ERR_GENERAL                             -52
+
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TComponentList(...);
+}
+#else
+bool_t xdr_GenericStub_TComponentList();
+#endif
+
+#define MAXPARAMNAMELENGTH 128
+#define MAXPARAMVALUELENGTH 1024
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TStartupInfo(...);
+}
+#else
+bool_t xdr_GenericStub_TStartupInfo();
+#endif
+
+
+struct TParam {
+	char iName[MAXPARAMNAMELENGTH];
+	char iValue[MAXPARAMVALUELENGTH];
+};
+typedef struct TParam TParam;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TParam(...);
+}
+#else
+bool_t xdr_GenericStub_TParam();
+#endif
+
+
+struct TCall {
+	int iCallID;
+	struct {
+		u_int iParams_len;
+		TParam *iParams_val;
+	} iParams;
+};
+typedef struct TCall TCall;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_GenericStub_TCall(...);
+}
+#else
+bool_t xdr_GenericStub_TCall();
+#endif
+
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_11( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_11();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_11( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_11();
+#endif /* __cplusplus */
+#define LIST_CONNECTIONS ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_connections_11( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_connections_11();
+#endif /* __cplusplus */
+#define CSTR_STARTPROCESS ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern int *cstr_startprocess_11( char ** arg, CLIENT *cl );
+}
+#else
+extern int *cstr_startprocess_11();
+#endif /* __cplusplus */
+#define DSTR_REMOVEPROCESS ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removeprocess_11( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removeprocess_11();
+#endif /* __cplusplus */
+#define RUN_COMMAND ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern int *run_command_11( TCall * arg, CLIENT *cl );
+}
+#else
+extern int *run_command_11();
+#endif /* __cplusplus */
+
+#endif /* __GENERICSTUB_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "penstd.x"
+
+/*******************************************************************************
+ *
+ * Constants
+ *
+ ******************************************************************************/
+const MAXPARAMNAMELENGTH			= 1024;
+const MAXPARAMVALUELENGTH			= 1024;
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+
+struct TStartupInfo {
+	int iEmpty;
+};
+
+struct TParam {
+	char	iName[MAXPARAMNAMELENGTH];
+	char	iValue[MAXPARAMVALUELENGTH];
+};
+
+struct TCall {
+	int	iCallID;
+	TParam	iParams<>;
+};
+
+/*******************************************************************************
+ *
+ * Interface
+ *
+ ******************************************************************************/
+program GENERICSTUB {
+	version GENERICSTUB_VERSION
+	{
+		/* Initialise the service */
+		int SS_STARTUPRPCSERVICE( TStartupInfo )		= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )			= 2;
+		TComponentList LIST_CONNECTIONS( void )			= 30;
+
+		/* Create instances */
+		int CSTR_STARTPROCESS( string )				= 31;
+		int DSTR_REMOVEPROCESS( int )				= 32;
+		
+		/* RunCommand Call */
+		int RUN_COMMAND( TCall )				= 10;
+
+	} = 1; 
+} = 0x34630999;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "GenericStub.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+static struct timeval RUNCMD_TIMEOUT = { 3600, 0 }; // One hour (should be plenty)
+
+int *
+ss_startuprpcservice_11(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_GenericStub_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_11(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_connections_11(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_CONNECTIONS, xdr_void, argp, xdr_GenericStub_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+cstr_startprocess_11(argp, clnt)
+	char **argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_STARTPROCESS, xdr_wrapstring, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+dstr_removeprocess_11(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEPROCESS, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+run_command_11(argp, clnt)
+	TCall *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	// Increase the timeout for this call
+	clnt_control(clnt, CLSET_TIMEOUT, &RUNCMD_TIMEOUT);
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, RUN_COMMAND, xdr_GenericStub_TCall, argp, xdr_int, &res, RUNCMD_TIMEOUT);
+
+	// Revert back to the default timeout 
+	clnt_control(clnt, CLSET_TIMEOUT, &TIMEOUT);
+	
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "GenericStub.h"
+
+
+bool_t
+xdr_GenericStub_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_GenericStub_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_GenericStub_TParam(xdrs, objp)
+	XDR *xdrs;
+	TParam *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iName, MAXPARAMNAMELENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iValue, MAXPARAMVALUELENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_GenericStub_TCall(xdrs, objp)
+	XDR *xdrs;
+	TCall *objp;
+{
+	if (!xdr_int(xdrs, &objp->iCallID)) {
+		return (FALSE);
+	}
+	if (!xdr_array(xdrs, (char **)&objp->iParams.iParams_val, (u_int *)&objp->iParams.iParams_len, ~0, sizeof(TParam), (void*)xdr_GenericStub_TParam)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CCHacontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,646 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCHacontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCHacontroller::CCHacontroller()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCHacontroller::~CCHacontroller()
+{
+	assert( cl == NULL );
+}
+
+char *CCHacontroller::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCHacontroller::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), HACONTROLLER, HACONTROLLER_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCHacontroller::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCHacontroller::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCHacontroller::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCHacontroller::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+int CCHacontroller::cstr_createagent( TResult *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_createagent_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+int CCHacontroller::dstr_removeagent( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removeagent_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+int CCHacontroller::startmobileagent( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *startmobileagent_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+int CCHacontroller::stopmobileagent( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopmobileagent_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+int CCHacontroller::getmobileagentstatus( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getmobileagentstatus_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+int CCHacontroller::setsingleoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setsingleoption_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+int CCHacontroller::removesingleoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *removesingleoption_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+int CCHacontroller::addlistoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *addlistoption_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+int CCHacontroller::removelistoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *removelistoption_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+int CCHacontroller::getstatus( int aArgs, THaStatus *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getstatus_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: destroytunnelid
+ * 
+ ***************************************************************************************/
+int CCHacontroller::destroytunnelid( THaTunnelID aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *destroytunnelid_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listtunnels
+ * 
+ ***************************************************************************************/
+int CCHacontroller::listtunnels( int aArgs, THaTunnelList *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *listtunnels_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: gettunnelinfo
+ * 
+ ***************************************************************************************/
+int CCHacontroller::gettunnelinfo( TGetTunnelRequest aArgs, THaTunnelInfo *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *gettunnelinfo_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+int CCHacontroller::settimeout( TTimeoutRequest aArgs )
+{
+	struct rpc_err rerr;
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	settimeout_8( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CCHacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCHACONTROLLER_H__
+#define __CCHACONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "hacontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCHacontroller
+ * 
+ ***************************************************************************************/
+class CCHacontroller
+{
+public:
+	// standard methods
+	CCHacontroller();
+	~CCHacontroller();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int cstr_createagent( TResult *rv );
+	int dstr_removeagent( int aArgs, TResult *rv );
+	int startmobileagent( int aArgs, TResult *rv );
+	int stopmobileagent( int aArgs, TResult *rv );
+	int getmobileagentstatus( int aArgs, TResult *rv );
+	int setsingleoption( TOptionDesc aArgs, TResult *rv );
+	int removesingleoption( TOptionDesc aArgs, TResult *rv );
+	int addlistoption( TOptionDesc aArgs, TResult *rv );
+	int removelistoption( TOptionDesc aArgs, TResult *rv );
+	int getstatus( int aArgs, THaStatus *rv );
+	int destroytunnelid( THaTunnelID aArgs, TResult *rv );
+	int listtunnels( int aArgs, THaTunnelList *rv );
+	int gettunnelinfo( TGetTunnelRequest aArgs, THaTunnelInfo *rv );
+	int settimeout( TTimeoutRequest aArgs );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CHomeAgentServiceStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,575 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+#include <time.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "strncpynt.h"
+#include "CHomeAgentServiceStub.h"
+#include "CCHacontroller.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXBUFFERSIZE	2048
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CHomeAgentServiceStub::CHomeAgentServiceStub()
+{
+	iClientHomeAgent = new CCHacontroller();
+	assert( iClientHomeAgent != NULL );
+}
+
+
+CHomeAgentServiceStub::~CHomeAgentServiceStub()
+{
+	delete iClientHomeAgent;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CHomeAgentServiceStub::StartUccsService( char *aHostName, int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	// check params
+	assert( aHostName != NULL );
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+	
+	// connect to the remote service
+	client_stub_error = iClientHomeAgent->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CHomeAgentServiceStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+
+	// check params
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iClientHomeAgent->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CHomeAgentServiceStub::IssueCommand( CDataRecord* aRequest )
+{
+	int i, err, client_stub_error, method_id = -1, virtual_network_address;
+	char *tmp_string;
+	CDataRecord *request_reply;
+
+	TStartupInfo arg_startup_info;
+	int sarg_integer;
+	TOptionDesc sarg_option;
+	THaTunnelID sarg_tunnel_id;
+	TTimeoutRequest sarg_timeout;
+	TGetTunnelRequest sarg_get_tunnel;
+
+	THaStatus rv_hastatus;
+	TResult rv_result;
+	TComponentList rv_component_list;
+	int rv_integer;
+	THaTunnelList rv_tunnels;
+	THaTunnelInfo rv_tunnel_info;
+ 	
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "BASEINTERFACE", &(arg_startup_info.iBaseInterfaceIndex), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "BASENETMASK", &(arg_startup_info.iBaseInterfaceNetworkMask), 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "BASESTARTRANGE", &(arg_startup_info.iBaseInterfaceStartHostAddressRange), 3, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "BASEENDRANGE", &(arg_startup_info.iBaseInterfaceStopHostAddressRange), 4, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "VIRTUALNETWORKPREFIX", &tmp_string, 5, 0, aRequest, request_reply );
+		arg_startup_info.iVirtualNetworkPrefix = inet_addr( tmp_string );
+		GETINTEGERARGUMENT( "VIRTUALNETWORKMASK", &(arg_startup_info.iVirtualNetworkPrefixMask), 6, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "VIRTUALNETWORKSIZE", &(arg_startup_info.iVirtualNetworkAllocSize), 7, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->ss_startuprpcservice( arg_startup_info, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );		
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set any return information
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+	
+
+	// sc_shutdownrpcservice
+	case 2:
+				
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+		
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+
+	// list_devices
+	case 30:
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "AGENTCOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "AGENTID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;		
+
+
+	// cstr_createagent
+	case 31:
+
+		//make the call and update the return value
+		client_stub_error = iClientHomeAgent->cstr_createagent( &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// dstr_removeagent
+	case 32:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientHomeAgent->dstr_removeagent( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// startmobileagent
+	case 3:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientHomeAgent->startmobileagent( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// stopmobileagent
+	case 4:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientHomeAgent->stopmobileagent( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// getmobileagentstatus
+	case 5:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->getmobileagentstatus( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "HOME_AGENT_PROCESS_STATUS", rv_result.iData0 );
+		break;
+
+
+	// setsingleoption
+	case 6:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "VALUE", &tmp_string, 3, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionValue, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionBlockStart[0] = sarg_option.iOptionBlockEnd[0] = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->setsingleoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// removesingleoption
+	case 33:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionValue[0] = sarg_option.iOptionBlockStart[0] = sarg_option.iOptionBlockEnd[0] = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->removesingleoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// addlistoption
+	case 7:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "VALUE", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionValue, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKSTART", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockStart, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKEND", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockEnd, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionToken[0] = 0;
+	
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->addlistoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// removelistoption
+	case 8:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKSTART", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockStart, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKEND", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockEnd, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionValue[0] = 0;
+	
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->removelistoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// getstatus
+	case 9:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->getstatus( sarg_integer, &rv_hastatus ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_hastatus.iCallResult.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_hastatus.iCallResult.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_hastatus.iCallResult.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_hastatus.iCallResult.iData1 );
+		request_reply->NewField( "STATUS_HOME_AGENT_ADDRESS", IntToAddress(rv_hastatus.iHomeAgentAddress) );
+		request_reply->NewField( "STATUS_VIRTUAL_NETWORK_SIZE", rv_hastatus.iVirtualNetworkSize );
+		for( i = 0; i < rv_hastatus.iVirtualNetworkSize; i++ ) {
+			virtual_network_address = ntohl( rv_hastatus.iVirtualNetworkStartAddress );
+			virtual_network_address |= i;
+			virtual_network_address = htonl( virtual_network_address );
+			AddIteratedStringFieldName( "VIRTUAL_NETWORK_ADDRESS", i, IntToAddress(virtual_network_address), request_reply );
+		}
+		request_reply->NewField( "STATUS_TUNNEL_COUNT", rv_hastatus.iTunnelCount );
+		request_reply->NewField( "STATUS_REQUESTS_ACCEPTED", rv_hastatus.iRequestsAccepted );
+		request_reply->NewField( "STATUS_REQUESTS_REJECTED", rv_hastatus.iRequestsRejected );
+		request_reply->NewField( "STATUS_DISCARDED_MALFORMED", rv_hastatus.iDiscardedMalformed );
+		request_reply->NewField( "STATUS_DISCARDED_UNKNOWN_EXTENSION", rv_hastatus.iDiscardedUnknownExtension );
+		request_reply->NewField( "STATUS_DISCARDED_VENDOR", rv_hastatus.iDiscardedVendor );
+		request_reply->NewField( "STATUS_ADVERTISEMENTS_SENT", rv_hastatus.iAdvertisementsSent );
+
+
+		break;
+		
+
+	// destroytunnelid
+	case 11:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_tunnel_id.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "MOBILE_NODE_ADDRESS", &tmp_string, 2, 0, aRequest, request_reply );
+		sarg_tunnel_id.iMobileNodeAddress = AddressToInt( tmp_string );
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->destroytunnelid( sarg_tunnel_id, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+
+	// listtunnels
+	case 12:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->listtunnels( sarg_integer, &rv_tunnels ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "TUNNEL_COUNT", rv_tunnels.THaTunnelList_len );
+		for( i = 0; i < (signed)(rv_tunnels.THaTunnelList_len); i++ ) {
+			AddIteratedIntegerFieldName( "TUNNEL_MOBILE_NODE_ADDRESS", i, ((rv_tunnels.THaTunnelList_val)[i]).iMobileNodeAddress, request_reply );
+		}		
+
+		// free the memory (if any was allocated)
+		if( rv_tunnels.THaTunnelList_len > 0 ) {
+			XdrFree( (char**)&(rv_tunnels.THaTunnelList_val), (int*)&(rv_tunnels.THaTunnelList_len) );
+		}
+		break;
+
+
+	// gettunnelinfo
+	case 14:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_get_tunnel.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "MOBILE_NODE_HOME_ADDRESS", &tmp_string, 2, 0, aRequest, request_reply );
+		sarg_get_tunnel.iMobileNodeAddress = AddressToInt( tmp_string );
+
+		// make the call and update the return value
+		client_stub_error = iClientHomeAgent->gettunnelinfo( sarg_get_tunnel, &rv_tunnel_info ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_tunnel_info.iCallResult.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_tunnel_info.iCallResult.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_tunnel_info.iCallResult.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_tunnel_info.iCallResult.iData1 );
+		request_reply->NewField( "MOBILE_NODE_ADDRESS", IntToAddress(rv_tunnel_info.iMobileNodeAddress) );
+		request_reply->NewField( "CAREOF_ADDRESS", IntToAddress(rv_tunnel_info.iCareofAddress) );
+		request_reply->NewField( "HOME_AGENT_ADDRESS", IntToAddress(rv_tunnel_info.iHomeAgentAddress) );
+		request_reply->NewField( "CREATION_TIME", ctime((time_t*)&(rv_tunnel_info.iCreationTime)) );
+		request_reply->NewField( "EXPIRATION_TIME", ctime((time_t*)&(rv_tunnel_info.iExpirationTime)) );
+		request_reply->NewField( "REFRESH_TIME", ctime((time_t*)&(rv_tunnel_info.iRefreshTime)) );
+		request_reply->NewField( "LAST_TIMESTAMP", ctime((time_t*)&(rv_tunnel_info.iLastTimestamp)) );
+		request_reply->NewField( "SPI", rv_tunnel_info.iSPI );
+		request_reply->NewField( "TIMEOUT", rv_tunnel_info.iTimeout );
+		break;
+
+
+	// settimeout
+	case 13:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_timeout.iAgentID), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "TIMEOUT", &(sarg_timeout.iTimeout), 2, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientHomeAgent->settimeout( sarg_timeout ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+		break;
+
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CHomeAgentServiceStub::GetLastRPCError( int *aIntError )
+{
+	return iClientHomeAgent->GetLastRPCError( aIntError );
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CHomeAgentServiceStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CHomeAgentServiceStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CHomeAgentServiceStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CHOMEAGENTSERVICESTUB_H__
+#define __CHOMEAGENTSERVICESTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration. 
+ *
+ ******************************************************************************/
+class CCHacontroller;
+
+
+/*******************************************************************************
+ *
+ * CHomeAgentServiceStub
+ *
+ ******************************************************************************/
+class CHomeAgentServiceStub : public IService, public CServiceAgentBase
+{
+public:
+	CHomeAgentServiceStub();
+	~CHomeAgentServiceStub();
+
+	int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError );
+	int StopUccsService( int *aLocalerror, int *aRemoteError );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCHacontroller *iClientHomeAgent;
+};
+
+#endif //__CHOMEAGENTSERVICESTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,369 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __HACONTROLLER_H__
+#define __HACONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TComponentList(...);
+}
+#else
+bool_t xdr_hacontroller_TComponentList();
+#endif
+
+#define X_MAXOPTIONTOKENSIZE 512
+#define X_MAXINTERFACENAMESIZE 64
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_DYNAMICS_CALL_FAILED -107
+#define ERR_CONFIG_FILE_ERROR -108
+#define ERR_POLICY_OUTPUT_PARSING_FAILED -110
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_NO_MORE_INTERFACES -112
+#define ERR_CREATE_INTERFACE_ERROR -113
+#define ERR_DESTROY_INTERFACE_ERROR -114
+#define ERR_INTEGER_ALLOCATOR_SETUP_ERROR -115
+#define ERR_VIRTUAL_NETWORK_CONFIGURATION_ERROR -116
+#define ERR_NO_MORE_VIRTUAL_NETWORKS -117
+
+struct TStartupInfo {
+	int iBaseInterfaceIndex;
+	int iBaseInterfaceNetworkMask;
+	int iBaseInterfaceStartHostAddressRange;
+	int iBaseInterfaceStopHostAddressRange;
+	int iVirtualNetworkPrefix;
+	int iVirtualNetworkPrefixMask;
+	int iVirtualNetworkAllocSize;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TStartupInfo(...);
+}
+#else
+bool_t xdr_hacontroller_TStartupInfo();
+#endif
+
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TResult(...);
+}
+#else
+bool_t xdr_hacontroller_TResult();
+#endif
+
+
+struct TOptionDesc {
+	int iAgentID;
+	char iOptionFilename[X_MAXOPTIONTOKENSIZE];
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+typedef struct TOptionDesc TOptionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TOptionDesc(...);
+}
+#else
+bool_t xdr_hacontroller_TOptionDesc();
+#endif
+
+
+struct THaStatus {
+	TResult iCallResult;
+	int iTunnelCount;
+	int iRequestsRejected;
+	int iRequestsAccepted;
+	int iDiscardedUnknownExtension;
+	int iDiscardedMalformed;
+	int iDiscardedVendor;
+	int iAdvertisementsSent;
+	int iHomeAgentAddress;
+	int iVirtualNetworkStartAddress;
+	int iVirtualNetworkSize;
+};
+typedef struct THaStatus THaStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaStatus(...);
+}
+#else
+bool_t xdr_hacontroller_THaStatus();
+#endif
+
+
+struct THaTunnelInfo {
+	TResult iCallResult;
+	u_int iMobileNodeAddress;
+	u_int iCareofAddress;
+	u_int iHomeAgentAddress;
+	int iCreationTime;
+	int iExpirationTime;
+	int iRefreshTime;
+	int iLastTimestamp;
+	int iSPI;
+	int iTimeout;
+};
+typedef struct THaTunnelInfo THaTunnelInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaTunnelInfo(...);
+}
+#else
+bool_t xdr_hacontroller_THaTunnelInfo();
+#endif
+
+
+struct THaTunnelID {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+typedef struct THaTunnelID THaTunnelID;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaTunnelID(...);
+}
+#else
+bool_t xdr_hacontroller_THaTunnelID();
+#endif
+
+
+typedef struct {
+	u_int THaTunnelList_len;
+	THaTunnelID *THaTunnelList_val;
+} THaTunnelList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaTunnelList(...);
+}
+#else
+bool_t xdr_hacontroller_THaTunnelList();
+#endif
+
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+typedef struct TTimeoutRequest TTimeoutRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TTimeoutRequest(...);
+}
+#else
+bool_t xdr_hacontroller_TTimeoutRequest();
+#endif
+
+
+struct TGetTunnelRequest {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+typedef struct TGetTunnelRequest TGetTunnelRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TGetTunnelRequest(...);
+}
+#else
+bool_t xdr_hacontroller_TGetTunnelRequest();
+#endif
+
+
+#define HACONTROLLER ((u_long)0x34630208)
+#define HACONTROLLER_VERSION ((u_long)8)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_8( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_8();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_8( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_8();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_8( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_8();
+#endif /* __cplusplus */
+#define CSTR_CREATEAGENT ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_createagent_8( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_createagent_8();
+#endif /* __cplusplus */
+#define DSTR_REMOVEAGENT ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *dstr_removeagent_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *dstr_removeagent_8();
+#endif /* __cplusplus */
+#define STARTMOBILEAGENT ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *startmobileagent_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *startmobileagent_8();
+#endif /* __cplusplus */
+#define STOPMOBILEAGENT ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopmobileagent_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopmobileagent_8();
+#endif /* __cplusplus */
+#define GETMOBILEAGENTSTATUS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getmobileagentstatus_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getmobileagentstatus_8();
+#endif /* __cplusplus */
+#define SETSINGLEOPTION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setsingleoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *setsingleoption_8();
+#endif /* __cplusplus */
+#define REMOVESINGLEOPTION ((u_long)33)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removesingleoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removesingleoption_8();
+#endif /* __cplusplus */
+#define ADDLISTOPTION ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *addlistoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *addlistoption_8();
+#endif /* __cplusplus */
+#define REMOVELISTOPTION ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removelistoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removelistoption_8();
+#endif /* __cplusplus */
+#define GETSTATUS ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern THaStatus *getstatus_8( int * arg, CLIENT *cl );
+}
+#else
+extern THaStatus *getstatus_8();
+#endif /* __cplusplus */
+#define DESTROYTUNNELID ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *destroytunnelid_8( THaTunnelID * arg, CLIENT *cl );
+}
+#else
+extern TResult *destroytunnelid_8();
+#endif /* __cplusplus */
+#define LISTTUNNELS ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern THaTunnelList *listtunnels_8( int * arg, CLIENT *cl );
+}
+#else
+extern THaTunnelList *listtunnels_8();
+#endif /* __cplusplus */
+#define GETTUNNELINFO ((u_long)14)
+#ifdef __cplusplus
+extern "C" {
+extern THaTunnelInfo *gettunnelinfo_8( TGetTunnelRequest * arg, CLIENT *cl );
+}
+#else
+extern THaTunnelInfo *gettunnelinfo_8();
+#endif /* __cplusplus */
+#define SETTIMEOUT ((u_long)13)
+#ifdef __cplusplus
+extern "C" {
+extern void *settimeout_8( TTimeoutRequest * arg, CLIENT *cl );
+}
+#else
+extern void *settimeout_8();
+#endif /* __cplusplus */
+
+#endif /* __HACONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../hacontroller/hacontroller.x"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hacontroller.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_8(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_hacontroller_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_8(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_8(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_hacontroller_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+cstr_createagent_8(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_CREATEAGENT, xdr_void, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+dstr_removeagent_8(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEAGENT, xdr_int, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+startmobileagent_8(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STARTMOBILEAGENT, xdr_int, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+stopmobileagent_8(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPMOBILEAGENT, xdr_int, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+getmobileagentstatus_8(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETMOBILEAGENTSTATUS, xdr_int, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+setsingleoption_8(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETSINGLEOPTION, xdr_hacontroller_TOptionDesc, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+removesingleoption_8(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, REMOVESINGLEOPTION, xdr_hacontroller_TOptionDesc, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+addlistoption_8(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ADDLISTOPTION, xdr_hacontroller_TOptionDesc, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+removelistoption_8(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, REMOVELISTOPTION, xdr_hacontroller_TOptionDesc, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+THaStatus *
+getstatus_8(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static THaStatus res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETSTATUS, xdr_int, argp, xdr_hacontroller_THaStatus, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+destroytunnelid_8(argp, clnt)
+	THaTunnelID *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DESTROYTUNNELID, xdr_hacontroller_THaTunnelID, argp, xdr_hacontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+THaTunnelList *
+listtunnels_8(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static THaTunnelList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LISTTUNNELS, xdr_int, argp, xdr_hacontroller_THaTunnelList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+THaTunnelInfo *
+gettunnelinfo_8(argp, clnt)
+	TGetTunnelRequest *argp;
+	CLIENT *clnt;
+{
+	static THaTunnelInfo res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETTUNNELINFO, xdr_hacontroller_TGetTunnelRequest, argp, xdr_hacontroller_THaTunnelInfo, &res, TIMEOUT);
+	return (&res);
+}
+
+
+void *
+settimeout_8(argp, clnt)
+	TTimeoutRequest *argp;
+	CLIENT *clnt;
+{
+	static char res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETTIMEOUT, xdr_hacontroller_TTimeoutRequest, argp, xdr_void, &res, TIMEOUT);
+	return ((void *)&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,270 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hacontroller.h"
+
+
+bool_t
+xdr_hacontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceIndex)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceNetworkMask)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceStartHostAddressRange)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceStopHostAddressRange)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkPrefix)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkPrefixMask)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkAllocSize)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iServiceResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSubComponentResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData0)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData1)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TOptionDesc(xdrs, objp)
+	XDR *xdrs;
+	TOptionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionFilename, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionToken, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionValue, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockStart, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockEnd, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaStatus(xdrs, objp)
+	XDR *xdrs;
+	THaStatus *objp;
+{
+	if (!xdr_hacontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelCount)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsRejected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsAccepted)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedUnknownExtension)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedMalformed)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedVendor)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iAdvertisementsSent)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkStartAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkSize)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaTunnelInfo(xdrs, objp)
+	XDR *xdrs;
+	THaTunnelInfo *objp;
+{
+	if (!xdr_hacontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iCareofAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCreationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExpirationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRefreshTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLastTimestamp)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSPI)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaTunnelID(xdrs, objp)
+	XDR *xdrs;
+	THaTunnelID *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaTunnelList(xdrs, objp)
+	XDR *xdrs;
+	THaTunnelList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->THaTunnelList_val, (u_int *)&objp->THaTunnelList_len, ~0, sizeof(THaTunnelID), (void*)xdr_hacontroller_THaTunnelID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TTimeoutRequest(xdrs, objp)
+	XDR *xdrs;
+	TTimeoutRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TGetTunnelRequest(xdrs, objp)
+	XDR *xdrs;
+	TGetTunnelRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CCHostexecute.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,234 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCHostexecute.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCHostexecute::CCHostexecute()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCHostexecute::~CCHostexecute()
+{
+	assert( cl == NULL );
+}
+
+char *CCHostexecute::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCHostexecute::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), HOSTEXECUTE, HOSTEXECUTE_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCHostexecute::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCHostexecute::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_3( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCHostexecute::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_3( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCHostexecute::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_3( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_executecommand
+ * 
+ ***************************************************************************************/
+int CCHostexecute::st_executecommand( TExecuteRequest aArgs, TExecuteResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_executecommand_3( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CCHostexecute.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCHOSTEXECUTE_H__
+#define __CCHOSTEXECUTE_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "hostexecute.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCHostexecute
+ * 
+ ***************************************************************************************/
+class CCHostexecute
+{
+public:
+	// standard methods
+	CCHostexecute();
+	~CCHostexecute();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int st_executecommand( TExecuteRequest aArgs, TExecuteResult *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CHostExecuteStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "strncpynt.h"
+#include "CHostExecuteStub.h"
+#include "CCHostexecute.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CHostExecuteStub::CHostExecuteStub()
+{
+	iClientHostExecute = new CCHostexecute();
+	assert( iClientHostExecute != NULL );
+}
+
+
+CHostExecuteStub::~CHostExecuteStub()
+{
+	delete iClientHostExecute;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CHostExecuteStub::StartUccsService( char *aHostName,  int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	// check params
+	assert( aHostName != NULL );
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+	
+	// connect to the remote service
+	client_stub_error = iClientHostExecute->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CHostExecuteStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+
+	// check params
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iClientHostExecute->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CHostExecuteStub::IssueCommand( CDataRecord* aRequest )
+{
+	int i, err, client_stub_error, method_id = -1;
+	char *tmp_string;
+	CDataRecord *request_reply;
+
+	TStartupInfo sarg_startup_info;
+	int rv_integer, sarg_integer;
+	TExecuteRequest sarg_execute_request;
+	TExecuteResult rv_execute_result;
+	TComponentList rv_component_list;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// extract the parameters
+		sarg_startup_info.iEmpty = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecute->ss_startuprpcservice( sarg_startup_info, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );		
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set any return information
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2: 
+		
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+		
+		// make the call and update the return value
+		client_stub_error = iClientHostExecute->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// list_devices
+	case 30:
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecute->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "PROCESSCOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "PID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;		
+
+	// st_executecommand
+	case 3:
+
+		// extract the parameters
+		GETSTRINGARGUMENT( "COMMAND", &tmp_string, 1, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_execute_request.iCommandLine, tmp_string, MAXCOMMANDLINE );
+		GETINTEGERARGUMENT( "TIMEOUT", &(sarg_execute_request.iTimeout), 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "GETSTDOUT", &(sarg_execute_request.iRecordStandardOut), 3, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "GETSTDERR", &(sarg_execute_request.iRecordStandartError), 4, 1, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecute->st_executecommand( sarg_execute_request, &rv_execute_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// extract the parameters
+		request_reply->NewField( "RESULT", rv_execute_result.iResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_execute_result.iErrorCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_execute_result.iErrorDetail );
+		request_reply->NewField( "PROCESS_EXIT_REASON", rv_execute_result.iProcessExitReason );
+		request_reply->NewField( "PROCESS_EXIT_DETAIL", rv_execute_result.iProcessExitDetail );
+		request_reply->NewField( "STANDARD_OUTPUT_LENGTH", rv_execute_result.iStandardOut.TVarData_len );
+		request_reply->NewField( "STANDARD_OUTPUT", rv_execute_result.iStandardOut.TVarData_val );
+		request_reply->NewField( "STANDARD_ERROR_LENGTH", rv_execute_result.iStandardError.TVarData_len );
+		request_reply->NewField( "STANDARD_ERROR", rv_execute_result.iStandardError.TVarData_val );
+		break;
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CHostExecuteStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CHostExecuteStub::GetLastRPCError( int *aIntError )
+{
+	return iClientHostExecute->GetLastRPCError( aIntError );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CHostExecuteStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CHostExecuteStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CHOSTEXECUTESTUB_H__
+#define __CHOSTEXECUTESTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration. 
+ *
+ ******************************************************************************/
+class CCHostexecute;
+
+
+/*******************************************************************************
+ *
+ * CHostExecuteStub
+ *
+ ******************************************************************************/
+class CHostExecuteStub : public IService, public CServiceAgentBase
+{
+public:
+	CHostExecuteStub();
+	~CHostExecuteStub();
+
+	int StartUccsService( char *aHostName, int* aLocalErr, int* aRemoteErr );
+	int StopUccsService(int* aLocalErr, int* aRemoteErr );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCHostexecute *iClientHostExecute;
+};
+
+#endif //__CHOSTEXECUTESTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __HOSTEXECUTE_H__
+#define __HOSTEXECUTE_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TComponentList(...);
+}
+#else
+bool_t xdr_hostexecute_TComponentList();
+#endif
+
+#define MAXCOMMANDLINE 1024
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_SET_SIGNAL_ERROR -120
+#define ERR_EXECUTE_PROCESS_ERROR -122
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TVarData(...);
+}
+#else
+bool_t xdr_hostexecute_TVarData();
+#endif
+
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TStartupInfo(...);
+}
+#else
+bool_t xdr_hostexecute_TStartupInfo();
+#endif
+
+
+struct TExecuteRequest {
+	char iCommandLine[MAXCOMMANDLINE];
+	int iRecordStandardOut;
+	int iRecordStandartError;
+	int iTimeout;
+};
+typedef struct TExecuteRequest TExecuteRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TExecuteRequest(...);
+}
+#else
+bool_t xdr_hostexecute_TExecuteRequest();
+#endif
+
+
+struct TExecuteResult {
+	int iResult;
+	int iErrorCode;
+	int iErrorDetail;
+	int iProcessExitReason;
+	int iProcessExitDetail;
+	TVarData iStandardOut;
+	TVarData iStandardError;
+};
+typedef struct TExecuteResult TExecuteResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecute_TExecuteResult(...);
+}
+#else
+bool_t xdr_hostexecute_TExecuteResult();
+#endif
+
+
+#define HOSTEXECUTE ((u_long)0x34630203)
+#define HOSTEXECUTE_VERSION ((u_long)3)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_3( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_3();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_3( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_3();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_3( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_3();
+#endif /* __cplusplus */
+#define ST_EXECUTECOMMAND ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TExecuteResult *st_executecommand_3( TExecuteRequest * arg, CLIENT *cl );
+}
+#else
+extern TExecuteResult *st_executecommand_3();
+#endif /* __cplusplus */
+
+#endif /* __HOSTEXECUTE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../HostExecuteSimple/hostexecute.x"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hostexecute.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_3(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_hostexecute_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_3(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_3(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_hostexecute_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TExecuteResult *
+st_executecommand_3(argp, clnt)
+	TExecuteRequest *argp;
+	CLIENT *clnt;
+{
+	static TExecuteResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_EXECUTECOMMAND, xdr_hostexecute_TExecuteRequest, argp, xdr_hostexecute_TExecuteResult, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hostexecute.h"
+
+
+bool_t
+xdr_hostexecute_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TExecuteRequest(xdrs, objp)
+	XDR *xdrs;
+	TExecuteRequest *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iCommandLine, MAXCOMMANDLINE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRecordStandardOut)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRecordStandartError)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecute_TExecuteResult(xdrs, objp)
+	XDR *xdrs;
+	TExecuteResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_hostexecute_TVarData(xdrs, &objp->iStandardOut)) {
+		return (FALSE);
+	}
+	if (!xdr_hostexecute_TVarData(xdrs, &objp->iStandardError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CCHostexecuteasync.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,426 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCHostexecuteasync.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCHostexecuteasync::CCHostexecuteasync()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCHostexecuteasync::~CCHostexecuteasync()
+{
+	assert( cl == NULL );
+}
+
+char *CCHostexecuteasync::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCHostexecuteasync::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), HOSTEXECUTEASYNC, HOSTEXECUTEASYNC_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCHostexecuteasync::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startprocess
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::cstr_startprocess( char *aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_startprocess_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeprocess
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::dstr_removeprocess( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removeprocess_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: killprocess
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::killprocess( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *killprocess_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopprocess
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::stopprocess( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopprocess_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getprocessinfo
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::getprocessinfo( int aArgs, THostExecuteAsyncProcessInfo *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getprocessinfo_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstandardoutput
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::getstandardoutput( int aArgs, TVarData *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getstandardoutput_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstandarderror
+ * 
+ ***************************************************************************************/
+int CCHostexecuteasync::getstandarderror( int aArgs, TVarData *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getstandarderror_9( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CCHostexecuteasync.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCHOSTEXECUTEASYNC_H__
+#define __CCHOSTEXECUTEASYNC_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "hostexecuteasync.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCHostexecuteasync
+ * 
+ ***************************************************************************************/
+class CCHostexecuteasync
+{
+public:
+	// standard methods
+	CCHostexecuteasync();
+	~CCHostexecuteasync();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int cstr_startprocess( char *aArgs, TResult *rv );
+	int dstr_removeprocess( int aArgs, TResult *rv );
+	int killprocess( int aArgs, TResult *rv );
+	int stopprocess( int aArgs, TResult *rv );
+	int getprocessinfo( int aArgs, THostExecuteAsyncProcessInfo *rv );
+	int getstandardoutput( int aArgs, TVarData *rv );
+	int getstandarderror( int aArgs, TVarData *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CHostExecuteAsyncStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,366 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CHostExecuteAsyncStub.h"
+#include "CCHostexecuteasync.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CHostExecuteAsyncStub::CHostExecuteAsyncStub()
+{
+	iClientHostExecuteClient = new CCHostexecuteasync();
+	assert( iClientHostExecuteClient != NULL );
+}
+
+
+CHostExecuteAsyncStub::~CHostExecuteAsyncStub()
+{
+	delete iClientHostExecuteClient;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CHostExecuteAsyncStub::StartUccsService( char *aHostName,  int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	// check params
+	assert( aHostName != NULL );
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+	
+	// connect to the remote service
+	client_stub_error = iClientHostExecuteClient->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CHostExecuteAsyncStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+
+	// check params
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iClientHostExecuteClient->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CHostExecuteAsyncStub::IssueCommand( CDataRecord *aRequest )
+{
+	int i, err, client_stub_error, method_id = -1, length_to_output;
+	char *tmp_string;
+	CDataRecord *request_reply;
+
+	TStartupInfo arg_startup_info;
+	int sarg_integer;
+
+	int rv_integer;
+	THostExecuteAsyncProcessInfo rv_proc_info;
+	TComponentList rv_component_list;
+	TResult rv_result;
+	TVarData rv_vardata;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// extract the parameters
+		arg_startup_info.iDummy = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->ss_startuprpcservice( arg_startup_info, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );		
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set any return information
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2: 
+		
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+		
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+
+	// list_devices
+	case 30:
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "PROCESSCOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "PID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;		
+
+
+	// cstr_startprocess
+	case 31:
+
+		// extract the parameters
+		GETSTRINGARGUMENT( "CMD", &tmp_string, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->cstr_startprocess( tmp_string, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );
+		break;		
+
+
+	// dstr_removeprocess
+	case 32:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "PID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->dstr_removeprocess( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );
+		break;		
+
+
+	// killprocess
+	case 5:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "PID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->killprocess( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );
+		break;		
+
+
+	// stopprocess
+	case 6:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "PID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->stopprocess( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );
+		break;		
+
+
+	// getprocessinfo
+	case 7:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "PID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->getprocessinfo( sarg_integer, &rv_proc_info );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_proc_info.iErrorCode );
+		request_reply->NewField( "RESULT_DETAIL", rv_proc_info.iErrorDetail );
+		request_reply->NewField( "PROCESS_COMMAND", rv_proc_info.iCommandLine );
+		request_reply->NewField( "PROCESS_STATUS", rv_proc_info.iProcessStatus );
+		request_reply->NewField( "PROCESS_EXIT_REASON", rv_proc_info.iProcessExitReason );
+		request_reply->NewField( "PROCESS_EXIT_CODE", rv_proc_info.iExitCode );
+		break;		
+
+
+	// getstandardoutput
+	case 8:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "PID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->getstandardoutput( sarg_integer, &rv_vardata );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		length_to_output = ((rv_vardata.TVarData_len > 0) ? (rv_vardata.TVarData_len - 1) : rv_vardata.TVarData_len);
+		request_reply->NewField( "STDOUT", (char*)(rv_vardata.TVarData_val) );
+		request_reply->NewField( "LENGTH", length_to_output );
+
+		// free the memory (if any was allocated)
+		if( rv_vardata.TVarData_len > 0 ) {
+			XdrFree( (char**)&(rv_vardata.TVarData_val), (int*)&(rv_vardata.TVarData_len) );
+		}
+		break;		
+
+
+	// getstandarderror
+	case 9:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "PID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientHostExecuteClient->getstandarderror( sarg_integer, &rv_vardata );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		length_to_output = ((rv_vardata.TVarData_len > 0) ? (rv_vardata.TVarData_len - 1) : rv_vardata.TVarData_len);
+		request_reply->NewField( "STDERR", (char*)(rv_vardata.TVarData_val) );
+		request_reply->NewField( "LENGTH", length_to_output );
+
+		// free the memory (if any was allocated)
+		if( rv_vardata.TVarData_len > 0 ) {
+			XdrFree( (char**)&(rv_vardata.TVarData_val), (int*)&(rv_vardata.TVarData_len) );
+		}
+		break;		
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CHostExecuteAsyncStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CHostExecuteAsyncStub::GetLastRPCError( int *aIntError )
+{
+	return iClientHostExecuteClient->GetLastRPCError( aIntError );
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CHostExecuteAsyncStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CHostExecuteAsyncStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CHOSTEXECUTEASYNCSTUB_H__
+#define __CHOSTEXECUTEASYNCSTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration. 
+ *
+ ******************************************************************************/
+class CCHostexecuteasync;
+
+
+/*******************************************************************************
+ *
+ * CHostExecuteAsyncStub
+ *
+ ******************************************************************************/
+class CHostExecuteAsyncStub : public IService, public CServiceAgentBase
+{
+public:
+	CHostExecuteAsyncStub();
+	~CHostExecuteAsyncStub();
+
+	int StartUccsService( char *aHostName, int* aLocalErr, int* aRemoteErr );
+	int StopUccsService(int* aLocalErr, int* aRemoteErr );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCHostexecuteasync *iClientHostExecuteClient;
+};
+
+#endif //__CHOSTEXECUTEASYNCSTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __HOSTEXECUTEASYNC_H__
+#define __HOSTEXECUTEASYNC_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TComponentList(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TComponentList();
+#endif
+
+#define MAXCOMMANDLINE 1024
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TResult(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TResult();
+#endif
+
+
+struct THostExecuteAsyncProcessInfo {
+	int iErrorCode;
+	int iErrorDetail;
+	char iCommandLine[MAXCOMMANDLINE];
+	int iProcessStatus;
+	int iProcessExitReason;
+	int iExitCode;
+};
+typedef struct THostExecuteAsyncProcessInfo THostExecuteAsyncProcessInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_THostExecuteAsyncProcessInfo(...);
+}
+#else
+bool_t xdr_hostexecuteasync_THostExecuteAsyncProcessInfo();
+#endif
+
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TVarData(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TVarData();
+#endif
+
+
+struct TStartupInfo {
+	int iDummy;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hostexecuteasync_TStartupInfo(...);
+}
+#else
+bool_t xdr_hostexecuteasync_TStartupInfo();
+#endif
+
+
+#define HOSTEXECUTEASYNC ((u_long)0x34630209)
+#define HOSTEXECUTEASYNC_VERSION ((u_long)9)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_9( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_9();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_9( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_9();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_9( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_9();
+#endif /* __cplusplus */
+#define CSTR_STARTPROCESS ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_startprocess_9( char ** arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_startprocess_9();
+#endif /* __cplusplus */
+#define DSTR_REMOVEPROCESS ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *dstr_removeprocess_9( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *dstr_removeprocess_9();
+#endif /* __cplusplus */
+#define KILLPROCESS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *killprocess_9( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *killprocess_9();
+#endif /* __cplusplus */
+#define STOPPROCESS ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopprocess_9( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopprocess_9();
+#endif /* __cplusplus */
+#define GETPROCESSINFO ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern THostExecuteAsyncProcessInfo *getprocessinfo_9( int * arg, CLIENT *cl );
+}
+#else
+extern THostExecuteAsyncProcessInfo *getprocessinfo_9();
+#endif /* __cplusplus */
+#define GETSTANDARDOUTPUT ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getstandardoutput_9( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getstandardoutput_9();
+#endif /* __cplusplus */
+#define GETSTANDARDERROR ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getstandarderror_9( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getstandarderror_9();
+#endif /* __cplusplus */
+
+#endif /* __HOSTEXECUTEASYNC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../HostExecuteAsync/hostexecuteasync.x"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hostexecuteasync.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_9(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_hostexecuteasync_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_9(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_9(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_hostexecuteasync_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+cstr_startprocess_9(argp, clnt)
+	char **argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_STARTPROCESS, xdr_wrapstring, argp, xdr_hostexecuteasync_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+dstr_removeprocess_9(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEPROCESS, xdr_int, argp, xdr_hostexecuteasync_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+killprocess_9(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, KILLPROCESS, xdr_int, argp, xdr_hostexecuteasync_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+stopprocess_9(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPPROCESS, xdr_int, argp, xdr_hostexecuteasync_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+THostExecuteAsyncProcessInfo *
+getprocessinfo_9(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static THostExecuteAsyncProcessInfo res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETPROCESSINFO, xdr_int, argp, xdr_hostexecuteasync_THostExecuteAsyncProcessInfo, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TVarData *
+getstandardoutput_9(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TVarData res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETSTANDARDOUTPUT, xdr_int, argp, xdr_hostexecuteasync_TVarData, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TVarData *
+getstandarderror_9(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TVarData res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETSTANDARDERROR, xdr_int, argp, xdr_hostexecuteasync_TVarData, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hostexecuteasync.h"
+
+
+bool_t
+xdr_hostexecuteasync_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iStandardResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExtendedCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSystemError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_THostExecuteAsyncProcessInfo(xdrs, objp)
+	XDR *xdrs;
+	THostExecuteAsyncProcessInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iErrorCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iCommandLine, MAXCOMMANDLINE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExitCode)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hostexecuteasync_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iDummy)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Internal/CInternalStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* System Includes
+*
+*/
+
+
+#include <assert.h>
+#include <winsock2.h>
+#include <windows.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "..\..\Core\UCCS_ServiceValues.h"
+#include "..\..\Core\UCCS_ErrorCodes.h"
+#include "CInternalStub.h"
+#include "..\..\..\include\penstd.h"
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CInternalStub::CInternalStub()
+{
+}
+
+
+CInternalStub::~CInternalStub()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CInternalStub::StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError )
+{
+	*aLocalError = *aRemoteError = 0;
+	return 0;
+}
+
+
+int CInternalStub::StopUccsService( int *aLocalError, int *aRemoteError )
+{
+	*aLocalError = *aRemoteError = 0;
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CInternalStub::IssueCommand( CDataRecord* aRequest )
+{
+	int err;
+	int method_id;
+	int sarg_integer;
+	char *sarg_string;
+	CDataRecord *request_reply;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	assert( err == UCCS_OK );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// pause
+	case 1:
+		// extract the parameters
+		GETINTEGERARGUMENT( "PERIOD", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// implement the call
+		Sleep( sarg_integer );
+
+		// update the result
+		UpdateCompletionCode( request_reply, ERR_NONE );
+		break;
+		
+	// print message 
+	case 3:
+		// extract the parameters
+		GETSTRINGARGUMENT( "MSG", &sarg_string, 1, 0, aRequest, request_reply );
+
+		// implement the call
+		fprintf( stderr, "%s\n", sarg_string );
+		fflush( stderr );
+
+		// update the result
+		UpdateCompletionCode( request_reply, ERR_NONE );
+		break;
+
+	// null
+	case 4:
+		UpdateCompletionCode( request_reply, ERR_NONE );
+		break;
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CInternalStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Internal/CInternalStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* CInternalStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+#ifndef __CINTERNALSTUB_H__
+#define __CINTERNALSTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "..\..\Core\UCCS_Interfaces.h"
+#include "..\CommonServiceStub\CServiceAgentBase.h"
+
+/*******************************************************************************
+ *
+ * CMobsterServiceStub
+ *
+ ******************************************************************************/
+class CInternalStub : public IService, public CServiceAgentBase
+{
+public:
+	CInternalStub();
+	~CInternalStub();
+
+	int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError );
+	int StopUccsService( int *aLocalerror, int *aRemoteError );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+};
+
+#endif //__CINTERNALSTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CCMncontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,871 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCMncontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCMncontroller::CCMncontroller()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCMncontroller::~CCMncontroller()
+{
+	assert( cl == NULL );
+}
+
+char *CCMncontroller::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCMncontroller::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), MNCONTROLLER, MNCONTROLLER_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCMncontroller::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCMncontroller::ss_startuprpcservice( int *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCMncontroller::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCMncontroller::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+int CCMncontroller::cstr_createagent( TResult *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_createagent_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+int CCMncontroller::dstr_removeagent( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removeagent_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+int CCMncontroller::startmobileagent( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *startmobileagent_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+int CCMncontroller::stopmobileagent( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopmobileagent_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+int CCMncontroller::getmobileagentstatus( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getmobileagentstatus_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+int CCMncontroller::setsingleoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setsingleoption_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+int CCMncontroller::removesingleoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *removesingleoption_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+int CCMncontroller::addlistoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *addlistoption_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+int CCMncontroller::removelistoption( TOptionDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *removelistoption_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sethomeaddress
+ * 
+ ***************************************************************************************/
+int CCMncontroller::sethomeaddress( THomeAddressDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sethomeaddress_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getcareofaddress
+ * 
+ ***************************************************************************************/
+int CCMncontroller::getcareofaddress( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getcareofaddress_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: connect
+ * 
+ ***************************************************************************************/
+int CCMncontroller::connect( TTunnelingModeDesc aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *connect_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: disconnect
+ * 
+ ***************************************************************************************/
+int CCMncontroller::disconnect( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *disconnect_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: confirm
+ * 
+ ***************************************************************************************/
+int CCMncontroller::confirm( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *confirm_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: rescaninterfaces
+ * 
+ ***************************************************************************************/
+int CCMncontroller::rescaninterfaces( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *rescaninterfaces_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setfapolicy
+ * 
+ ***************************************************************************************/
+int CCMncontroller::setfapolicy( TPolicyRequest aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setfapolicy_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getfapolicy
+ * 
+ ***************************************************************************************/
+int CCMncontroller::getfapolicy( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getfapolicy_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+int CCMncontroller::getstatus( int aArgs, TMobileNodeStatus *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getstatus_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listforeignagents
+ * 
+ ***************************************************************************************/
+int CCMncontroller::listforeignagents( int aArgs, TForeignAgentList *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *listforeignagents_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getforeignagentinfo
+ * 
+ ***************************************************************************************/
+int CCMncontroller::getforeignagentinfo( TForeignAgentInfoRequest aArgs, TForeignAgentInfo *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getforeignagentinfo_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+int CCMncontroller::settimeout( TTimeoutRequest aArgs )
+{
+	struct rpc_err rerr;
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	settimeout_5( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CCMncontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCMNCONTROLLER_H__
+#define __CCMNCONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "mncontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCMncontroller
+ * 
+ ***************************************************************************************/
+class CCMncontroller
+{
+public:
+	// standard methods
+	CCMncontroller();
+	~CCMncontroller();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int cstr_createagent( TResult *rv );
+	int dstr_removeagent( int aArgs, int *rv );
+	int startmobileagent( int aArgs, TResult *rv );
+	int stopmobileagent( int aArgs, TResult *rv );
+	int getmobileagentstatus( int aArgs, TResult *rv );
+	int setsingleoption( TOptionDesc aArgs, TResult *rv );
+	int removesingleoption( TOptionDesc aArgs, TResult *rv );
+	int addlistoption( TOptionDesc aArgs, TResult *rv );
+	int removelistoption( TOptionDesc aArgs, TResult *rv );
+	int sethomeaddress( THomeAddressDesc aArgs, TResult *rv );
+	int getcareofaddress( int aArgs, TResult *rv );
+	int connect( TTunnelingModeDesc aArgs, TResult *rv );
+	int disconnect( int aArgs, TResult *rv );
+	int confirm( int aArgs, TResult *rv );
+	int rescaninterfaces( int aArgs, TResult *rv );
+	int setfapolicy( TPolicyRequest aArgs, TResult *rv );
+	int getfapolicy( int aArgs, TResult *rv );
+	int getstatus( int aArgs, TMobileNodeStatus *rv );
+	int listforeignagents( int aArgs, TForeignAgentList *rv );
+	int getforeignagentinfo( TForeignAgentInfoRequest aArgs, TForeignAgentInfo *rv );
+	int settimeout( TTimeoutRequest aArgs );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CMobileAgentServiceStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,706 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "strncpynt.h"
+#include "CMobileAgentServiceStub.h"
+#include "CCMncontroller.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+#define MAXBUFFERSIZE	2048
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CMobileAgentServiceStub::CMobileAgentServiceStub()
+{
+	iClientMobileAgent = new CCMncontroller();
+	assert( iClientMobileAgent != NULL );
+}
+
+
+CMobileAgentServiceStub::~CMobileAgentServiceStub()
+{
+	delete iClientMobileAgent;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CMobileAgentServiceStub::StartUccsService( char *aHostName, int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	// check params
+	assert( aHostName != NULL );
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+	
+	//copy to class variable so that startRPCservice can use it later on
+	iHostName = aHostName;
+
+	// connect to the remote service
+	client_stub_error = iClientMobileAgent->Connect( iHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CMobileAgentServiceStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+
+	// check params
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iClientMobileAgent->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CMobileAgentServiceStub::IssueCommand( CDataRecord* aRequest )
+{
+	int i, err, client_stub_error, method_id = -1;
+	char *tmp_string;
+	CDataRecord *request_reply;
+
+	int rv_integer, sarg_integer;
+	TComponentList rv_component_list;
+	TOptionDesc sarg_option;
+	TResult rv_result;
+	TTunnelingModeDesc sarg_tunnel_mode;
+	TPolicyRequest sarg_policy_request;
+	TMobileNodeStatus rv_mnstatus;
+	TForeignAgentList rv_foreign_agent_list;
+	TForeignAgentInfo rv_foreign_agent_info, *tmp_foreign_agent_info;
+	TTimeoutRequest sarg_timeout;
+	TForeignAgentInfoRequest sarg_foreign_agent_info;
+	THomeAddressDesc sarg_home_address;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->ss_startuprpcservice( &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );		
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set any return information
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2:
+			
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+		
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// list_devices
+	case 30:
+
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "AGENTCOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "AGENTID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;		
+
+	// cstr_createagent
+	case 31:
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->cstr_createagent( &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+	// dstr_removeagent
+	case 32:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->dstr_removeagent( sarg_integer, &rv_integer ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+	
+	// startmobileagent
+	case 3:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->startmobileagent( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		break;
+
+	// stopmobileagent
+	case 4: 
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->stopmobileagent( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		break;
+
+	// getmobileagentstatus
+	case 5:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->getmobileagentstatus( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "MOBILE_NODE_AGENT_PROCESS_STATUS", rv_result.iData0 );
+		break;
+
+	// setsingleoption
+	case 6:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "VALUE", &tmp_string, 3, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionValue, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionBlockStart[0] = sarg_option.iOptionBlockEnd[0] = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->setsingleoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// removesingleoption
+	case 33:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionValue[0] = sarg_option.iOptionBlockStart[0] = sarg_option.iOptionBlockEnd[0] = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->removesingleoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// addlistoption
+	case 7:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "VALUE", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionValue, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKSTART", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockStart, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKEND", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockEnd, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionToken[0] = 0;
+	
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->addlistoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+	// removelistoption
+	case 8:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_option.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "TOKEN", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionToken, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKSTART", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockStart, tmp_string, X_MAXOPTIONTOKENSIZE );
+		GETSTRINGARGUMENT( "BLOCKEND", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_option.iOptionBlockEnd, tmp_string, X_MAXOPTIONTOKENSIZE );
+		sarg_option.iOptionValue[0] = 0;
+	
+		// make the call and update the return value
+		client_stub_error = iClientMobileAgent->removelistoption( sarg_option, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		break;
+
+
+	// sethomeaddress
+	case 23:
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_home_address.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "HOME_ADDRESS", &tmp_string, 2, 0, aRequest, request_reply );
+		sarg_home_address.iHomeAddress = inet_addr( tmp_string );
+		GETINTEGERARGUMENT( "HOME_ADDRESS_PREFIX", &(sarg_home_address.iHomeAddressPrefix), 3, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "HOME_AGENT_ADDRESS", &tmp_string, 4, 0, aRequest, request_reply );
+		sarg_home_address.iHomeAgentAddress = inet_addr( tmp_string );
+		GETSTRINGARGUMENT( "INTERFACE", &tmp_string, 5, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_home_address.iInterfaceName, tmp_string, X_MAXINTERFACENAMELEN );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->sethomeaddress( sarg_home_address, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+	// getcareofaddress
+	case 9:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->getcareofaddress( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", IntToAddress(rv_result.iData0) );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+		
+	
+	// getstatus
+	case 11:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->getstatus( sarg_integer, &rv_mnstatus ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_mnstatus.iCallResult.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_mnstatus.iCallResult.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_mnstatus.iCallResult.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_mnstatus.iCallResult.iData1 );
+		request_reply->NewField( "STATUS_CONNECTED", rv_mnstatus.iConnected );
+		request_reply->NewField( "STATUS_TUNNEL_UP", rv_mnstatus.iTunnelUp );
+		request_reply->NewField( "STATUS_LOCAL_ADDRESS", IntToAddress(rv_mnstatus.iLocalAddress) );
+		request_reply->NewField( "STATUS_COLOCATED_ADDRESS", IntToAddress(rv_mnstatus.iColocatedAddress) );
+		request_reply->NewField( "STATUS_FOREIGN_AGENT_ADDRESS", IntToAddress(rv_mnstatus.iForeignAgentAddress) );
+		request_reply->NewField( "STATUS_HOME_AGENT_ADDRESS", IntToAddress(rv_mnstatus.iHomeAgentAddress) );
+		request_reply->NewField( "STATUS_HOME_ADDRESS", IntToAddress(rv_mnstatus.iHomeAddress) );
+		request_reply->NewField( "STATUS_LIFETIME_REMAINING", rv_mnstatus.iLifetimeRemaining);
+		request_reply->NewField( "STATUS_LAST_REGISTRATION_REPLY_CODE", rv_mnstatus.iReplyCode );
+		request_reply->NewField( "STATUS_SECONDS_SINCE_LAST_REPLY", rv_mnstatus.iSecondsSinceLastReply );
+		request_reply->NewField( "STATUS_SECONDS_SINCE_LAST_REQUEST", rv_mnstatus.iSecondsSinceLastRequest );
+		request_reply->NewField( "STATUS_INFO_TEXT", rv_mnstatus.iInfoText );
+		request_reply->NewField( "STATUS_LAST_ERROR_STRING", rv_mnstatus.iLastErrorString );
+		break;
+
+
+	// connect
+	case 12:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_tunnel_mode.iAgentID), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "TUNNELMODE", (int*)&(sarg_tunnel_mode.iTunnelMode), 2, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->connect( sarg_tunnel_mode, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+
+	// disconnect
+	case 13:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->disconnect( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+
+	// confirm
+	case 16:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->confirm( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+
+	// rescaninterfaces
+	case 17:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->rescaninterfaces( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+	
+	// setfapolicy
+	case 18:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_policy_request.iAgentID), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "POLICY", &(sarg_policy_request.iPolicy), 2, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->setfapolicy( sarg_policy_request, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+
+	// getfapolicy 
+	case 19:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->getfapolicy( sarg_integer, &rv_result ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_result.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_result.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_result.iData1 );
+		break;
+
+
+	// listforeignagents
+	case 20:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->listforeignagents( sarg_integer, &rv_foreign_agent_list ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "FOREIGNAGENTCOUNT", rv_foreign_agent_list.TForeignAgentList_len );
+		for( i = 0; i < (signed)(rv_foreign_agent_list.TForeignAgentList_len); i++ ) {
+			tmp_foreign_agent_info = &((rv_foreign_agent_list.TForeignAgentList_val)[i]);
+			AddIteratedStringFieldName(	"FOREIGN_AGENT_ADDRESS", i, IntToAddress(tmp_foreign_agent_info->iForeignAgentAddress), request_reply );
+			AddIteratedStringFieldName(	"INTERFACE_NAME", i, tmp_foreign_agent_info->iInterfaceName, request_reply );
+			AddIteratedIntegerFieldName( "PRIORITY", i, tmp_foreign_agent_info->iPriority, request_reply );
+			AddIteratedStringFieldName(	"NAI", i, tmp_foreign_agent_info->iNAI, request_reply );
+			AddIteratedIntegerFieldName( "INUSE", i, tmp_foreign_agent_info->iInUse, request_reply );
+			AddIteratedIntegerFieldName( "INTERFACE_INDEX", i, tmp_foreign_agent_info->iInterfaceIndex, request_reply );
+			AddIteratedIntegerFieldName( "LAST_ADVERTISEMENT", i, tmp_foreign_agent_info->iLastAdvertisement, request_reply );
+			AddIteratedIntegerFieldName( "ADVERTISEMENT_EXPIRY", i, tmp_foreign_agent_info->iAdvertisementExpiry, request_reply );
+		}
+
+		// free the memory (if any was allocated)
+		if( rv_foreign_agent_list.TForeignAgentList_len > 0 ) {
+			XdrFree( (char**)&(rv_foreign_agent_list.TForeignAgentList_val), (int*)&(rv_foreign_agent_list.TForeignAgentList_len) );
+		}
+		break;
+
+
+	// getforeignagentinfo
+	case 21:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_foreign_agent_info.iAgentID), 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "FOREIGN_AGENT_ADDRESS", &tmp_string, 2, 0, aRequest, request_reply );
+		sarg_foreign_agent_info.iForeignAgentID = AddressToInt( tmp_string );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->getforeignagentinfo( sarg_foreign_agent_info, &rv_foreign_agent_info ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return value
+		request_reply->NewField( "RESULT", rv_foreign_agent_info.iCallResult.iServiceResult );
+		request_reply->NewField( "RESULT_SUB_COMPONENT", rv_foreign_agent_info.iCallResult.iSubComponentResult );
+		request_reply->NewField( "RESULT_DATA0", rv_foreign_agent_info.iCallResult.iData0 );
+		request_reply->NewField( "RESULT_DATA1", rv_foreign_agent_info.iCallResult.iData1 );
+		request_reply->NewField( "FOREIGN_AGENT_ADDRESS", IntToAddress(rv_foreign_agent_info.iForeignAgentAddress) );
+		request_reply->NewField( "INTERFACE_NAME", rv_foreign_agent_info.iInterfaceName );
+		request_reply->NewField( "PRIORITY", rv_foreign_agent_info.iPriority );
+		request_reply->NewField( "NAI", rv_foreign_agent_info.iNAI );
+		request_reply->NewField( "INUSE", rv_foreign_agent_info.iInUse );
+		request_reply->NewField( "INTERFACE_INDEX",	rv_foreign_agent_info.iInterfaceIndex );
+		request_reply->NewField( "LAST_ADVERTISEMENT", rv_foreign_agent_info.iLastAdvertisement );
+		request_reply->NewField( "ADVERTISEMENT_EXPIRY", rv_foreign_agent_info.iAdvertisementExpiry );
+		break;
+
+
+	// settimeout
+	case 22:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "AGENTID", &(sarg_timeout.iAgentID), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "TIMEOUT", &(sarg_timeout.iTimeout), 2, 0, aRequest, request_reply );
+
+		//make the call and update the return value
+		client_stub_error = iClientMobileAgent->settimeout( sarg_timeout ); 
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+		break;
+
+	// any other method id will result in an RCC_INVALIDMETHODID result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CMobileAgentServiceStub::GetLastRPCError( int *aIntError )
+{
+	return iClientMobileAgent->GetLastRPCError( aIntError );
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CMobileAgentServiceStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CMobileAgentServiceStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CMobileAgentServiceStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CMOBILEAGENTSERVICESTUB_H__
+#define __CMOBILEAGENTSERVICESTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration. 
+ *
+ ******************************************************************************/
+class CCMncontroller;
+
+
+/*******************************************************************************
+ *
+ * CMobileAgentServiceStub
+ *
+ ******************************************************************************/
+class CMobileAgentServiceStub : public IService, public CServiceAgentBase
+{
+public:
+	CMobileAgentServiceStub();
+	~CMobileAgentServiceStub();
+
+	int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError );
+	int StopUccsService( int *aLocalerror, int *aRemoteError );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCMncontroller *iClientMobileAgent;
+	char* iHostName;
+};
+
+#endif //__CMOBILEAGENTSERVICESTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,472 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __MNCONTROLLER_H__
+#define __MNCONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TComponentList(...);
+}
+#else
+bool_t xdr_mncontroller_TComponentList();
+#endif
+
+#define X_MAXINTERFACENAMELEN 64
+#define X_MAXNAILEN 128
+#define X_MAXOPTIONTOKENSIZE 512
+#define X_MAXINFOLEN 128
+#define X_MAXERRORSTRING 256
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_DYNAMICS_CALL_FAILED -107
+#define ERR_CONFIG_FILE_ERROR -108
+#define ERR_POLICY_OUTPUT_PARSING_FAILED -110
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_SET_INTERFACE_ADDRESS_ERROR -112
+#define FP_EARLY_EXPIRE 1
+#define FP_NEWEST_FA 2
+#define FP_EAGER 4
+#define FP_NEWEST_ADV 8
+
+enum TMnTunnelingMode {
+	TM_NO_TUNNEL = 0,
+	TM_FULL_TUNNEL = 1,
+	TM_TRIANGLE_TUNNEL = 2,
+};
+typedef enum TMnTunnelingMode TMnTunnelingMode;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TMnTunnelingMode(...);
+}
+#else
+bool_t xdr_mncontroller_TMnTunnelingMode();
+#endif
+
+
+enum TSetInterfaceErrors {
+	SIE_SOCKET_FAILED = 0,
+	SIE_IOCTL_GET_DESTINATION_ADDRESS_FAILED = 1,
+	SIE_IOCTL_SET_ADDRESS_FAILED = 2,
+	SIE_IOCTL_SET_DESTINATION_ADDRESS_FAILED = 3,
+};
+typedef enum TSetInterfaceErrors TSetInterfaceErrors;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TSetInterfaceErrors(...);
+}
+#else
+bool_t xdr_mncontroller_TSetInterfaceErrors();
+#endif
+
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TResult(...);
+}
+#else
+bool_t xdr_mncontroller_TResult();
+#endif
+
+
+struct THomeAddressDesc {
+	int iAgentID;
+	int iHomeAddressPrefix;
+	int iHomeAddress;
+	int iHomeAgentAddress;
+	char iInterfaceName[X_MAXINTERFACENAMELEN];
+};
+typedef struct THomeAddressDesc THomeAddressDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_THomeAddressDesc(...);
+}
+#else
+bool_t xdr_mncontroller_THomeAddressDesc();
+#endif
+
+
+struct TOptionDesc {
+	int iAgentID;
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+typedef struct TOptionDesc TOptionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TOptionDesc(...);
+}
+#else
+bool_t xdr_mncontroller_TOptionDesc();
+#endif
+
+
+struct TTunnelingModeDesc {
+	int iAgentID;
+	TMnTunnelingMode iTunnelMode;
+};
+typedef struct TTunnelingModeDesc TTunnelingModeDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TTunnelingModeDesc(...);
+}
+#else
+bool_t xdr_mncontroller_TTunnelingModeDesc();
+#endif
+
+
+struct TPolicyRequest {
+	int iAgentID;
+	int iPolicy;
+};
+typedef struct TPolicyRequest TPolicyRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TPolicyRequest(...);
+}
+#else
+bool_t xdr_mncontroller_TPolicyRequest();
+#endif
+
+
+struct TForeignAgentInfoRequest {
+	int iAgentID;
+	int iForeignAgentID;
+};
+typedef struct TForeignAgentInfoRequest TForeignAgentInfoRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TForeignAgentInfoRequest(...);
+}
+#else
+bool_t xdr_mncontroller_TForeignAgentInfoRequest();
+#endif
+
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+typedef struct TTimeoutRequest TTimeoutRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TTimeoutRequest(...);
+}
+#else
+bool_t xdr_mncontroller_TTimeoutRequest();
+#endif
+
+
+struct TMobileNodeStatus {
+	TResult iCallResult;
+	int iConnected;
+	int iTunnelUp;
+	u_int iLocalAddress;
+	u_int iColocatedAddress;
+	u_int iForeignAgentAddress;
+	u_int iHomeAgentAddress;
+	u_int iHomeAddress;
+	int iLifetimeRemaining;
+	int iTunnelMode;
+	int iSecondsSinceLastRequest;
+	int iSecondsSinceLastReply;
+	int iReplyCode;
+	char iInfoText[X_MAXINFOLEN];
+	char iLastErrorString[X_MAXERRORSTRING];
+};
+typedef struct TMobileNodeStatus TMobileNodeStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TMobileNodeStatus(...);
+}
+#else
+bool_t xdr_mncontroller_TMobileNodeStatus();
+#endif
+
+
+struct TForeignAgentInfo {
+	TResult iCallResult;
+	u_int iForeignAgentAddress;
+	char iInterfaceName[X_MAXINTERFACENAMELEN];
+	int iPriority;
+	int iInUse;
+	int iInterfaceIndex;
+	int iLastAdvertisement;
+	char iNAI[X_MAXNAILEN];
+	int iAdvertisementExpiry;
+};
+typedef struct TForeignAgentInfo TForeignAgentInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TForeignAgentInfo(...);
+}
+#else
+bool_t xdr_mncontroller_TForeignAgentInfo();
+#endif
+
+
+typedef struct {
+	u_int TForeignAgentList_len;
+	TForeignAgentInfo *TForeignAgentList_val;
+} TForeignAgentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TForeignAgentList(...);
+}
+#else
+bool_t xdr_mncontroller_TForeignAgentList();
+#endif
+
+
+#define MNCONTROLLER ((u_long)0x34630205)
+#define MNCONTROLLER_VERSION ((u_long)5)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_5( void * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_5();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_5( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_5();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_5( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_5();
+#endif /* __cplusplus */
+#define CSTR_CREATEAGENT ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_createagent_5( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_createagent_5();
+#endif /* __cplusplus */
+#define DSTR_REMOVEAGENT ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removeagent_5( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removeagent_5();
+#endif /* __cplusplus */
+#define STARTMOBILEAGENT ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *startmobileagent_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *startmobileagent_5();
+#endif /* __cplusplus */
+#define STOPMOBILEAGENT ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopmobileagent_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopmobileagent_5();
+#endif /* __cplusplus */
+#define GETMOBILEAGENTSTATUS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getmobileagentstatus_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getmobileagentstatus_5();
+#endif /* __cplusplus */
+#define SETSINGLEOPTION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setsingleoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *setsingleoption_5();
+#endif /* __cplusplus */
+#define REMOVESINGLEOPTION ((u_long)33)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removesingleoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removesingleoption_5();
+#endif /* __cplusplus */
+#define ADDLISTOPTION ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *addlistoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *addlistoption_5();
+#endif /* __cplusplus */
+#define REMOVELISTOPTION ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removelistoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removelistoption_5();
+#endif /* __cplusplus */
+#define SETHOMEADDRESS ((u_long)23)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *sethomeaddress_5( THomeAddressDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *sethomeaddress_5();
+#endif /* __cplusplus */
+#define GETCAREOFADDRESS ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getcareofaddress_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getcareofaddress_5();
+#endif /* __cplusplus */
+#define CONNECT ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *connect_5( TTunnelingModeDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *connect_5();
+#endif /* __cplusplus */
+#define DISCONNECT ((u_long)13)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *disconnect_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *disconnect_5();
+#endif /* __cplusplus */
+#define CONFIRM ((u_long)16)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *confirm_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *confirm_5();
+#endif /* __cplusplus */
+#define RESCANINTERFACES ((u_long)17)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *rescaninterfaces_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *rescaninterfaces_5();
+#endif /* __cplusplus */
+#define SETFAPOLICY ((u_long)18)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setfapolicy_5( TPolicyRequest * arg, CLIENT *cl );
+}
+#else
+extern TResult *setfapolicy_5();
+#endif /* __cplusplus */
+#define GETFAPOLICY ((u_long)19)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getfapolicy_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getfapolicy_5();
+#endif /* __cplusplus */
+#define GETSTATUS ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern TMobileNodeStatus *getstatus_5( int * arg, CLIENT *cl );
+}
+#else
+extern TMobileNodeStatus *getstatus_5();
+#endif /* __cplusplus */
+#define LISTFOREIGNAGENTS ((u_long)20)
+#ifdef __cplusplus
+extern "C" {
+extern TForeignAgentList *listforeignagents_5( int * arg, CLIENT *cl );
+}
+#else
+extern TForeignAgentList *listforeignagents_5();
+#endif /* __cplusplus */
+#define GETFOREIGNAGENTINFO ((u_long)21)
+#ifdef __cplusplus
+extern "C" {
+extern TForeignAgentInfo *getforeignagentinfo_5( TForeignAgentInfoRequest * arg, CLIENT *cl );
+}
+#else
+extern TForeignAgentInfo *getforeignagentinfo_5();
+#endif /* __cplusplus */
+#define SETTIMEOUT ((u_long)22)
+#ifdef __cplusplus
+extern "C" {
+extern void *settimeout_5( TTimeoutRequest * arg, CLIENT *cl );
+}
+#else
+extern void *settimeout_5();
+#endif /* __cplusplus */
+
+#endif /* __MNCONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../mncontroller/mncontroller.x"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,337 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "mncontroller.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_5(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_void, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_5(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_mncontroller_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+cstr_createagent_5(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_CREATEAGENT, xdr_void, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+dstr_removeagent_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEAGENT, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+startmobileagent_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STARTMOBILEAGENT, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+stopmobileagent_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPMOBILEAGENT, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+getmobileagentstatus_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETMOBILEAGENTSTATUS, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+setsingleoption_5(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETSINGLEOPTION, xdr_mncontroller_TOptionDesc, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+removesingleoption_5(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, REMOVESINGLEOPTION, xdr_mncontroller_TOptionDesc, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+addlistoption_5(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ADDLISTOPTION, xdr_mncontroller_TOptionDesc, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+removelistoption_5(argp, clnt)
+	TOptionDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, REMOVELISTOPTION, xdr_mncontroller_TOptionDesc, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+sethomeaddress_5(argp, clnt)
+	THomeAddressDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETHOMEADDRESS, xdr_mncontroller_THomeAddressDesc, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+getcareofaddress_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETCAREOFADDRESS, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+connect_5(argp, clnt)
+	TTunnelingModeDesc *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CONNECT, xdr_mncontroller_TTunnelingModeDesc, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+disconnect_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DISCONNECT, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+confirm_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CONFIRM, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+rescaninterfaces_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, RESCANINTERFACES, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+setfapolicy_5(argp, clnt)
+	TPolicyRequest *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETFAPOLICY, xdr_mncontroller_TPolicyRequest, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+getfapolicy_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETFAPOLICY, xdr_int, argp, xdr_mncontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TMobileNodeStatus *
+getstatus_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TMobileNodeStatus res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETSTATUS, xdr_int, argp, xdr_mncontroller_TMobileNodeStatus, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TForeignAgentList *
+listforeignagents_5(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TForeignAgentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LISTFOREIGNAGENTS, xdr_int, argp, xdr_mncontroller_TForeignAgentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TForeignAgentInfo *
+getforeignagentinfo_5(argp, clnt)
+	TForeignAgentInfoRequest *argp;
+	CLIENT *clnt;
+{
+	static TForeignAgentInfo res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETFOREIGNAGENTINFO, xdr_mncontroller_TForeignAgentInfoRequest, argp, xdr_mncontroller_TForeignAgentInfo, &res, TIMEOUT);
+	return (&res);
+}
+
+
+void *
+settimeout_5(argp, clnt)
+	TTimeoutRequest *argp;
+	CLIENT *clnt;
+{
+	static char res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETTIMEOUT, xdr_mncontroller_TTimeoutRequest, argp, xdr_void, &res, TIMEOUT);
+	return ((void *)&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "mncontroller.h"
+
+
+bool_t
+xdr_mncontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TMnTunnelingMode(xdrs, objp)
+	XDR *xdrs;
+	TMnTunnelingMode *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TSetInterfaceErrors(xdrs, objp)
+	XDR *xdrs;
+	TSetInterfaceErrors *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iServiceResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSubComponentResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData0)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData1)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_THomeAddressDesc(xdrs, objp)
+	XDR *xdrs;
+	THomeAddressDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAddressPrefix)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInterfaceName, X_MAXINTERFACENAMELEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TOptionDesc(xdrs, objp)
+	XDR *xdrs;
+	TOptionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionToken, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionValue, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockStart, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockEnd, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TTunnelingModeDesc(xdrs, objp)
+	XDR *xdrs;
+	TTunnelingModeDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_mncontroller_TMnTunnelingMode(xdrs, &objp->iTunnelMode)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TPolicyRequest(xdrs, objp)
+	XDR *xdrs;
+	TPolicyRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPolicy)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TForeignAgentInfoRequest(xdrs, objp)
+	XDR *xdrs;
+	TForeignAgentInfoRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iForeignAgentID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TTimeoutRequest(xdrs, objp)
+	XDR *xdrs;
+	TTimeoutRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TMobileNodeStatus(xdrs, objp)
+	XDR *xdrs;
+	TMobileNodeStatus *objp;
+{
+	if (!xdr_mncontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iConnected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelUp)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iLocalAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iColocatedAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iForeignAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLifetimeRemaining)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelMode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSecondsSinceLastRequest)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSecondsSinceLastReply)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iReplyCode)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInfoText, X_MAXINFOLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iLastErrorString, X_MAXERRORSTRING, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TForeignAgentInfo(xdrs, objp)
+	XDR *xdrs;
+	TForeignAgentInfo *objp;
+{
+	if (!xdr_mncontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iForeignAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInterfaceName, X_MAXINTERFACENAMELEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPriority)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iInUse)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iInterfaceIndex)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLastAdvertisement)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iNAI, X_MAXNAILEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iAdvertisementExpiry)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TForeignAgentList(xdrs, objp)
+	XDR *xdrs;
+	TForeignAgentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TForeignAgentList_val, (u_int *)&objp->TForeignAgentList_len, ~0, sizeof(TForeignAgentInfo), (void*)xdr_mncontroller_TForeignAgentInfo)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CCMobster.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,394 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCMobster.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCMobster::CCMobster()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCMobster::~CCMobster()
+{
+	assert( cl == NULL );
+}
+
+char *CCMobster::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCMobster::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), MOBSTER, MOBSTER_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCMobster::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCMobster::ss_startuprpcservice( struct TChannelAddress aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCMobster::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCMobster::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startdevice
+ * 
+ ***************************************************************************************/
+int CCMobster::cstr_startdevice( TDeviceDesc aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_startdevice_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removedevice
+ * 
+ ***************************************************************************************/
+int CCMobster::dstr_removedevice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removedevice_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getdeviceinfo
+ * 
+ ***************************************************************************************/
+int CCMobster::getdeviceinfo( int aArgs, TDeviceDesc *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getdeviceinfo_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getdevicelog
+ * 
+ ***************************************************************************************/
+int CCMobster::getdevicelog( int aArgs, TVarData *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getdevicelog_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopdevice
+ * 
+ ***************************************************************************************/
+int CCMobster::stopdevice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopdevice_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setremoteuuaddress
+ * 
+ ***************************************************************************************/
+int CCMobster::setremoteuuaddress( struct TUUAddress aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *setremoteuuaddress_1( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CCMobster.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCMOBSTER_H__
+#define __CCMOBSTER_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "mobster.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCMobster
+ * 
+ ***************************************************************************************/
+class CCMobster
+{
+public:
+	// standard methods
+	CCMobster();
+	~CCMobster();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( struct TChannelAddress aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int cstr_startdevice( TDeviceDesc aArgs, int *rv );
+	int dstr_removedevice( int aArgs, int *rv );
+	int getdeviceinfo( int aArgs, TDeviceDesc *rv );
+	int getdevicelog( int aArgs, TVarData *rv );
+	int stopdevice( int aArgs, int *rv );
+	int setremoteuuaddress( struct TUUAddress aArgs, int *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CMobsterStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,343 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+#include "CMobsterStub.h"
+#include "CCMobster.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CMobsterServiceStub::CMobsterServiceStub() 
+{
+	iClientMobster = new CCMobster();
+	assert( iClientMobster != NULL );
+}
+
+
+CMobsterServiceStub::~CMobsterServiceStub()
+{
+	delete iClientMobster;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CMobsterServiceStub::StartUccsService( char *aHostName, int *aErrorInfo, int *aUnused )
+{
+	int client_stub_error;
+	*aErrorInfo = *aUnused = 0;
+
+	// connect the stub to the remote service
+	client_stub_error = iClientMobster->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CMobsterServiceStub::StopUccsService( int *aErrorInfo, int *aUnused )
+{
+	int client_stub_error;
+	*aErrorInfo = *aUnused = 0;
+
+	// disconnect the stub from the remote service
+	client_stub_error = iClientMobster->Disconnect();
+
+	// return the result
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CMobsterServiceStub::IssueCommand( CDataRecord* aRequest )
+{
+	int i, client_result, method_id = -1;
+	CDataRecord *request_reply;
+	
+	char *sarg_string;
+	int sarg_integer, rv_integer;
+	TDeviceDesc sarg_devicedesc, rv_devicedesc;
+	TChannelAddress sarg_channel_address;
+	TUUAddress sarg_uu_address;
+	TComponentList rv_component_list;
+	TVarData rv_vardata;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "PORT", &(sarg_channel_address.iPort), 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientMobster->ss_startuprpcservice( sarg_channel_address, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2:
+		
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientMobster->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// list_devices
+	case 9:
+
+		// make the call and update the return value
+		client_result = iClientMobster->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "DEVICECOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "DEVICEID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;
+
+
+	// cstr_startdevice
+	case 3:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "DATALINKCONFIG",	(int*)&(sarg_devicedesc.iDatalinkConfig), 1, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "FILTERCONFIG",		&(sarg_devicedesc.iFilterConfig),	2, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientMobster->cstr_startdevice( sarg_devicedesc, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+
+	// dstr_removedevice
+	case 7:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "DEVICEID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientMobster->dstr_removedevice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+
+	// GetDeviceInfo
+	case 4:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "DEVICEID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientMobster->getdeviceinfo( sarg_integer, &rv_devicedesc );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "DATALINKCONFIG",	rv_devicedesc.iDatalinkConfig );
+		request_reply->NewField( "FILTERCONFIG",	rv_devicedesc.iFilterConfig );
+		request_reply->NewField( "MTID",			rv_devicedesc.iMTID );
+		request_reply->NewField( "TEID",			rv_devicedesc.iTEID );
+		request_reply->NewField( "AIR_INPORT",		rv_devicedesc.iLocalAirInterfacePort );
+		request_reply->NewField( "AIR_OUTADDR",		rv_devicedesc.iRemoteAirInterfaceAddress );
+		request_reply->NewField( "AIR_OUTPORT",		rv_devicedesc.iRemoteAirInterfacePort );
+		request_reply->NewField( "DEVICESTATUS",	rv_devicedesc.iDeviceStatus );
+		request_reply->NewField( "DEVICEEXITREASON",	rv_devicedesc.iDeviceExitReason );
+		request_reply->NewField( "DEVICEEXITSUBREASON",	rv_devicedesc.iDeviceExitSubReason );
+		request_reply->NewField( "DEVICEEXITCODE",		rv_devicedesc.iDeviceExitDetail );
+		break;
+
+
+	// getdevicelog
+	case 5:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "DEVICEID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientMobster->getdevicelog( sarg_integer, &rv_vardata );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the result (this copies)
+ 		request_reply->NewField( "DEVICELOG",			rv_vardata.TVarData_val );
+		request_reply->NewField( "DEVICELOGLENGTH",		rv_vardata.TVarData_len );
+
+		// free the memory (if any was allocated)
+		if( rv_vardata.TVarData_len > 0 ) {
+			XdrFree( &(rv_vardata.TVarData_val), (int*)&(rv_vardata.TVarData_len) );
+		}
+		break;
+
+
+	// stopdevice
+	case 6:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "DEVICEID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientMobster->stopdevice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the result
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+
+	// setremoteuuaddress
+	case 10:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "DEVICEID",			&(sarg_uu_address.iDeviceID),		1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT(	"REMOTE_ADDRESS",	&(sarg_string),						2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "REMOTE_PORT",		&(sarg_integer),					3, 0, aRequest, request_reply );
+		sarg_uu_address.iRemoteAddress = AddressToInt(sarg_string);
+		sarg_uu_address.iRemotePort = htons(sarg_integer);
+
+		// make the call and update the return value
+		client_result = iClientMobster->setremoteuuaddress( sarg_uu_address, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the result
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CMobsterServiceStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CMobsterServiceStub::GetLastRPCError( int *aIntError )
+{
+	return iClientMobster->GetLastRPCError( aIntError );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CMobsterStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CMobsterClientServiceStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CMOBSTERCLIENTSERVICESTUB_H__
+#define __CMOBSTERCLIENTSERVICESTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration
+ *
+ ******************************************************************************/
+class CCMobster;
+
+
+/*******************************************************************************
+ *
+ * CMobsterServiceStub
+ *
+ ******************************************************************************/
+class CMobsterServiceStub : public IService, public CServiceAgentBase
+{
+public:
+	CMobsterServiceStub();
+	~CMobsterServiceStub();
+
+	int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError );
+	int StopUccsService( int *aLocalerror, int *aRemoteError );
+	CDataRecord* IssueCommand( CDataRecord* aCommand );
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCMobster *iClientMobster;
+};
+
+#endif //__CMOBSTERCLIENTSERVICESTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __MOBSTER_H__
+#define __MOBSTER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TComponentList(...);
+}
+#else
+bool_t xdr_mobster_TComponentList();
+#endif
+
+#define MAXADDRLEN 64
+#define MAXPORTLEN 16
+#define INVALID_DEVICE_ID 0xFFFFFFFF
+#define ERR_DEVICETHREADCREATIONFAILED -100
+#define ERR_DEVICENOTRUNNING -101
+#define ERR_STOPFAILED -102
+#define ERR_STARTUPFAILED -103
+#define ERR_CREATE_SOCKET_FAILED -104
+#define ERR_BIND_FAILED -105
+#define ERR_LISTEN_FAILED -106
+#define ERR_CREATE_SERVER_THREAD_FAILED -117
+#define ERR_ACCEPT_FAILED -107
+#define ERR_CSPROTOCOLFAILED -108
+#define ERR_CREATELOGFAILED -109
+#define ERR_STARTPHONEFAILED -110
+#define ERR_CONNECTSOCKETFAILED -111
+#define ERR_OPENSERIALPORTFAILED -112
+#define ERR_DEVICEINITIALISING -113
+#define ERR_STOPREQUESTED -114
+#define ERR_FAILEDTORESOLVEOUTGOINGAIRADDRESS -115
+#define ERR_FAILEDTORESETSTATE -116
+#define ERR_CHANNEL_SOCKET_ALREADY_SET -118
+#define FILTER_NONE 0
+#define FILTER_PPP 1
+
+enum TDatalinkLayer {
+	DL_INVALID = 0,
+	DL_NULL = 1,
+	DL_PACKETISE = 2,
+};
+typedef enum TDatalinkLayer TDatalinkLayer;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TDatalinkLayer(...);
+}
+#else
+bool_t xdr_mobster_TDatalinkLayer();
+#endif
+
+
+enum TChannelStatus {
+	CS_INACTIVE = 0,
+	CS_ACTIVE = 1,
+	CS_CLOSED = 2,
+};
+typedef enum TChannelStatus TChannelStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TChannelStatus(...);
+}
+#else
+bool_t xdr_mobster_TChannelStatus();
+#endif
+
+
+enum TDeviceExitReason {
+	DER_INVALID = 0,
+	DER_USER_REQUEST = 1,
+	DER_START_PHONE_FAILED = 2,
+	DER_UNKNOWN = 3,
+};
+typedef enum TDeviceExitReason TDeviceExitReason;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TDeviceExitReason(...);
+}
+#else
+bool_t xdr_mobster_TDeviceExitReason();
+#endif
+
+
+struct TChannelAddress {
+	int iPort;
+};
+typedef struct TChannelAddress TChannelAddress;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TChannelAddress(...);
+}
+#else
+bool_t xdr_mobster_TChannelAddress();
+#endif
+
+
+struct TUUAddress {
+	int iDeviceID;
+	int iRemoteAddress;
+	int iRemotePort;
+};
+typedef struct TUUAddress TUUAddress;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TUUAddress(...);
+}
+#else
+bool_t xdr_mobster_TUUAddress();
+#endif
+
+
+struct TDeviceDesc {
+	TDatalinkLayer iDatalinkConfig;
+	int iFilterConfig;
+	int iMTID;
+	int iTEID;
+	char iLocalAirInterfacePort[MAXPORTLEN];
+	char iRemoteAirInterfaceAddress[MAXADDRLEN];
+	char iRemoteAirInterfacePort[MAXPORTLEN];
+	TChannelStatus iDeviceStatus;
+	TDeviceExitReason iDeviceExitReason;
+	int iDeviceExitSubReason;
+	int iDeviceExitDetail;
+};
+typedef struct TDeviceDesc TDeviceDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TDeviceDesc(...);
+}
+#else
+bool_t xdr_mobster_TDeviceDesc();
+#endif
+
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mobster_TVarData(...);
+}
+#else
+bool_t xdr_mobster_TVarData();
+#endif
+
+
+#define MOBSTER ((u_long)0x34630201)
+#define MOBSTER_VERSION ((u_long)1)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_1( TChannelAddress * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_1();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_1();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_1( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_1();
+#endif /* __cplusplus */
+#define CSTR_STARTDEVICE ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern int *cstr_startdevice_1( TDeviceDesc * arg, CLIENT *cl );
+}
+#else
+extern int *cstr_startdevice_1();
+#endif /* __cplusplus */
+#define DSTR_REMOVEDEVICE ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removedevice_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removedevice_1();
+#endif /* __cplusplus */
+#define GETDEVICEINFO ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TDeviceDesc *getdeviceinfo_1( int * arg, CLIENT *cl );
+}
+#else
+extern TDeviceDesc *getdeviceinfo_1();
+#endif /* __cplusplus */
+#define GETDEVICELOG ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getdevicelog_1( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getdevicelog_1();
+#endif /* __cplusplus */
+#define STOPDEVICE ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern int *stopdevice_1( int * arg, CLIENT *cl );
+}
+#else
+extern int *stopdevice_1();
+#endif /* __cplusplus */
+#define SETREMOTEUUADDRESS ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern int *setremoteuuaddress_1( TUUAddress * arg, CLIENT *cl );
+}
+#else
+extern int *setremoteuuaddress_1();
+#endif /* __cplusplus */
+
+#endif /* __MOBSTER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../MobsterRPCService/mobster.x"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "mobster.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_1(argp, clnt)
+	struct TChannelAddress *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_mobster_TChannelAddress, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_1(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_mobster_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+cstr_startdevice_1(argp, clnt)
+	TDeviceDesc *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_STARTDEVICE, xdr_mobster_TDeviceDesc, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+dstr_removedevice_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEDEVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TDeviceDesc *
+getdeviceinfo_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TDeviceDesc res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETDEVICEINFO, xdr_int, argp, xdr_mobster_TDeviceDesc, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TVarData *
+getdevicelog_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TVarData res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETDEVICELOG, xdr_int, argp, xdr_mobster_TVarData, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+stopdevice_1(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPDEVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+setremoteuuaddress_1(argp, clnt)
+	struct TUUAddress *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SETREMOTEUUADDRESS, xdr_mobster_TUUAddress, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "mobster.h"
+
+
+bool_t
+xdr_mobster_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TDatalinkLayer(xdrs, objp)
+	XDR *xdrs;
+	TDatalinkLayer *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TChannelStatus(xdrs, objp)
+	XDR *xdrs;
+	TChannelStatus *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TDeviceExitReason(xdrs, objp)
+	XDR *xdrs;
+	TDeviceExitReason *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TChannelAddress(xdrs, objp)
+	XDR *xdrs;
+	TChannelAddress *objp;
+{
+	if (!xdr_int(xdrs, &objp->iPort)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TUUAddress(xdrs, objp)
+	XDR *xdrs;
+	TUUAddress *objp;
+{
+	if (!xdr_int(xdrs, &objp->iDeviceID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRemoteAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRemotePort)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TDeviceDesc(xdrs, objp)
+	XDR *xdrs;
+	TDeviceDesc *objp;
+{
+	if (!xdr_mobster_TDatalinkLayer(xdrs, &objp->iDatalinkConfig)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iFilterConfig)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMTID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTEID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iLocalAirInterfacePort, MAXPORTLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iRemoteAirInterfaceAddress, MAXADDRLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iRemoteAirInterfacePort, MAXPORTLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_mobster_TChannelStatus(xdrs, &objp->iDeviceStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_mobster_TDeviceExitReason(xdrs, &objp->iDeviceExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDeviceExitSubReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDeviceExitDetail)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mobster_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CCPppcontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,394 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCPppcontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCPppcontroller::CCPppcontroller()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCPppcontroller::~CCPppcontroller()
+{
+	assert( cl == NULL );
+}
+
+char *CCPppcontroller::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCPppcontroller::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), PPPCONTROLLER, PPPCONTROLLER_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCPppcontroller::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startpppsession
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::cstr_startpppsession( TPppSessionConfig aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *cstr_startpppsession_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removepppsession
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::dstr_removepppsession( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *dstr_removepppsession_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: killsession
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::killsession( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *killsession_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopsession
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::stopsession( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *stopsession_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getsessioninfo
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::getsessioninfo( int aArgs, TPppSessionDesc *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getsessioninfo_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getppplog
+ * 
+ ***************************************************************************************/
+int CCPppcontroller::getppplog( int aArgs, TVarData *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *getppplog_4( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CCPppcontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCPPPCONTROLLER_H__
+#define __CCPPPCONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "pppcontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCPppcontroller
+ * 
+ ***************************************************************************************/
+class CCPppcontroller
+{
+public:
+	// standard methods
+	CCPppcontroller();
+	~CCPppcontroller();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int cstr_startpppsession( TPppSessionConfig aArgs, TResult *rv );
+	int dstr_removepppsession( int aArgs, TResult *rv );
+	int killsession( int aArgs, TResult *rv );
+	int stopsession( int aArgs, TResult *rv );
+	int getsessioninfo( int aArgs, TPppSessionDesc *rv );
+	int getppplog( int aArgs, TVarData *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CPppControllerStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,364 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "strncpynt.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+#include "CPppControllerStub.h"
+#include "CCPppcontroller.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CPppControllerServiceStub::CPppControllerServiceStub()
+{
+	iClientPppController = new CCPppcontroller();
+	assert( iClientPppController != NULL );
+}
+
+
+CPppControllerServiceStub::~CPppControllerServiceStub()
+{
+	delete iClientPppController;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CPppControllerServiceStub::StartUccsService( char *aHostName, int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	// check params
+	assert( aHostName != NULL );
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+	
+	// connect to the remote service
+	client_stub_error = iClientPppController->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+
+}
+
+
+int CPppControllerServiceStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+
+	// check params
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iClientPppController->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CPppControllerServiceStub::IssueCommand( CDataRecord* aRequest )
+{
+	int i, err, client_stub_error, method_id = -1;
+	char *tmp_string;
+	CDataRecord *request_reply;
+
+	int rv_integer, sarg_integer;
+	TComponentList rv_component_list;
+	TResult rv_result;
+	TVarData rv_var_data;
+	TPppSessionDesc rv_session_desc;
+	TPppSessionConfig sarg_session_config;
+	TStartupInfo sarg_startup_info;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// setup the args
+		sarg_startup_info.iEmpty = 0;
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->ss_startuprpcservice( sarg_startup_info, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );		
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set any return information
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2:
+			
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+		
+		// make the call and update the return value
+		client_stub_error = iClientPppController->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// list_devices
+	case 30:
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "DEVICECOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "DEVICEID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;		
+
+	// cstr_startpppsession
+	case 31:
+
+		// extract the parameters
+		GETSTRINGARGUMENT( "MADDR", &tmp_string, 1, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_session_config.iMobsterAddress, tmp_string, MAXADDRLEN );
+		GETSTRINGARGUMENT( "MPORT", &tmp_string, 2, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_session_config.iMobsterPort, tmp_string, MAXPORTLEN );
+		GETINTEGERARGUMENT( "MTID", &(sarg_session_config.iMTID), 3, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "CONFIG", &tmp_string, 4, 0, aRequest, request_reply );
+		STRNCPY_NULL_TERMINATE( sarg_session_config.iSessionConfiguration, tmp_string, MAXCONFIGURATIONLENGTH );
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->cstr_startpppsession( sarg_session_config, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the result values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );		
+		break;
+		
+
+	// dstr_removepppsession
+	case 32:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "SID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->dstr_removepppsession( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the result values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );		
+		break;
+
+
+	// killsession
+	case 5:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "SID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->killsession( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the result values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );		
+		break;
+
+
+	// stopsession
+	case 6:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "SID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->stopsession( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the result values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );		
+		break;
+
+
+	// getsessioninfo
+	case 7:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "SID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->getsessioninfo( sarg_integer, &rv_session_desc );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the result values
+		request_reply->NewField( "RESULT", rv_session_desc.iErrorCode );
+		request_reply->NewField( "RESULT_DETAIL", rv_session_desc.iErrorDetail );
+		request_reply->NewField( "SESSION_MADDR", rv_session_desc.iConfig.iMobsterAddress );
+		request_reply->NewField( "SESSION_MPORT", rv_session_desc.iConfig.iMobsterPort );
+		request_reply->NewField( "SESSION_MTID",	rv_session_desc.iConfig.iMTID );
+		request_reply->NewField( "SESSION_CONFIG",	rv_session_desc.iConfig.iSessionConfiguration );
+		request_reply->NewField( "SESSION_STATUS",	rv_session_desc.iSessionStatus );
+		request_reply->NewField( "SESSION_INTERFACE_NAME",	rv_session_desc.iInterfaceName );
+		request_reply->NewField( "SESSION_LOCAL_IP_ADDRESS",	IntToAddress(rv_session_desc.iLocalIPAddress) );
+		request_reply->NewField( "SESSION_REMOTE_IP_ADDRESS",	IntToAddress(rv_session_desc.iRemoteIPAddress) );
+		request_reply->NewField( "SESSION_PROCESS_STATUS",	rv_session_desc.iProcessStatus );
+		request_reply->NewField( "SESSION_PROCESS_EXIT_REASON",	rv_session_desc.iProcessExitReason );
+		request_reply->NewField( "SESSION_PROCESS_EXIT_CODE",	rv_session_desc.iProcessExitCode );
+		break;
+
+
+	// getppplog
+	case 8:
+
+		// extract the parameters
+		GETINTEGERARGUMENT( "SID", &sarg_integer, 1, 0, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_stub_error = iClientPppController->getppplog( sarg_integer, &rv_var_data );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the result values
+		request_reply->NewField( "LOG",	rv_var_data.TVarData_val );
+		request_reply->NewField( "LOG_LENGTH", (rv_var_data.TVarData_len - 1));
+
+		// free the memory (if any was allocated)
+		if( rv_var_data.TVarData_len > 0 ) {
+			XdrFree( &(rv_var_data.TVarData_val), (int*)&(rv_var_data.TVarData_len) );
+		}
+		break;
+
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CPppControllerServiceStub::GetLastRPCError( int *aIntError )
+{
+	return iClientPppController->GetLastRPCError( aIntError );
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CPppControllerServiceStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CPppControllerStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CPdsnClientServiceStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CPPPCONTROLLERSTUB_H__
+#define __CPPPCONTROLLERSTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration. 
+ *
+ ******************************************************************************/
+class CCPppcontroller;
+
+
+/*******************************************************************************
+ *
+ * CPppControllerServiceStub
+ *
+ ******************************************************************************/
+class CPppControllerServiceStub : public IService, public CServiceAgentBase
+{
+public:
+	CPppControllerServiceStub();
+	~CPppControllerServiceStub();
+
+	int StartUccsService( char *aHostName, int *aErrorCode, int *aUnused );
+	int StopUccsService( int *aErrorCode, int *aUnused );
+	CDataRecord* IssueCommand( CDataRecord* aCommand );
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCPppcontroller *iClientPppController;
+};
+
+#endif //__CPPPCONTROLLERSTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __PPPCONTROLLER_H__
+#define __PPPCONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TComponentList(...);
+}
+#else
+bool_t xdr_pppcontroller_TComponentList();
+#endif
+
+#define MAXADDRLEN 64
+#define MAXPORTLEN 16
+#define MAXCONFIGURATIONLENGTH 1024
+#define MAXSESSIONNAMELEN 16
+#define INVALID_SESSION_ID 0xFFFFFFFF
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_SET_SIGNAL_ERROR -120
+#define ERR_LOG_FILE_ERROR -121
+#define ERR_MULTIPLE_MATCHES_IN_LOG_FILE -122
+
+enum TPppSessionStatus {
+	SS_NOT_STARTED = 0,
+	SS_CONNECTING = 1,
+	SS_CONNECTED = 2,
+	SS_DISCONNECTING = 3,
+	SS_DISCONNECTED = 4,
+};
+typedef enum TPppSessionStatus TPppSessionStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TPppSessionStatus(...);
+}
+#else
+bool_t xdr_pppcontroller_TPppSessionStatus();
+#endif
+
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TStartupInfo(...);
+}
+#else
+bool_t xdr_pppcontroller_TStartupInfo();
+#endif
+
+
+struct TPppSessionConfig {
+	char iMobsterAddress[MAXADDRLEN];
+	char iMobsterPort[MAXPORTLEN];
+	char iSessionConfiguration[MAXCONFIGURATIONLENGTH];
+	int iMTID;
+};
+typedef struct TPppSessionConfig TPppSessionConfig;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TPppSessionConfig(...);
+}
+#else
+bool_t xdr_pppcontroller_TPppSessionConfig();
+#endif
+
+
+struct TPppSessionDesc {
+	int iErrorCode;
+	int iErrorDetail;
+	TPppSessionConfig iConfig;
+	TPppSessionStatus iSessionStatus;
+	char iInterfaceName[MAXSESSIONNAMELEN];
+	int iLocalIPAddress;
+	int iRemoteIPAddress;
+	int iProcessStatus;
+	int iProcessExitReason;
+	int iProcessExitCode;
+};
+typedef struct TPppSessionDesc TPppSessionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TPppSessionDesc(...);
+}
+#else
+bool_t xdr_pppcontroller_TPppSessionDesc();
+#endif
+
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TResult(...);
+}
+#else
+bool_t xdr_pppcontroller_TResult();
+#endif
+
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TVarData(...);
+}
+#else
+bool_t xdr_pppcontroller_TVarData();
+#endif
+
+
+#define PPPCONTROLLER ((u_long)0x34630204)
+#define PPPCONTROLLER_VERSION ((u_long)4)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_4( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_4();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_4( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_4();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_4( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_4();
+#endif /* __cplusplus */
+#define CSTR_STARTPPPSESSION ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_startpppsession_4( TPppSessionConfig * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_startpppsession_4();
+#endif /* __cplusplus */
+#define DSTR_REMOVEPPPSESSION ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *dstr_removepppsession_4( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *dstr_removepppsession_4();
+#endif /* __cplusplus */
+#define KILLSESSION ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *killsession_4( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *killsession_4();
+#endif /* __cplusplus */
+#define STOPSESSION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopsession_4( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopsession_4();
+#endif /* __cplusplus */
+#define GETSESSIONINFO ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TPppSessionDesc *getsessioninfo_4( int * arg, CLIENT *cl );
+}
+#else
+extern TPppSessionDesc *getsessioninfo_4();
+#endif /* __cplusplus */
+#define GETPPPLOG ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getppplog_4( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getppplog_4();
+#endif /* __cplusplus */
+
+#endif /* __PPPCONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../pppcontroller/pppcontroller.x"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "pppcontroller.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_4(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_pppcontroller_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_4(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_4(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_pppcontroller_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+cstr_startpppsession_4(argp, clnt)
+	TPppSessionConfig *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, CSTR_STARTPPPSESSION, xdr_pppcontroller_TPppSessionConfig, argp, xdr_pppcontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+dstr_removepppsession_4(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, DSTR_REMOVEPPPSESSION, xdr_int, argp, xdr_pppcontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+killsession_4(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, KILLSESSION, xdr_int, argp, xdr_pppcontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+stopsession_4(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, STOPSESSION, xdr_int, argp, xdr_pppcontroller_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TPppSessionDesc *
+getsessioninfo_4(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TPppSessionDesc res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETSESSIONINFO, xdr_int, argp, xdr_pppcontroller_TPppSessionDesc, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TVarData *
+getppplog_4(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TVarData res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, GETPPPLOG, xdr_int, argp, xdr_pppcontroller_TVarData, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "pppcontroller.h"
+
+
+bool_t
+xdr_pppcontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TPppSessionStatus(xdrs, objp)
+	XDR *xdrs;
+	TPppSessionStatus *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TPppSessionConfig(xdrs, objp)
+	XDR *xdrs;
+	TPppSessionConfig *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iMobsterAddress, MAXADDRLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iMobsterPort, MAXPORTLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iSessionConfiguration, MAXCONFIGURATIONLENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMTID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TPppSessionDesc(xdrs, objp)
+	XDR *xdrs;
+	TPppSessionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iErrorCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_pppcontroller_TPppSessionConfig(xdrs, &objp->iConfig)) {
+		return (FALSE);
+	}
+	if (!xdr_pppcontroller_TPppSessionStatus(xdrs, &objp->iSessionStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInterfaceName, MAXSESSIONNAMELEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLocalIPAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRemoteIPAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitCode)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iStandardResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExtendedCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSystemError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Test/CTestStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: CTestStub.cpp
+* ServiceStub for unit testing the Usecase Controller. 
+* System Includes
+*
+*/
+
+
+
+#include <assert.h>
+#include <winsock2.h>
+#include <windows.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+#include "CTestStub.h"
+#include "../../../include/penstd.h"
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CTestStub::CTestStub()
+{
+}
+
+
+CTestStub::~CTestStub()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CTestStub::StartUccsService( char *aHostName, int *aErrorDetail, int *aUnused )
+{
+	*aErrorDetail = *aUnused = 0;
+	return 0;
+}
+
+
+int CTestStub::StopUccsService( int *aErrorDetail, int *aUnused )
+{
+	*aErrorDetail = *aUnused = 0;
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CTestStub::IssueCommand( CDataRecord* aRequest )
+{
+	int err = 0;
+	int method_id = -1;
+	CDataRecord* request_reply = NULL;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+	
+	// create result field
+	case 2:		
+		err = request_reply->NewField( "TEST_RESULT_FIELD", "TEST_RESULT_VALUE" );
+		assert( err == UCCS_OK );
+		UpdateCompletionCode( request_reply, ERR_NONE );			
+		break;
+
+	// Any other method id results in an invalid method id result
+	case 1:
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CTestStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CTestStub::GetLastRPCError( int *aIntError )
+{
+	assert( !"GetLastRPCError() - is not implemented" );
+	return NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Test/CTestStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* Filename: CTestStub.h
+* This class is a simple stub application which is used primarily
+* for the UCCS.  It does not do anything complicated and hence is good for 
+* isolating the upper levels of the system.
+*
+*/
+
+
+
+#ifndef __CTESTSTUB_H__
+#define __CTESTSTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+/*******************************************************************************
+ *
+ * CTestStub
+ *
+ ******************************************************************************/
+class CTestStub : public IService, public CServiceAgentBase
+{
+public:
+	CTestStub();
+	~CTestStub();
+
+	int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError );
+	int StopUccsService( int *aLocalerror, int *aRemoteError );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+};
+
+#endif __CTESTSTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CCTestservice.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCTestservice.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCTestservice::CCTestservice()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCTestservice::~CCTestservice()
+{
+	assert( cl == NULL );
+}
+
+char *CCTestservice::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCTestservice::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), TESTSERVICE, TESTSERVICE_VERSION, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCTestservice::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCTestservice::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCTestservice::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCTestservice::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_discard
+ * 
+ ***************************************************************************************/
+int CCTestservice::st_discard( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_discard_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_block
+ * 
+ ***************************************************************************************/
+int CCTestservice::st_block( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_block_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_wait
+ * 
+ ***************************************************************************************/
+int CCTestservice::st_wait( int aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_wait_11( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CCTestservice.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCTESTSERVICE_H__
+#define __CCTESTSERVICE_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "testservice.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCTestservice
+ * 
+ ***************************************************************************************/
+class CCTestservice
+{
+public:
+	// standard methods
+	CCTestservice();
+	~CCTestservice();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int st_discard( int aArgs, TResult *rv );
+	int st_block( int aArgs, TResult *rv );
+	int st_wait( int aArgs, TResult *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CTestServiceStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+#include "CTestServiceStub.h"
+#include "CCTestservice.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CTestServiceStub::CTestServiceStub() 
+{
+	iClientTest = new CCTestservice();
+	assert( iClientTest != NULL );
+}
+
+
+CTestServiceStub::~CTestServiceStub()
+{
+	delete iClientTest;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CTestServiceStub::StartUccsService( char *aHostName, int *aErrorInfo, int *aUnused )
+{
+	int client_stub_error;
+	*aErrorInfo = *aUnused = 0;
+
+	// connect the stub to the remote service
+	client_stub_error = iClientTest->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CTestServiceStub::StopUccsService( int *aErrorInfo, int *aUnused )
+{
+	int client_stub_error;
+	*aErrorInfo = *aUnused = 0;
+
+	// disconnect the stub from the remote service
+	client_stub_error = iClientTest->Disconnect();
+
+	// return the result
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CTestServiceStub::IssueCommand( CDataRecord* aRequest )
+{
+	int i, client_result, method_id = -1;
+	CDataRecord *request_reply;
+	
+	TStartupInfo sarg_startupinfo;
+	int sarg_integer, rv_integer;
+	TResult rv_result;
+	TComponentList rv_component_list;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// extract the parameters
+		sarg_startupinfo.iEmpty = 0;
+
+		// make the call and update the return value
+		client_result = iClientTest->ss_startuprpcservice( sarg_startupinfo, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2:
+		
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+
+		// make the call and update the return value
+		client_result = iClientTest->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// list_devices
+	case 3:
+
+		// make the call and update the return value
+		client_result = iClientTest->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "DEVICECOUNT", rv_component_list.TComponentList_len );
+		for( i = 0; i < rv_component_list.TComponentList_len; i++ ) {
+			AddIteratedIntegerFieldName( "DEVICEID", i, (rv_component_list.TComponentList_val)[i], request_reply );
+		}
+		break;
+
+
+	// st_discard
+	case 10:
+
+		// extract the parameters
+		sarg_integer = 10;
+
+		// make the call and update the return value
+		client_result = iClientTest->st_discard( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_EXTENDED_CODE", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );
+		break;
+
+
+	// st_block
+	case 11:
+
+		// extract the parameters
+		sarg_integer = 11;
+
+		// make the call and update the return value
+		client_result = iClientTest->st_block( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_EXTENDED_CODE", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );
+		break;
+
+
+	// st_wait
+	case 12:
+
+		// extract the parameters
+		sarg_integer = 12;
+
+		// make the call and update the return value
+		client_result = iClientTest->st_wait( sarg_integer, &rv_result );
+		UpdateCompletionCode( request_reply, client_result );
+		if( client_result != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_result.iStandardResult );
+		request_reply->NewField( "RESULT_EXTENDED_CODE", rv_result.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv_result.iSystemError );
+		break;
+
+
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CTestServiceStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CTestServiceStub::GetLastRPCError( int *aIntError )
+{
+	return iClientTest->GetLastRPCError( aIntError );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CTestServiceStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CTestServiceStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CTESTSERVICESTUB_H__
+#define __CTESTSERVICESTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+
+/*******************************************************************************
+ *
+ * Forward declaration
+ *
+ ******************************************************************************/
+class CCTestservice;
+
+
+/*******************************************************************************
+ *
+ * CMobsterServiceStub
+ *
+ ******************************************************************************/
+class CTestServiceStub : public IService, public CServiceAgentBase
+{
+public:
+	CTestServiceStub();
+	~CTestServiceStub();
+
+	int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError );
+	int StopUccsService( int *aLocalerror, int *aRemoteError );
+	CDataRecord* IssueCommand( CDataRecord* aCommand );
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	CCTestservice *iClientTest;
+};
+
+#endif //__CTESTSERVICESTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __TESTSERVICE_H__
+#define __TESTSERVICE_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_testservice_TComponentList(...);
+}
+#else
+bool_t xdr_testservice_TComponentList();
+#endif
+
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_testservice_TResult(...);
+}
+#else
+bool_t xdr_testservice_TResult();
+#endif
+
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_testservice_TStartupInfo(...);
+}
+#else
+bool_t xdr_testservice_TStartupInfo();
+#endif
+
+
+#define TESTSERVICE ((u_long)0x34630211)
+#define TESTSERVICE_VERSION ((u_long)11)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_11( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_11();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_11( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_11();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_11( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_11();
+#endif /* __cplusplus */
+#define ST_DISCARD ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_discard_11( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_discard_11();
+#endif /* __cplusplus */
+#define ST_BLOCK ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_block_11( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_block_11();
+#endif /* __cplusplus */
+#define ST_WAIT ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_wait_11( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_wait_11();
+#endif /* __cplusplus */
+
+#endif /* __TESTSERVICE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,20 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../../TestSource/ManualTestTools/TestService/testservice.x"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "testservice.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_11(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_testservice_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_11(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_11(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_testservice_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_discard_11(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_DISCARD, xdr_int, argp, xdr_testservice_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_block_11(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_BLOCK, xdr_int, argp, xdr_testservice_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_wait_11(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_WAIT, xdr_int, argp, xdr_testservice_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "testservice.h"
+
+
+bool_t
+xdr_testservice_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_testservice_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iStandardResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExtendedCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSystemError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_testservice_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CCUuinterface.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,460 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <rpc/types.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CCUuinterface.h"
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CCUuinterface::CCUuinterface()
+{
+	cl = NULL;
+	iLastRPCError.re_status = RPC_SUCCESS;
+}
+
+CCUuinterface::~CCUuinterface()
+{
+	assert( cl == NULL );
+}
+
+char *CCUuinterface::GetLastRPCError( int *aIntErr )
+{
+	struct rpc_err rpcerr;
+
+	// check that the handle is valid
+	if( cl == NULL ) {
+		return NULL;
+	}
+
+	// pass the aIntErr
+	if( aIntErr != NULL ) {
+		clnt_geterr( cl, &rpcerr );
+		*aIntErr = rpcerr.re_status;
+	}
+
+	// return the errorstring
+	return clnt_sperror( cl, NULL );
+}
+
+int CCUuinterface::Connect( string aRemoteHost )
+{
+	// check that we are not already connected
+	if( cl != NULL ) {
+		return ERR_STUB_ALREADY_CONNECTED;
+	}
+
+	// start the rpc library
+	rpc_nt_init();
+
+	// connect to the service
+	cl = clnt_create( aRemoteHost.c_str(), UUINTERFACE, UUINTERFACEVER, "tcp" );
+	if( cl == NULL ) {
+		rpc_nt_exit();
+		return ERR_FAILED_TO_CONNECT;
+	}
+
+	// done
+	return ERR_NONE;
+}
+
+int CCUuinterface::Disconnect( )
+{
+	// check that we are connected
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// cleanup the client handle
+	clnt_destroy( cl );
+	cl = NULL;
+	rpc_nt_exit();
+
+	// done
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int CCUuinterface::ss_startuprpcservice( TStartupInfo aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *ss_startuprpcservice_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int CCUuinterface::sc_shutdownrpcservice( int aArgs, int *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *sc_shutdownrpcservice_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+int CCUuinterface::list_devices( TComponentList *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *list_devices_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setdelay
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_setdelay( TConfigValue aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_setdelay_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setdroppercentage
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_setdroppercentage( TConfigValue aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_setdroppercentage_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setduplicatepercentage
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_setduplicatepercentage( TConfigValue aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_setduplicatepercentage_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setbandwidth
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_setbandwidth( TConfigValue aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_setbandwidth_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_setdrd
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_setdrd( TConfigValue aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_setdrd_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_clearsettings
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_clearsettings( TConfigValue aArgs, TResult *rv )
+{
+	struct rpc_err rerr;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_clearsettings_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_stopservice
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_stopservice( TResult *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_stopservice_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: st_reset
+ * 
+ ***************************************************************************************/
+int CCUuinterface::st_reset( TResult *rv )
+{
+	struct rpc_err rerr;
+	int aArgs = 0;
+
+	// check the rv pointer
+	if( rv == NULL ) {
+		return ERR_INVALID_RV_POINTER;
+	}
+
+	// check that we have a connection
+	if( cl == NULL ) {
+		return ERR_STUB_NOT_CONNECTED;
+	}
+
+	// do the call
+	*rv = *st_reset_2( &aArgs, cl );
+
+	// check for rpc errors and return the result
+	clnt_geterr( cl, &rerr );
+	if( rerr.re_status != RPC_SUCCESS ) {
+		iLastRPCError = rerr;
+		return ERR_RPC_ERROR;
+	}
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CCUuinterface.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCUUINTERFACE_H__
+#define __CCUUINTERFACE_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <rpc/rpc.h>
+#include <string>
+using namespace std;
+#include "uuinterface.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CCUuinterface
+ * 
+ ***************************************************************************************/
+class CCUuinterface
+{
+public:
+	// standard methods
+	CCUuinterface();
+	~CCUuinterface();
+	int Connect( string aRemoteHost );
+	int Disconnect();
+	char *GetLastRPCError( int *aIntErr );
+
+	// service methods
+	int ss_startuprpcservice( TStartupInfo aArgs, int *rv );
+	int sc_shutdownrpcservice( int aArgs, int *rv );
+	int list_devices( TComponentList *rv );
+	int st_setdelay( TConfigValue aArgs, TResult *rv );
+	int st_setdroppercentage( TConfigValue aArgs, TResult *rv );
+	int st_setduplicatepercentage( TConfigValue aArgs, TResult *rv );
+	int st_setbandwidth( TConfigValue aArgs, TResult *rv );
+	int st_setdrd( TConfigValue aArgs, TResult *rv );
+	int st_clearsettings( TConfigValue aArgs, TResult *rv );
+	int st_stopservice( TResult *rv );
+	int st_reset( TResult *rv );
+
+private:
+	struct rpc_err iLastRPCError;
+	CLIENT *cl;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CUuinterfaceStub.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,533 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "strncpynt.h"
+#include "CUuinterfaceStub.h"
+#include "CCUuinterface.h"
+#include "../../Core/UCCS_ServiceValues.h"
+#include "../../Core/UCCS_ErrorCodes.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+																		
+/*******************************************************************************
+ *
+ * Constructor / Destructor
+ *
+ ******************************************************************************/
+CUuinterfaceStub::CUuinterfaceStub()
+{
+	iUuClient = new CCUuinterface();
+	assert( iUuClient != NULL );
+}
+
+
+CUuinterfaceStub::~CUuinterfaceStub()
+{
+	delete iUuClient;
+}
+
+
+/*******************************************************************************
+ *
+ * Startup / Shutdown
+ *
+ ******************************************************************************/
+int CUuinterfaceStub::StartUccsService( char *aHostName,  int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+	
+	// check params
+	assert( aHostName != NULL );
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+	
+	// connect to the remote service
+	client_stub_error = iUuClient->Connect( aHostName );
+
+	// return the result
+	return client_stub_error;
+}
+
+
+int CUuinterfaceStub::StopUccsService( int *aErrorCode, int *aUnused )
+{
+	int client_stub_error;
+
+	// check params
+	assert( aErrorCode != NULL );
+	*aErrorCode = 0;
+
+	// shutdown the stub -- force it to close
+	client_stub_error = iUuClient->Disconnect();
+	
+	// done
+	return client_stub_error;
+}
+
+
+/*******************************************************************************
+ *
+ * IssueCommand
+ *
+ ******************************************************************************/
+CDataRecord* CUuinterfaceStub::IssueCommand( CDataRecord* aRequest )
+{
+	int call_result, err, client_stub_error, method_id = -1;
+	
+	int value_int, value_frac, sigma_int, sigma_frac, cor_int, cor_frac;
+	int max_value_int, max_value_frac;
+	int source_port, destination_port;
+	char *source_address, *destination_address;
+	char *protocol;
+
+	CDataRecord *request_reply;
+
+	TStartupInfo sarg_startup_info;
+	int rv_integer, sarg_integer;
+
+	TResult rv;
+	TComponentList rv_component_list;
+
+	struct TConfigValue val;
+
+	// check params
+	assert( aRequest != NULL );
+
+	// create a standard reply 
+	request_reply = CreateBaseReply( aRequest );
+	assert( request_reply != NULL );
+
+	// get and check the method_id
+	err = request_reply->GetFieldAsInt( "METHODID", &method_id );
+	if( method_id == -1 ) {
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		return request_reply;
+	}
+
+	// now dispatch and call the appropriate method
+	switch( method_id ) {
+
+	// ss_startuprpcservice
+	case 1:
+
+		// extract the parameters
+		sarg_startup_info.iEmpty = 0;
+
+		// make the call and update the return value
+		client_stub_error = iUuClient->ss_startuprpcservice( sarg_startup_info, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );		
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set any return information
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// sc_shutdownrpcservice
+	case 2: 
+		
+		// extract the parameters
+		GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
+		
+		// make the call and update the return value
+		client_stub_error = iUuClient->sc_shutdownrpcservice( sarg_integer, &rv_integer );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "RESULT", rv_integer );
+		break;
+
+	// list_devices
+	case 30:
+
+		// make the call and update the return value
+		client_stub_error = iUuClient->list_devices( &rv_component_list );
+		UpdateCompletionCode( request_reply, client_stub_error );
+		if( client_stub_error != ERR_NONE ) {
+			break;
+		}
+
+		// set the return values
+		request_reply->NewField( "COUNT", rv_component_list.TComponentList_len );
+		assert ( rv_component_list.TComponentList_len== 0 );
+		break;		
+
+	// st_setdelay
+	case 3:
+		// Extract the parameters
+		GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
+		GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DELAYI", &value_int, 6, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DELAYF", &value_frac, 7, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SIGMAI", &sigma_int, 8, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SIGMAF", &sigma_frac, 9, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CORRI", &cor_int, 7, 10, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CORRF", &cor_frac, 11, 1, aRequest, request_reply );
+
+		// Create the config values stub
+		//setPortValues ( &source_port, &destination_port );
+		CreateConfigValue( &val, 
+							source_address, destination_address, 
+							protocol, 
+							source_port, destination_port, 
+							value_int, value_frac, 
+							sigma_int, sigma_frac,
+							cor_int, cor_frac,
+							0,0,0,0 );
+
+		// Make the call and update the return values
+		call_result = iUuClient->st_setdelay( val, &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+
+		break;
+
+	// st_setdroppercentage
+	case 4:
+		//Extract the parameters
+		GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
+		GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DROPI", &value_int, 6, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DROPF", &value_frac, 7, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CORRI", &cor_int, 8, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CORRF", &cor_frac, 9, 1, aRequest, request_reply );
+
+		// Create the config values stub
+		//setPortValues ( &source_port, &destination_port );
+		CreateConfigValue( &val, 
+							source_address, destination_address, 
+							protocol,
+				            source_port, destination_port,
+							value_int, value_frac, 
+							0,0,
+							cor_int, cor_frac,
+							0,0,0,0 );
+
+		// Make the call and update the return values
+		call_result = iUuClient->st_setdroppercentage( val, &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+
+		break;
+
+	//st_setduplicatepercentage
+	case 5:
+		//Extract the parameters
+		GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
+		GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DUPI", &value_int, 6, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DUPF", &value_frac, 7, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CORRI", &cor_int, 8, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CORRF", &cor_frac, 9, 1, aRequest, request_reply );
+		
+		// Create the config values stub
+		//setPortValues ( &source_port, &destination_port );
+		CreateConfigValue( &val,
+							source_address, destination_address, 
+							protocol,
+				            source_port, destination_port,
+							value_int, value_frac, 
+							0,0,
+							cor_int, cor_frac,
+							0,0,0,0 );
+
+		// Make the call and update the return values
+		call_result = iUuClient->st_setduplicatepercentage( val, &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+
+		break;
+
+	// st_setbandwidth
+	case 6:
+		//Extract the parameters
+		GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
+		GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "BWI", &value_int, 6, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "BWF", &value_frac, 7, 1, aRequest, request_reply );
+
+		// Create the config values stub
+		//setPortValues ( &source_port, &destination_port );
+		CreateConfigValue( &val,
+							source_address, destination_address, 
+							protocol,
+							source_port, destination_port,
+							value_int, value_frac, 
+							0,0,0,0,0,0,0,0 );
+
+		// Make the call and update the return values
+		call_result = iUuClient->st_setbandwidth( val, &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+
+		break;
+
+	// st_setdrd
+	case 7:
+		//Extract the parameters
+		GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
+		GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "MINI", &value_int, 6, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "MINF", &value_frac, 7, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "MAXI", &max_value_int, 8, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "MAXF", &max_value_frac, 9, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CONGI", &cor_int, 10, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "CONGF", &cor_frac, 11, 1, aRequest, request_reply );
+	
+		// Create the config values stub
+		//setPortValues ( &source_port, &destination_port );
+		CreateConfigValue( &val, 
+							source_address, destination_address, 
+							protocol, 
+							source_port, destination_port,
+							value_int, value_frac, 
+							0,0,0,0,
+							max_value_int, max_value_frac,
+							cor_int, cor_frac );
+
+		// Make the call and update the return values
+		call_result = iUuClient->st_setdrd( val, &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+ 
+		break;
+
+	// st_clearsettings
+	case 8:
+		//Extract the parameters
+		GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
+		GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
+		GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
+		GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
+		GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
+
+		// Create the config values stub
+		//setPortValues ( &source_port, &destination_port );
+		CreateConfigValue( &val,
+							source_address, destination_address, 
+							protocol,
+							source_port, destination_port,
+							0,0,0,0,0,0,0,0,0,0 );
+
+		// Make the call and update the return values
+		call_result = iUuClient->st_clearsettings( val, &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+
+		break;
+	
+	// st_stopservice
+	case 9:
+		// Make the call and update the return values			
+		call_result = iUuClient->st_stopservice( &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+		
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+
+		break;
+
+	// st_reset
+	case 10:
+		// Make the call and update the return values
+		call_result = iUuClient->st_reset( &rv );
+		UpdateCompletionCode( request_reply, call_result );
+		if( call_result != ERR_NONE ) {
+			break;
+		}
+
+		// Set the return values
+		request_reply->NewField( "RESULT", rv.iStandardResult );
+		request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
+		request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
+
+		break;
+		
+	// Any other method id results in an invalid method id result
+	default:
+		UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
+		break;
+	}
+
+	// everything should be handled above 
+	return request_reply;
+}
+
+
+/*******************************************************************************
+ *
+ * GetStatus()
+ *
+ ******************************************************************************/
+int CUuinterfaceStub::GetStatus()
+{
+	assert( !"GetStatus() - is not implemented" );
+	return -1;
+}
+
+
+/*******************************************************************************
+ *
+ * GetLastRPCError()
+ *
+ ******************************************************************************/
+char *CUuinterfaceStub::GetLastRPCError( int *aIntError )
+{
+	return iUuClient->GetLastRPCError( aIntError );
+}
+
+/*******************************************************************************
+ *
+ * CreateConfigValue()
+ *
+ ******************************************************************************/
+void CUuinterfaceStub::CreateConfigValue( TConfigValue* aConfigValue,
+										char* aSrc, char* aDst, 
+										char* aProtocol, 
+										int aSrcPort, int aDstPort, 
+										int aValueIntegerPart, int aValueFractionPart, 
+										int aSigmaIntegerPart, int aSigmaFractionPart,
+										int aCorrelationIntegerPart, int aCorrelationFractionPart,
+										int aMaximumValueIntegerPart, int aMaximumValueFractionPart,
+										int aCongestionIntegerPart, int aCongestionFractionPart )
+{
+	int slen;
+
+	// check the params
+	assert( aSrc != NULL );
+	assert( aDst != NULL );
+
+	// copy the source address
+	STRNCPY_NULL_TERMINATE( aConfigValue->iSourceAddress, aSrc, X_MAX_ADDRESS_LENGTH);
+
+	// copy the destination address
+	STRNCPY_NULL_TERMINATE( aConfigValue->iDestinationAddress, aDst, X_MAX_ADDRESS_LENGTH);
+
+	// set the protocol
+	slen = strlen( aProtocol );
+	if( (aProtocol != NULL) && (strnicmp(aProtocol,UDP,slen) == 0) ) {
+		aConfigValue->iProtocol = X_UDP;
+	} else {
+		aConfigValue->iProtocol = X_TCP;
+	}
+
+	// set all the values
+	aConfigValue->iSrcPort = aSrcPort;
+	aConfigValue->iDstPort = aDstPort;
+	aConfigValue->iValueIntegerPart = aValueIntegerPart;
+	aConfigValue->iValueFractionPart = aValueFractionPart;
+	aConfigValue->iSigmaIntegerPart = aSigmaIntegerPart;
+	aConfigValue->iSigmaFractionPart = aSigmaFractionPart;
+	aConfigValue->iCorrelationIntegerPart = aCorrelationIntegerPart;
+	aConfigValue->iCorrelationFractionPart = aCorrelationFractionPart;
+	aConfigValue->iMaximumValueIntegerPart = aMaximumValueIntegerPart;
+	aConfigValue->iMaximumValueFractionPart = aMaximumValueFractionPart;
+	aConfigValue->iCongestionIntegerPart = aCongestionIntegerPart;
+	aConfigValue->iCongestionFractionPart = aCongestionFractionPart;
+
+	// done
+	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CUuinterfaceStub.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CUuinterfaceStub -- this class is the 'glue' between a standardised
+* UCCS interface (IService) and the custom service interface.
+*
+*/
+
+
+
+
+#ifndef __CUUINTERFACESTUB_H__
+#define __CUUINTERFACESTUB_H__
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../../Core/UCCS_Interfaces.h"
+#include "../CommonServiceStub/CServiceAgentBase.h"
+
+/*******************************************************************************
+ *
+ * Defines 
+ *
+ ******************************************************************************/
+#define TCP	"tcp"
+#define UDP "udp"
+
+/*******************************************************************************
+ *
+ * Forward declaration. 
+ *
+ ******************************************************************************/
+class CCUuinterface;
+struct TConfigValue;
+
+/*******************************************************************************
+ *
+ * CHostExecuteStub
+ *
+ ******************************************************************************/
+class CUuinterfaceStub : public IService, public CServiceAgentBase
+{
+public:
+	CUuinterfaceStub();
+	~CUuinterfaceStub();
+
+	int StartUccsService( char *aHostName, int* aLocalErr, int* aRemoteErr );
+	int StopUccsService(int* aLocalErr, int* aRemoteErr );
+	CDataRecord* IssueCommand(CDataRecord* aCommand);
+	int GetStatus();
+	char *GetLastRPCError( int *aIntError );
+
+private:
+	void CreateConfigValue( TConfigValue* aConfigValue,
+							char* aSrc, char* aDst,  
+							char* aProtocol, 
+							int aSrcPort, int aDstPort,
+							int aValueIntegerPart, int aValueFractionPart, 
+							int aSigmaIntegerPart, int aSigmaFractionPart,
+							int aCorrelationIntegerPart, int aCorrelationFractionPart,
+							int aMaximumValueIntegerPart, int aMaximumValueFractionPart,
+							int aCongestionIntegerPart, int aCongestionFractionPart );
+
+	CCUuinterface *iUuClient;
+};
+
+#endif //__CUUINTERFACESTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __UUINTERFACE_H__
+#define __UUINTERFACE_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TComponentList(...);
+}
+#else
+bool_t xdr_uuinterface_TComponentList();
+#endif
+
+#define X_MAX_ADDRESS_LENGTH 64
+#define X_TCP 6
+#define X_UDP 17
+#define ERR_FAILEDTOEXECUTECOMMAND -100
+#define ERR_PROCESSEXECUTEFAILED -101
+#define ERR_PORTNOTSPECIFIED -103
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TStartupInfo(...);
+}
+#else
+bool_t xdr_uuinterface_TStartupInfo();
+#endif
+
+
+struct TConfigValue {
+	char iSourceAddress[X_MAX_ADDRESS_LENGTH];
+	char iDestinationAddress[X_MAX_ADDRESS_LENGTH];
+	int iProtocol;
+	int iSrcPort;
+	int iDstPort;
+	int iValueIntegerPart;
+	int iValueFractionPart;
+	int iSigmaIntegerPart;
+	int iSigmaFractionPart;
+	int iCorrelationIntegerPart;
+	int iCorrelationFractionPart;
+	int iMaximumValueIntegerPart;
+	int iMaximumValueFractionPart;
+	int iCongestionIntegerPart;
+	int iCongestionFractionPart;
+};
+typedef struct TConfigValue TConfigValue;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TConfigValue(...);
+}
+#else
+bool_t xdr_uuinterface_TConfigValue();
+#endif
+
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_uuinterface_TResult(...);
+}
+#else
+bool_t xdr_uuinterface_TResult();
+#endif
+
+
+#define UUINTERFACE ((u_long)0x34630202)
+#define UUINTERFACEVER ((u_long)2)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_2( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_2();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_2( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_2();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_2( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_2();
+#endif /* __cplusplus */
+#define ST_SETDELAY ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setdelay_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setdelay_2();
+#endif /* __cplusplus */
+#define ST_SETDROPPERCENTAGE ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setdroppercentage_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setdroppercentage_2();
+#endif /* __cplusplus */
+#define ST_SETDUPLICATEPERCENTAGE ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setduplicatepercentage_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setduplicatepercentage_2();
+#endif /* __cplusplus */
+#define ST_SETBANDWIDTH ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setbandwidth_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setbandwidth_2();
+#endif /* __cplusplus */
+#define ST_SETDRD ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_setdrd_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_setdrd_2();
+#endif /* __cplusplus */
+#define ST_CLEARSETTINGS ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_clearsettings_2( TConfigValue * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_clearsettings_2();
+#endif /* __cplusplus */
+#define ST_STOPSERVICE ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_stopservice_2( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_stopservice_2();
+#endif /* __cplusplus */
+#define ST_RESET ((u_long)10)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *st_reset_2( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *st_reset_2();
+#endif /* __cplusplus */
+
+#endif /* __UUINTERFACE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../../UUinterface/uuinterface.x"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface_clnt.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "uuinterface.h"
+
+/* Default timeout can be changed using clnt_control() */
+static struct timeval TIMEOUT = { 25, 0 };
+
+int *
+ss_startuprpcservice_2(argp, clnt)
+	TStartupInfo *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SS_STARTUPRPCSERVICE, xdr_uuinterface_TStartupInfo, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+int *
+sc_shutdownrpcservice_2(argp, clnt)
+	int *argp;
+	CLIENT *clnt;
+{
+	static int res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, SC_SHUTDOWNRPCSERVICE, xdr_int, argp, xdr_int, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TComponentList *
+list_devices_2(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TComponentList res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, LIST_DEVICES, xdr_void, argp, xdr_uuinterface_TComponentList, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_setdelay_2(argp, clnt)
+	TConfigValue *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_SETDELAY, xdr_uuinterface_TConfigValue, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_setdroppercentage_2(argp, clnt)
+	TConfigValue *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_SETDROPPERCENTAGE, xdr_uuinterface_TConfigValue, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_setduplicatepercentage_2(argp, clnt)
+	TConfigValue *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_SETDUPLICATEPERCENTAGE, xdr_uuinterface_TConfigValue, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_setbandwidth_2(argp, clnt)
+	TConfigValue *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_SETBANDWIDTH, xdr_uuinterface_TConfigValue, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_setdrd_2(argp, clnt)
+	TConfigValue *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_SETDRD, xdr_uuinterface_TConfigValue, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_clearsettings_2(argp, clnt)
+	TConfigValue *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_CLEARSETTINGS, xdr_uuinterface_TConfigValue, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_stopservice_2(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_STOPSERVICE, xdr_void, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
+
+TResult *
+st_reset_2(argp, clnt)
+	void *argp;
+	CLIENT *clnt;
+{
+	static TResult res;
+
+	bzero((char *)&res, sizeof(res));
+	clnt_call(clnt, ST_RESET, xdr_void, argp, xdr_uuinterface_TResult, &res, TIMEOUT);
+	return (&res);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "uuinterface.h"
+
+
+bool_t
+xdr_uuinterface_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_uuinterface_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_uuinterface_TConfigValue(xdrs, objp)
+	XDR *xdrs;
+	TConfigValue *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iSourceAddress, X_MAX_ADDRESS_LENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iDestinationAddress, X_MAX_ADDRESS_LENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProtocol)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSrcPort)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDstPort)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iValueIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iValueFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSigmaIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSigmaFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCorrelationIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCorrelationFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMaximumValueIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMaximumValueFractionPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCongestionIntegerPart)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCongestionFractionPart)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_uuinterface_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iStandardResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExtendedCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSystemError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
Binary file testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/bullet.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0000.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,100 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#   USE-CASE-0: Start/Stop Services
+#   UP-TO-DATE
+#   This script starts all the services, waits for a signal, and then stops all the 
+# services. This should only be used by an administrator.
+#
+
+
+
+#######################################################################################
+#
+# Start the services
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=7 svchost="penmn"		methodid=1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=1
+	check RESULT=0
+runcmd svcid=2 svchost="penha"		methodid=1 BASEINTERFACE=0 BASENETMASK=24 BASESTARTRANGE=100 BASEENDRANGE=199 VIRTUALNETWORKPREFIX="192.168.111.0" VIRTUALNETWORKMASK=24 VIRTUALNETWORKSIZE=4
+	check RESULT=0
+runcmd svcid=3 svchost="penpdsn"	methodid=1 BASEINTERFACEINDEX=0 NETMASK=24 STARTHOSTADDRESSRANGE=100 STOPHOSTADDRESSRANGE=199
+	check RESULT=0
+runcmd svcid=4 svchost="penmn"		methodid=1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Signal that we are done
+#
+#######################################################################################
+signal
+waitforsignal
+
+
+#######################################################################################
+#
+# Get the object count for each service
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=9
+	check DEVICECOUNT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=9
+	check DEVICECOUNT=0
+runcmd svcid=7 svchost="penmn"		methodid=30
+	check DEVICECOUNT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=30
+	check DEVICECOUNT=0
+runcmd svcid=2 svchost="penha"		methodid=30
+	check AGENTCOUNT=0
+runcmd svcid=3 svchost="penpdsn"	methodid=30
+	check AGENTCOUNT=0
+runcmd svcid=4 svchost="penmn"		methodid=30
+	check AGENTCOUNT=0
+
+
+#######################################################################################
+#
+# Stop all the services
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=2 svchost="penha"		methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=3 svchost="penpdsn"	methodid=2 FORCE=0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn"		methodid=2 FORCE=0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Done
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0001.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,127 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-1: Standard PPP session.
+#   UP-TO-DATE
+#   (1)	Setup a PPP session between the MN and the PDSN. The PDSN will attach the session
+#	to the 192.168.200.x network, which has appropriate routes setup throughout 
+#	the inter-network. 
+#   (2)	Wait for a signal to bring down the link.
+#   (3)	Tell the PDSN to close the PPP connection and send a TERM-ACK. Wait for the MN
+#	side to shut itself down cleanly.
+#
+
+
+
+#######################################################################################
+#
+# MOBSTER:  Create an MT on the MN and the PDSN and link them to each other. Packetise
+#			PPP frames before sending them over the network.
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=mt0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=mt1
+	assign local_uu_port1=AIR_INPORT
+runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=mt0 REMOTE_ADDRESS="192.169.10.11" REMOTE_PORT=local_uu_port1
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=mt1 REMOTE_ADDRESS="10.22.1.6" REMOTE_PORT=local_uu_port0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Create a session on each machine using the new MTs. The PDSN session will 
+#		specify the IP addresses which the other side will accept.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"   methodid=31 MADDR="localhost" MPORT=7000 MTID=mt0 CONFIG="defaultroute noauth debug nodetach"
+	assign sid0=RESULT
+runcmd svcid=7 svchost="penpdsn" methodid=31 MADDR="localhost" MPORT=7000 MTID=mt1 CONFIG="defaultroute noauth 192.168.200.20:192.168.200.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# PPP:	Wait for the session to become established
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"	 methodid=7 SID=sid0
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=7 SID=sid1
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+runcmd svcid=7 svchost="penmn"	 methodid=7 SID=sid0
+runcmd svcid=7 svchost="penpdsn" methodid=7 SID=sid1
+
+
+#######################################################################################
+#
+# CONNECTION ESTABLISHED: Now do what you want with the connection
+#
+#######################################################################################
+signal
+waitforsignal
+
+
+#######################################################################################
+#
+# PPP:	Stop the PPP session from the PDSN side and wait for the MN to exit. Retrieve
+#		all logs before removing the objects.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+runcmd svcid=7 svchost="penmn"	methodid=7 SID=sid0
+	waitfor SESSION_PROCESS_STATUS=3
+	check RESULT=0
+	check SESSION_STATUS=4
+runcmd svcid=7 svchost="penmn" methodid=8 SID=sid0
+runcmd svcid=7 svchost="penmn" methodid=32 SID=sid0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# MOBSTER: Remove the mobster devices, they should already have stopped
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=mt0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=mt0
+	check RESULT=0
+
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=mt1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=mt1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# DONE
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0002.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,195 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-2: Standard MIP session.
+#   UP-TO-DATE
+#   (1)	Setup a PPP session between the MN and the PDSN. The PDSN will attach the session
+#	to the 192.168.220.x network, which does NOT have appropriate routes setup 
+#	throughout the inter-network. 
+#   (2)	Start the home and foreign agents.
+#   (3)	Start the mobile agent and wait for it to establish a MIP session.
+#   (4)	Wait for a signal to bring things down.
+#   (5) Bring everything down. The PPP session will be brought down as in use-case 1. 
+#
+
+
+
+#######################################################################################
+#
+# MOBSTER:  Create an MT on the MN and the PDSN and link them to each other. Packetise
+#			PPP frames before sending them over the network.
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=mt0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=mt1
+	assign local_uu_port1=AIR_INPORT
+runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=mt0 REMOTE_ADDRESS="192.169.10.11" REMOTE_PORT=local_uu_port1
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=mt1 REMOTE_ADDRESS="10.22.1.6" REMOTE_PORT=local_uu_port0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Create a session on each machine using the new MTs. The PDSN session will 
+#		specify the IP addresses which the other side will accept.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"   methodid=31 MADDR="localhost" MPORT=7000 MTID=mt0 CONFIG="defaultroute noauth debug nodetach"
+	assign sid0=RESULT
+runcmd svcid=7 svchost="penpdsn" methodid=31 MADDR="localhost" MPORT=7000 MTID=mt1 CONFIG="defaultroute noauth 192.168.211.20:192.168.211.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# PPP:	Wait for the session to become established
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"	 methodid=7 SID=sid0
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn"	 methodid=7 SID=sid1
+	waitfor SESSION_STATUS=2
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Retrieve the interface of the PDSN ppp session
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	 methodid=7 SID=sid1
+	assign pdsn_ppp_interface0=SESSION_INTERFACE_NAME
+
+
+#######################################################################################
+#
+# HOME/FOREIGN AGENT: Create a HA/FA session and start the agent
+#
+#######################################################################################
+runcmd svcid=2 svchost="penha" methodid=31
+	assign ha0=RESULT
+runcmd svcid=2 svchost="penha" methodid=3 AGENTID=ha0
+	check RESULT=0
+runcmd svcid=2 svchost="penha" methodid=9 AGENTID=ha0
+	assign home_agent_address0=STATUS_HOME_AGENT_ADDRESS
+	assign home_address0=VIRTUAL_NETWORK_ADDRESS_0
+	check RESULT=0
+
+runcmd svcid=3 svchost="penpdsn" methodid=31
+	assign fa0=RESULT
+runcmd svcid=3 svchost="penpdsn" methodid=3 AGENTID=fa0 INTERFACE=pdsn_ppp_interface0 SOLICITATIONMODE=0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# MOBILE NODE AGENT: Create a mip session - set the home address - start the agent
+#
+#######################################################################################
+runcmd svcid=4 svchost="penmn" methodid=31
+	assign mn0=RESULT
+runcmd svcid=4 svchost="penmn" methodid=23 AGENTID=mn0 HOME_ADDRESS=home_address0 HOME_ADDRESS_PREFIX=24 HOME_AGENT_ADDRESS=home_agent_address0 INTERFACE=pdsn_ppp_interface0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn" methodid=3 AGENTID=mn0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# CONNECTION ESTABLISHED: Now do what you want with the connection
+#
+#######################################################################################
+signal
+waitforsignal
+
+
+#######################################################################################
+#
+# MOBILE NODE AGENT: Stop the agent and cleanup the session
+#
+#######################################################################################
+runcmd svcid=4 svchost="penmn" methodid=4 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=4 svchost="penmn" methodid=32 AGENTID=mn0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# HOME/FOREIGN AGENT: Stop the agent and cleanup the session
+#
+#######################################################################################
+runcmd svcid=2 svchost="penha" methodid=4 AGENTID=ha0
+	check RESULT=0
+runcmd svcid=2 svchost="penha" methodid=32 AGENTID=ha0
+	check RESULT=0
+
+runcmd svcid=3 svchost="penpdsn" methodid=4 AGENTID=fa0
+	check RESULT=0
+runcmd svcid=3 svchost="penpdsn" methodid=32 AGENTID=fa0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# PPP:	Stop the PPP session from the PDSN side and wait for the MN to exit. Retrieve
+#		all logs before removing the objects.
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+	check RESULT=0
+
+runcmd svcid=7 svchost="penmn"	methodid=7 SID=sid0
+	waitfor SESSION_PROCESS_STATUS=3
+	check RESULT=0
+	check SESSION_STATUS=4
+runcmd svcid=7 svchost="penmn" methodid=8 SID=sid0
+runcmd svcid=7 svchost="penmn" methodid=32 SID=sid0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# MOBSTER: Remove the mobster devices, they should already have stopped
+#
+#######################################################################################
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=mt0
+	check RESULT=0
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=mt0
+	check RESULT=0
+
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=mt1
+	check RESULT=0
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=mt1
+	check RESULT=0
+
+
+#######################################################################################
+#
+# DONE
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0003.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,136 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-3: Mobile IP session with dropped packets
+#   NOT UP-TO-DATE
+#   Setup a Mobile IP session. Configure NISTNET to drop 15% of packets
+# on the channel.
+#
+
+#######################################################################################
+#
+# Create an MT on the PDSN and the MN
+#
+#######################################################################################
+runcmd svcid=4 methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR=localhost CHANNEL_PORT=4000 AIR_OUTADDR=192.168.10.11 AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=1 FILTERCONFIG=1
+runcmd svcid=5 methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR=localhost CHANNEL_PORT=4000 AIR_OUTADDR=10.22.1.4 AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=1 FILTERCONFIG=1
+
+
+#######################################################################################
+#
+# Create a PPP session on the MN and PDSN
+#
+#######################################################################################
+runcmd svcid=11 methodid=3 MADDR=localhost MPORT=4000 CONFIG="defaultroute noauth 192.168.100.10:192.168.100.20 debug logfile ./ppp.log nodetach"
+runcmd svcid=8 methodid=3 MADDR=localhost MPORT=4000 CONFIG="noauth 192.168.100.20:192.168.100.10 debug logfile ./ppp.log nodetach"
+
+
+#######################################################################################
+#
+# The PPP session should now be setup. Use this wait to verify that the PPP session is
+# up and working as expected.
+#
+#######################################################################################
+runcmd svcid=10 methodid=1 PERIOD=4000
+
+
+#######################################################################################
+#
+# Start the home agent and the foreign agent running, wait a bit, then start the mobile 
+# node. We then give some time for the channel to setup a connection before we drop the
+# QoS of the channel
+#
+#######################################################################################
+runcmd svcid=1   methodid=3
+runcmd svcid=2   methodid=3
+runcmd svcid=10  methodid=1 PERIOD=2000
+runcmd svcid=3	 methodid=3
+runcmd svcid=10  methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# Configure NISTNET to drop udp echo packets from the mn to the target server
+#
+#######################################################################################
+#runcmd svcid=6 methodid=2 SRC=10.22.1.4:5000.udp DST=192.168.10.11:5000.udp DROPI=15
+
+
+#######################################################################################
+#
+# Verify that a mobile IP connection is done and play
+#
+#######################################################################################
+rendezvous
+rendezvous
+
+
+#######################################################################################
+#
+# Configure NISTNET to drop udp echo packets from the mn to the target server
+#
+#######################################################################################
+runcmd svcid=6 methodid=2 SRC=10.22.1.4:5000.udp DST=192.168.10.11:5000.udp DROPI=0
+
+
+#######################################################################################
+#
+# Stop the MA, FA, HA
+#
+#######################################################################################
+runcmd svcid=3 methodid=4
+runcmd svcid=1 methodid=4
+runcmd svcid=2 methodid=4
+
+
+#######################################################################################
+#
+# Cleanup the PPP session (MN and PDSN) (hardcode session ID as zero) retrieving all the logs
+#
+#######################################################################################
+runcmd svcid=11 methodid=4 SID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=11 methodid=6 SID=0
+
+runcmd svcid=8  methodid=4 SID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=8  methodid=6 SID=0
+
+
+
+#######################################################################################
+#
+# Cleanup mobster -- retrieving the logs (MN and PDSN)
+#
+#######################################################################################
+runcmd svcid=4  methodid=6 DEVICEID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=4  methodid=7 DEVICEID=0
+
+runcmd svcid=5  methodid=6 DEVICEID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=5  methodid=7 DEVICEID=0
+
+
+#######################################################################################
+#
+# We should be back to our original state now -- quit
+#
+#######################################################################################
+rendezvous
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0004.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,97 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-17: Setup multiple PPP connections
+#   NOT UP-TO-DATE
+#   Testing multiple PPP connections
+#
+runcmd svcid=6 svchost="penuu"	methodid=10
+
+#######################################################################################
+#
+# Create an two MTs on the PDSN and the MN
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="192.169.10.11" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penpdsn"	methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="10.22.1.6" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penmn"		methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4001 AIR_OUTADDR="192.169.10.11" AIR_OUTPORT=5001 AIR_INPORT=5001 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penpdsn"	methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4001 AIR_OUTADDR="10.22.1.6" AIR_OUTPORT=5001 AIR_INPORT=5001 DATALINKCONFIG=2 FILTERCONFIG=1
+
+#######################################################################################
+#
+# Create a PPP session on the MN and PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=3 MADDR="localhost" MPORT=4000 CONFIG="nodeflate noaccomp defaultroute noauth debug nodetach"
+runcmd svcid=7 svchost="penpdsn"	methodid=3 MADDR="localhost" MPORT=4000 CONFIG="plugin dynip.so nodeflate noaccomp noauth 192.168.200.20:192.168.200.0 debug nodetach"
+runcmd svcid=7 svchost="penmn"		methodid=3 MADDR="localhost" MPORT=4001 CONFIG="nodeflate noaccomp defaultroute noauth debug nodetach"
+runcmd svcid=7 svchost="penpdsn"	methodid=3 MADDR="localhost" MPORT=4001 CONFIG="plugin dynip.so nodeflate noaccomp noauth 192.168.200.20:192.168.200.0 debug nodetach"
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+signal
+
+#######################################################################################
+#
+# The PPP session should now be setup. 
+#
+#######################################################################################
+
+#######################################################################################
+#
+# Cleanup the PPP session (MN and PDSN) (hardcode session ID as zero) retrieving all the logs
+#
+#######################################################################################
+waitforsignal
+runcmd svcid=7 svchost="penpdsn"	methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penpdsn"	methodid=6 SID=0
+runcmd svcid=7 svchost="penpdsn"	methodid=4 SID=1
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penpdsn"	methodid=6 SID=1
+signal
+
+waitforsignal
+runcmd svcid=7 svchost="penmn"		methodid=4 SID=1
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penmn"		methodid=6 SID=1
+runcmd svcid=7 svchost="penmn"		methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penmn"		methodid=6 SID=0
+signal
+
+#######################################################################################
+#
+# Cleanup mobster -- retrieving the logs (MN and PDSN)
+#
+#######################################################################################
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=0
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=0
+
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=1
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=1
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=1
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=1
+
+
+#######################################################################################
+#
+# We should be back to our original state now -- quit
+#
+#######################################################################################
+rendezvous
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0005.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,106 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-18: Setup multiple MIP Connections
+#   NOT UP-TO-DATE
+#
+runcmd svcid=2	 svchost="penha"		methodid=6 TOKEN="MaxBindings" VALUE="1"
+quit
+
+runcmd svcid=6 svchost="penuu"		methodid=10
+runcmd svcid=8 svchost="penmn"		methodid=1  CMD="cp --reply=yes /etc/ppp/BACKUP-ip-up.local /etc/ppp/ip-up.local"
+runcmd svcid=2 svchost="penha"		methodid=13 TIMEOUT=10
+runcmd svcid=3 svchost="penpdsn"	methodid=13 TIMEOUT=10
+runcmd svcid=4 svchost="penmn"		methodid=22 TIMEOUT=10
+
+#######################################################################################
+#
+# Create an MT on the PDSN and the MN
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="192.169.10.11" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penpdsn"	methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="10.22.1.6" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+
+
+#######################################################################################
+#
+# Create a PPP session on the MN and PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=3 MADDR="localhost" MPORT=4000 CONFIG="defaultroute noauth 0.0.0.1:192.168.200.20 debug nodetach"
+runcmd svcid=7 svchost="penpdsn"	methodid=3 MADDR="localhost" MPORT=4000 CONFIG="noauth 192.168.200.20:0.0.0.1 debug nodetach"
+
+
+#######################################################################################
+#
+# The PPP session should now be setup.
+#
+#######################################################################################
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# Start the home agent and the foreign agent running, wait a bit, then start the mobile 
+# node. We then rendezvous so that the device knows that we have completed, and a 
+# second rendezvous tells when the device is ready for us to continue.
+#
+#######################################################################################
+runcmd svcid=2	 svchost="penha"		methodid=6 TOKEN="MaxBindings" VALUE="0"
+runcmd svcid=2   svchost="penha"		methodid=3
+runcmd svcid=3   svchost="penpdsn"		methodid=3
+runcmd svcid=9   svchost="localhost"	methodid=1 PERIOD=3000
+runcmd svcid=4	 svchost="penmn"		methodid=3
+signal 
+
+
+#######################################################################################
+#
+# Stop the MN (deregister MIP)
+#
+#######################################################################################
+waitforsignal
+runcmd svcid=4	svchost="penmn"			methodid=4
+runcmd svcid=9	svchost="localhost"		methodid=1 PERIOD=2000
+runcmd svcid=3	svchost="penpdsn"		methodid=4
+runcmd svcid=2	svchost="penha"			methodid=4
+runcmd svcid=9  svchost="localhost"		methodid=1 PERIOD=1000
+
+
+#######################################################################################
+#
+# Now stop the PPP connection between the MN and the PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penpdsn"	methodid=6 SID=0
+runcmd svcid=7 svchost="penmn"		methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penmn"		methodid=6 SID=0
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=0
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=0
+
+
+#######################################################################################
+#
+# Done
+#
+#######################################################################################
+runcmd svcid=8 svchost="penmn"	methodid=1 CMD="rm -f /etc/ppp/ip-up.local"
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0020.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,99 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-20:
+#		(1) Setup a PPP session between the MN and the PDSN, on the 192.168.200.x network.
+#		    Disable all accomp, ccp, and compression on the link so NISTNet works as 
+#		    expected.
+#		(2) Set nistnet to drop 15% of packets
+#		(3) MN will then start UDP session with the server and demonstrate packet loss.
+#		(4) MN will then start TCP session with the server and we get normal echo.
+#		(5) Drop PPP link.
+#		(6) Restart PPP link on the 192.168.220.x network.
+#		(7) Demonstrate that TCP session is lost.
+#
+runcmd svcid=6 svchost="penuu"	methodid=10
+
+#######################################################################################
+#
+# Create an MT on the PDSN and the MN
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="192.169.10.11" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penpdsn"	methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="10.22.1.6" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penmn"		methodid=4 DEVICEID=0
+runcmd svcid=5 svchost="penpdsn"	methodid=4 DEVICEID=0
+
+#######################################################################################
+#
+# Create a PPP session on the MN and PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=3 MADDR="localhost" MPORT=4000 CONFIG="nodeflate noaccomp defaultroute noauth 192.168.200.10:192.168.200.20 debug nodetach"
+runcmd svcid=7 svchost="penpdsn"	methodid=3 MADDR="localhost" MPORT=4000 CONFIG="nodeflate noaccomp noauth 192.168.200.20:192.168.200.10 debug nodetach"
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=6 svchost="penuu"		methodid=2 SRC="192.168.14.10:5000.udp" DST="192.169.10.11:5000.udp" DROPI=40
+signal
+
+#######################################################################################
+#
+# The PPP session should now be setup. The DUT can run some tests with the perfect
+# channel and then signal us when it wants us to start degrading the channel.
+#
+#######################################################################################
+#waitforsignal
+#runcmd svcid=6 svchost="penuu"		methodid=2 SRC="10.22.1.6:5000.udp" DST="192.169.10.11:5000.udp" DROPI=15
+#runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=10000
+#runcmd svcid=6 svchost="penuu"		methodid=2 SRC="10.22.1.6:5000.udp" DST="192.169.10.11:5000.udp" DROPI=40
+#runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=10000
+#runcmd svcid=6 svchost="penuu"		methodid=2 SRC="10.22.1.6:5000.udp" DST="192.169.10.11:5000.udp" DROPI=80
+#runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=10000
+#runcmd svcid=6 svchost="penuu"		methodid=2 SRC="10.22.1.6:5000.udp" DST="192.169.10.11:5000.udp" DROPI=99
+#runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=10000
+#runcmd svcid=6 svchost="penuu"		methodid=2 SRC="10.22.1.6:5000.udp" DST="192.169.10.11:5000.udp" DROPI=0
+
+
+#######################################################################################
+#
+# Cleanup the PPP session (MN and PDSN) (hardcode session ID as zero) retrieving all the logs
+#
+#######################################################################################
+waitforsignal
+runcmd svcid=7 svchost="penpdsn"	methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penpdsn"	methodid=6 SID=0
+runcmd svcid=7 svchost="penmn"		methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penmn"		methodid=6 SID=0
+
+
+#######################################################################################
+#
+# Cleanup mobster -- retrieving the logs (MN and PDSN)
+#
+#######################################################################################
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=0
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=0
+
+
+#######################################################################################
+#
+# We should be back to our original state now -- quit
+#
+#######################################################################################
+rendezvous
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0021.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,261 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-21: Foreign Agent Handover
+#
+
+#######################################################################################
+#
+# Do some initialisations
+#
+#######################################################################################
+runcmd svcid=6 svchost="penuu"	methodid=2 SRC="192.168.14.10:5000.udp" DST="192.169.10.11:5000.udp" DROPI=0
+runcmd svcid=8 svchost="penmn"		methodid=1  CMD="cp --reply=yes /etc/ppp/BACKUP-ip-up.local /etc/ppp/ip-up.local"
+runcmd svcid=2 svchost="penha"		methodid=13 TIMEOUT=10
+runcmd svcid=3 svchost="penpdsn"	methodid=13 TIMEOUT=10
+
+
+#######################################################################################
+#
+# Startup the Mobster service on the MN and the PDSN
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=1 PORT=7000
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn"	methodid=1 PORT=7000
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Create a device on each machine and set them as peers
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=mt0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=mt1
+	assign local_uu_port1=AIR_INPORT
+runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=mt0 REMOTE_ADDRESS="192.169.10.11" REMOTE_PORT=local_uu_port1
+runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=mt1 REMOTE_ADDRESS="10.22.1.6" REMOTE_PORT=local_uu_port0
+
+
+#######################################################################################
+#
+# Create a PPP session on the MN and PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penmn"		methodid=3 MADDR="localhost" MPORT=7000 CONFIG="defaultroute noauth 0.0.0.1:192.168.200.20 debug nodetach"
+runcmd svcid=7 svchost="penpdsn"	methodid=3 MADDR="localhost" MPORT=7000 CONFIG="noauth 192.168.200.20:0.0.0.1 debug nodetach"
+
+
+#######################################################################################
+#
+# The PPP session should now be setup.
+#
+#######################################################################################
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=2000
+
+
+#######################################################################################
+#
+# Start the home agent and the foreign agent running.
+#
+#######################################################################################
+runcmd svcid=2	 svchost="penha"		methodid=6 TOKEN="MaxBindings" VALUE=0
+runcmd svcid=2   svchost="penha"		methodid=3
+runcmd svcid=3   svchost="penpdsn"		methodid=3
+runcmd svcid=9   svchost="localhost"	methodid=1 PERIOD=3000
+
+
+#######################################################################################
+#
+# Start the mobile node service, create ann object, and start the agent
+#
+#######################################################################################
+runcmd svcid=4	 svchost="penmn"		methodid=1
+	check RESULT=0
+runcmd svcid=4	 svchost="penmn"		methodid=31
+	assign mn0=RESULT
+runcmd svcid=4   svchost="penmn"		methodid=3 AGENTID=mn0
+	check RESULT=0
+
+
+#######################################################################################
+#
+# Signal that we have completed the setup.
+#
+#######################################################################################
+signal 
+
+
+#######################################################################################
+#
+# Wait for signal to say disconnect
+#
+#######################################################################################
+waitforsignal
+
+
+#######################################################################################
+#
+# Stop the MN (deregister MIP)
+#
+#######################################################################################
+runcmd svcid=4	svchost="penmn"			methodid=4 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=9	svchost="localhost"		methodid=1 PERIOD=2000
+runcmd svcid=3	svchost="penpdsn"		methodid=4
+runcmd svcid=2	svchost="penha"			methodid=4
+runcmd svcid=9  svchost="localhost"		methodid=1 PERIOD=1000
+
+
+#######################################################################################
+#
+# Now stop the PPP connection between the MN and the PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penpdsn"	methodid=6 SID=0
+runcmd svcid=7 svchost="penmn"		methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penmn"		methodid=6 SID=0
+
+
+#######################################################################################
+#
+# Remove the mobster devices
+#
+#######################################################################################
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=mt1
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=mt1
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=mt0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=mt0
+
+
+#######################################################################################
+#
+# Signal that the connection has been brought down
+#
+#######################################################################################
+signal
+
+
+#######################################################################################
+#
+# Wait for a signal to bring the connection back up
+#
+#######################################################################################
+waitforsignal
+
+
+#######################################################################################
+#
+# Create a device on each machine and set them as peers
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt1=RESULT
+runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=mt0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=mt1
+	assign local_uu_port1=AIR_INPORT
+runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=mt0 REMOTE_ADDRESS="192.169.10.11" REMOTE_PORT=local_uu_port1
+runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=mt1 REMOTE_ADDRESS="10.22.1.6" REMOTE_PORT=local_uu_port0
+
+
+#######################################################################################
+#
+# Restart the PPP connection
+#
+#######################################################################################
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penmn"		methodid=3 MADDR="localhost" MPORT=4000 CONFIG="defaultroute noauth 0.0.0.2:192.168.220.20 debug nodetach"
+runcmd svcid=7 svchost="penpdsn"	methodid=3 MADDR="localhost" MPORT=4000 CONFIG="noauth 192.168.220.20:0.0.0.2 debug nodetach"
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=6000
+
+
+#######################################################################################
+#
+# Restart the mobile agent (and the FA)
+#
+#######################################################################################
+runcmd svcid=2   svchost="penha"		methodid=3
+runcmd svcid=3   svchost="penpdsn"		methodid=3
+runcmd svcid=9   svchost="localhost"	methodid=1 PERIOD=3000
+runcmd svcid=4	 svchost="penmn"		methodid=3 AGENTID=mn0
+	check RESULT=0
+signal
+
+
+#######################################################################################
+#
+# Stop the MA, FA, HA
+#
+#######################################################################################
+waitforsignal
+runcmd svcid=4	svchost="penmn"			methodid=4  AGENTID=mn0
+	check RESULT=0
+runcmd svcid=4  svchost="penmn"			methodid=32 AGENTID=mn0
+	check RESULT=0
+runcmd svcid=4  svchost="penmn"			methodid=2
+	check RESULT=0
+runcmd svcid=9	svchost="localhost"		methodid=1 PERIOD=2000
+runcmd svcid=3	svchost="penpdsn"		methodid=4
+runcmd svcid=2	svchost="penha"			methodid=4
+runcmd svcid=9  svchost="localhost"		methodid=1 PERIOD=1000
+
+
+#######################################################################################
+#
+# Cleanup the PPP session (MN and PDSN) (hardcode session ID as zero) retrieving all the logs
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penpdsn"	methodid=6 SID=0
+runcmd svcid=7 svchost="penmn"		methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penmn"		methodid=6 SID=0
+
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=mt1
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=mt1
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=mt0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=mt0
+
+
+#######################################################################################
+#
+# We should be back to our original state now -- quit
+#
+#######################################################################################
+runcmd svcid=8 svchost="penmn"	methodid=1 CMD="rm -f /etc/ppp/ip-up.local"
+rendezvous
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0022.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,138 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-22: 
+#		(1) Setup a PPP session between the MN and the PDSN, on the 192.168.200.x network.
+#		(2) Set nistnet to drop 15% of packets
+#		(3) MN will then start UDP session with the server and demonstrate packet loss.
+#		(4) MN will then start TCP session with the server and we get normal echo.
+#		(5) Drop PPP link.
+#		(6) Restart PPP link on the 192.168.220.x network.
+#		(7) Demonstrate that TCP session is lost.
+#
+
+
+#######################################################################################
+#
+# Create an MT on the PDSN and the MN
+#
+#######################################################################################
+runcmd svcid=6 methodid=2 SRC=10.22.1.4:5000.udp DST=192.168.10.11:5000.udp DROPI=0
+runcmd svcid=4 methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR=localhost CHANNEL_PORT=4000 AIR_OUTADDR=192.168.10.11 AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=1 FILTERCONFIG=1
+runcmd svcid=5 methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR=localhost CHANNEL_PORT=4000 AIR_OUTADDR=10.22.1.4 AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=1 FILTERCONFIG=1
+
+
+#######################################################################################
+#
+# Create a PPP session on the MN and PDSN
+#
+#######################################################################################
+runcmd svcid=11 methodid=3 MADDR=localhost MPORT=4000 CONFIG="nodeflate noaccomp defaultroute noauth 192.168.200.10:192.168.200.20 debug logfile ./ppp.log nodetach"
+runcmd svcid=8 methodid=3 MADDR=localhost MPORT=4000 CONFIG="nodeflate noaccomp noauth 192.168.200.20:192.168.200.10 debug logfile ./ppp.log nodetach"
+
+
+#######################################################################################
+#
+# The PPP session should now be setup. The device can now run it's tests and rendezvous
+# when it is complete.
+#
+#######################################################################################
+rendezvous
+rendezvous
+
+
+#######################################################################################
+#
+# Cleanup the PPP session (MN and PDSN) (hardcode session ID as zero) retrieving all the logs
+#
+#######################################################################################
+runcmd svcid=11 methodid=4 SID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=11 methodid=6 SID=0
+
+runcmd svcid=8  methodid=4 SID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=8  methodid=6 SID=0
+
+
+#######################################################################################
+#
+# Cleanup mobster -- retrieving the logs (MN and PDSN)
+#
+#######################################################################################
+runcmd svcid=4  methodid=6 DEVICEID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=4  methodid=7 DEVICEID=0
+
+runcmd svcid=5  methodid=6 DEVICEID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=5  methodid=7 DEVICEID=0
+rendezvous
+rendezvous
+
+
+#######################################################################################
+#
+# Create an MT on the PDSN and the MN
+#
+#######################################################################################
+runcmd svcid=4 methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR=localhost CHANNEL_PORT=4000 AIR_OUTADDR=192.168.10.11 AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=1 FILTERCONFIG=1
+runcmd svcid=5 methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR=localhost CHANNEL_PORT=4000 AIR_OUTADDR=10.22.1.4 AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=1 FILTERCONFIG=1
+
+
+#######################################################################################
+#
+# Create a PPP session on the MN and PDSN
+#
+#######################################################################################
+runcmd svcid=11 methodid=3 MADDR=localhost MPORT=4000 CONFIG="nodeflate noaccomp defaultroute noauth 192.168.220.10:192.168.220.20 debug logfile ./ppp.log nodetach"
+runcmd svcid=8 methodid=3 MADDR=localhost MPORT=4000 CONFIG="nodeflate noaccomp noauth 192.168.220.20:192.168.220.10 debug logfile ./ppp.log nodetach"
+rendezvous
+rendezvous
+
+
+#######################################################################################
+#
+# Cleanup the PPP session (MN and PDSN) (hardcode session ID as zero) retrieving all the logs
+#
+#######################################################################################
+runcmd svcid=11 methodid=4 SID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=11 methodid=6 SID=0
+
+runcmd svcid=8  methodid=4 SID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=8  methodid=6 SID=0
+
+
+#######################################################################################
+#
+# Cleanup mobster -- retrieving the logs (MN and PDSN)
+#
+#######################################################################################
+runcmd svcid=4  methodid=6 DEVICEID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=4  methodid=7 DEVICEID=0
+
+runcmd svcid=5  methodid=6 DEVICEID=0
+runcmd svcid=10 methodid=1 PERIOD=1000
+runcmd svcid=5  methodid=7 DEVICEID=0
+
+
+#######################################################################################
+#
+# We should be back to our original state now -- quit
+#
+#######################################################################################
+rendezvous
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0023.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,90 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-23: Setup a PPP session between SymbianOS and the PDSN
+#
+runcmd svcid=6 svchost="penuu"	methodid=2 SRC="10.22.1.6:5000.udp" DST="192.168.10.11:5000.udp" DROPI=0
+
+#######################################################################################
+#
+# Create an MT on the PDSN and the MN
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn"		methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="192.168.10.11" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penpdsn"	methodid=3 CHANNEL_TYPE=1 CHANNEL_ADDR="localhost" CHANNEL_PORT=4000 AIR_OUTADDR="10.22.1.6" AIR_OUTPORT=5000 AIR_INPORT=5000 DATALINKCONFIG=2 FILTERCONFIG=1
+runcmd svcid=5 svchost="penmn"		methodid=4 DEVICEID=0
+runcmd svcid=5 svchost="penpdsn"	methodid=4 DEVICEID=0
+
+
+#######################################################################################
+#
+# Create a PPP session on the PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=3 MADDR="localhost" MPORT=4000 CONFIG="nodeflate noaccomp noauth 192.168.200.20:192.168.200.10 debug logfile ./ppp.log nodetach"
+
+
+#######################################################################################
+#
+# The PPP session should now be setup. Rendezvous with the driver so we know he has
+# started. Then wait for 1 minute (let them play) and then set nistnet to drop 
+# 20 percent, then 80 percent, then 100 percent. The connection should timeout on
+# the symbian device.
+#
+#######################################################################################
+rendezvous
+rendezvous
+runcmd svcid=6 svchost="penuu"	methodid=2 SRC="10.22.1.6:5000.udp" DST="192.168.10.11:5000.udp" DROPI=10
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=2000
+runcmd svcid=6 svchost="penuu"	methodid=2 SRC="10.22.1.6:5000.udp" DST="192.168.10.11:5000.udp" DROPI=20
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=2000
+runcmd svcid=6 svchost="penuu"	methodid=2 SRC="10.22.1.6:5000.udp" DST="192.168.10.11:5000.udp" DROPI=40
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=2000
+runcmd svcid=6 svchost="penuu"	methodid=2 SRC="10.22.1.6:5000.udp" DST="192.168.10.11:5000.udp" DROPI=80
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=2000
+runcmd svcid=6 svchost="penuu"	methodid=2 SRC="10.22.1.6:5000.udp" DST="192.168.10.11:5000.udp" DROPI=99
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=2000
+rendezvous
+rendezvous
+
+
+#######################################################################################
+#
+# Cleanup the PPP session (MN and PDSN) (hardcode session ID as zero) retrieving all the logs
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn"	methodid=4 SID=0
+runcmd svcid=9 svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=7 svchost="penpdsn"	methodid=6 SID=0
+
+
+#######################################################################################
+#
+# Cleanup mobster -- retrieving the logs (MN and PDSN)
+#
+#######################################################################################
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=0
+runcmd svcid=5  svchost="penmn"		methodid=6 DEVICEID=0
+runcmd svcid=9	svchost="localhost"	methodid=1 PERIOD=1000
+runcmd svcid=5  svchost="penmn"		methodid=7 DEVICEID=0
+
+
+#######################################################################################
+#
+# We should be back to our original state now -- quit
+#
+#######################################################################################
+rendezvous
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0099.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE-99: This is for 'interactive' commands, i.e. this is just for putting 
+#		 whatever you want in, just saves you from creating a new file.
+#   UP-TO-DATE
+#
+runcmd svcid=7 svchost="penmn" methodid=30
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0100.ucd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#   USE-CASE 100£º
+#     Standard PPP session from SymbianOS device to the Test Network.
+#
+
+
+#######################################################################################
+#
+# MOBSTER:  Create a mobster device on the MN and the PDSN and link them together
+#
+#######################################################################################
+runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt0=RESULT
+runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=2 FILTERCONFIG=0
+	assign mt1=RESULT
+
+runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=mt0
+	assign local_uu_port0=AIR_INPORT
+runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=mt1
+	assign local_uu_port1=AIR_INPORT
+runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=mt0 REMOTE_ADDRESS="192.169.10.11" REMOTE_PORT=local_uu_port1
+	check RESULT=0
+runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=mt1 REMOTE_ADDRESS="10.22.1.6" REMOTE_PORT=local_uu_port0
+	check RESULT=0
+
+showenvironment
+
+
+#######################################################################################
+#
+# PPP:	Create a PPP session on the PDSN
+#
+#######################################################################################
+runcmd svcid=7 svchost="penpdsn" methodid=31 MADDR="localhost" MPORT=7000 MTID=mt1 CONFIG="defaultroute noauth 192.168.200.20:192.168.200.10 debug nodetach"
+	assign sid1=RESULT
+
+
+#######################################################################################
+#
+# Signal the device that we are waiting for a connection, and wait for the 
+# connection to be made.
+#
+#######################################################################################
+signal
+runcmd svcid=7 svchost="penpdsn" methodid=7 SID=sid1
+	waitfor SESSION_STATUS=2
+
+
+#######################################################################################
+#
+# Wait for a signal from the device to close the connection
+#
+#######################################################################################
+waitforsignal
+
+runcmd svcid=7 svchost="penpdsn" methodid=6 SID=sid1
+	check RESULT=0
+runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
+runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
+runcmd svcid=5  svchost="penpdsn"	methodid=6 DEVICEID=mt1
+runcmd svcid=5  svchost="penpdsn"	methodid=7 DEVICEID=mt1
+
+
+#######################################################################################
+#
+# Synchronise with the device to end the use-case
+#
+#######################################################################################
+rendezvous
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/TestScripts/ScheduleTestScripts/sts_0100.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+pause_at_end
+LOAD_SUITE TestNetworkControllerST.dll
+LOAD_SUITE NetworkingTestSuite.dll
+
+PRINT ---------------------------------------------
+PRINT  Test TCP/IP over a PPP connection
+PRINT ---------------------------------------------
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Test Steps
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+RUN_TEST_STEP 100,	TestNetworkControllerST, StartUseCase,	sts_0100.ini
+RUN_TEST_STEP 100,	TestNetworkControllerST, WaitForSignal,	sts_0100.ini
+RUN_TEST_STEP 100,	NetworkingTestSuite, MakePppConnection,  some_configuration.ini
+RUN_TEST_STEP 100,	TestNetworkControllerST, Signal,	sts_0100.ini
+RUN_TEST_STEP 100,	NetworkingTestSuite, UsePppConnection,  some_configuration.ini
+RUN_TEST_STEP 100,	TestNetworkControllerST, Rendezvous,	sts_0100.ini
+TEST_COMPLETE
+
+RUN_TEST_STEP 100,	TestNetworkControllerST, EndUseCase,	sts_0100.ini
+TEST_COMPLETE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/UCCS.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,6925 @@
+# Microsoft Developer Studio Project File - Name="UCCS" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=UCCS - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "UCCS.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "UCCS.mak" CFG="UCCS - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "UCCS - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "UCCS - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "UCCS"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I ".\Core" /I "..\..\External\source_for_build\oncrpc" /I "..\include" /I "..\..\..\GPSSimulator\Dev\APICommandHandler\inc" /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 oncrpcms.lib SocketLibrary.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /machine:I386 /nodefaultlib:"libcd.lib" /out:"..\..\bin\ucc.exe" /libpath:"..\..\BinInternal" /libpath:"..\..\..\..\testtoolsconn\oncrpc\binaries_for_build"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".\Core" /I "..\..\External\source_for_build\oncrpc" /I "..\include" /I "..\..\..\GPSSimulator\Dev\APICommandHandler\inc" /I "..\..\..\..\testtoolsconn\oncrpc\source_for_build\oncrpc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oncrpcms.lib SocketLibrary.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\..\bin\ucc.exe" /pdbtype:sept /libpath:"..\..\BinInternal" /libpath:"..\..\..\..\testtoolsconn\oncrpc\binaries_for_build"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF 
+
+# Begin Target
+
+# Name "UCCS - Win32 Release"
+# Name "UCCS - Win32 Debug"
+# Begin Group "Core"
+
+# PROP Default_Filter ""
+# Begin Group "include_"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Core\CRetrieveCommandFromConsole.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\CRetrieveCommandFromFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\CSynchronisation.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\CUCCIniFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\HTMLOutput.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\penstd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\strncpynt.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CBatchEngine.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CCommandDecoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CDataField.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CDataRecord.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CExecuteCommand.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CServMgr.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_ErrorCodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_Interfaces.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_ServiceValues.h
+# End Source File
+# End Group
+# Begin Group "source_"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Core\CRetrieveCommandFromConsole.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\CRetrieveCommandFromFile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\CSynchronisation.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\CUCCIniFile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\HTMLOutput.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\penstd.x
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CBatchEngine.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CCommandDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CDataField.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CDataRecord.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CExecuteCommand.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_CServMgr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_ErrorCodes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Core\UCCS_Main.cpp
+# End Source File
+# End Group
+# End Group
+# Begin Group "DeviceControlChannel"
+
+# PROP Default_Filter ""
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CApplicationControlNull.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CConsolePort.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CFrameBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CommandControlErrors.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CSerialPort.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CTcpPort.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CUCCSCommandControl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CUCCSCommandProtocol.cpp
+# End Source File
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CApplicationControlNull.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CConsolePort.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CFrameBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=Core\..\DeviceControlChannel\CommandControlErrors.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CProtocolTypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CSerialPort.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CTcpPort.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CUCCSCommandControl.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DeviceControlChannel\CUCCSCommandProtocol.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "ServiceStubs"
+
+# PROP Default_Filter ""
+# Begin Group "StandardBaseStub"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\CommonServiceStub\CServiceAgentBase.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\CommonServiceStub\CServiceAgentBase.h
+# End Source File
+# End Group
+# Begin Group "SS_Mobster"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\CCMobster.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\CCMobster.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\mobster.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\mobster_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\mobster_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\CMobsterStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\CMobsterStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Mobster.v2\mobster.x
+# End Source File
+# End Group
+# Begin Group "SS_Ppp"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files_"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\CCPppcontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\CCPppcontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\pppcontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\pppcontroller_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\pppcontroller_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\CPppControllerStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\CPppControllerStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Ppp\pppcontroller.x
+# End Source File
+# End Group
+# Begin Group "SS_ForeignAgent"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files___"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\CCFacontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\CCFacontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\facontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\facontroller_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\facontroller_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\CForeignAgentServiceStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\CForeignAgentServiceStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\ForeignAgent\facontroller.x
+# End Source File
+# End Group
+# Begin Group "SS_HomeAgent"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files____"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\CCHacontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\CCHacontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\hacontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\hacontroller_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\hacontroller_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\CHomeAgentServiceStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\CHomeAgentServiceStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HomeAgent\hacontroller.x
+# End Source File
+# End Group
+# Begin Group "SS_MobileAgent"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files__"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\CCMncontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\CCMncontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\mncontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\mncontroller_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\mncontroller_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\CMobileAgentServiceStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\CMobileAgentServiceStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\MobileAgent\mncontroller.x
+# End Source File
+# End Group
+# Begin Group "SS_UuInterface"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files_______"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\CCUuinterface.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\CCUuinterface.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\uuinterface.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\uuinterface_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\uuinterface_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\CUuinterfaceStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\CUuinterfaceStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\UuInterface\uuinterface.x
+# End Source File
+# End Group
+# Begin Group "SS_Internal"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Internal\CInternalStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Internal\CInternalStub.h
+# End Source File
+# End Group
+# Begin Group "SS_HostExecute"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files - HE"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\CCHostexecute.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\CCHostexecute.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\hostexecute.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\hostexecute_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\hostexecute_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\CHostExecuteStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\CHostExecuteStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecute\hostexecute.x
+# End Source File
+# End Group
+# Begin Group "SS_HostExecuteAsync"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files_____"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\CCHostexecuteasync.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\CCHostexecuteasync.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\hostexecuteasync.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\hostexecuteasync_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\hostexecuteasync_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\CHostExecuteAsyncStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\CHostExecuteAsyncStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\HostExecuteAsync\hostexecuteasync.x
+# End Source File
+# End Group
+# Begin Group "SS_Test"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Test\CTestStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\Test\CTestStub.h
+# End Source File
+# End Group
+# Begin Group "SS_GPSSimulator"
+
+# PROP Default_Filter ""
+# Begin Group "RPC Generated Files________"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GPSSimulator\APICommandHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GPSSimulator\APICommandHandler_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GPSSimulator\APICommandHandler_xdr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GPSSimulator\CCGpssimulator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GPSSimulator\CCGpssimulator.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GPSSimulator\CAPICommandHandlerStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GPSSimulator\CAPICommandHandlerStub.h
+# End Source File
+# End Group
+# Begin Group "SS_GenericStub"
+
+# PROP Default_Filter ""
+# Begin Group "RPC generated Files__________"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GenericStub\CCGenericstub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GenericStub\CCGenericstub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GenericStub\GenericStub.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GenericStub\GenericStub_clnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GenericStub\GenericStub_xdr.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GenericStub\CGenericrStub.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ServiceStubs\GenericStub\CGenericStub.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Scripts"
+
+# PROP Default_Filter ""
+# Begin Group "PR0084 - TestScripts"
+
+# PROP Default_Filter ""
+# Begin Group "UCCSTests"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0104.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0105.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0106.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0108.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0109.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0110.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0111.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0112.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0113.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0114.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0115.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0116.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0117.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0119.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0120.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0121.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0122.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\script.0123.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\UCCSTests\UCCSBatch.bat
+# End Source File
+# End Group
+# Begin Group "NistNet"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\NistNet\NistNetBatch.bat
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0040.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0041.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0042.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0043.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0044.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0045.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0046.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0047.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0048.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0049.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0050.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0051.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0052.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0053.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0084\NistNet\script.0054.ucd
+# End Source File
+# End Group
+# Begin Group "FAController_UNMAINTAINED"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\ForeignAgentBatch.bat
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0019.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0020.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0021.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0022.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0023.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0024.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0025.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0026.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0027.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0028.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0030.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0031.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0033.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0034.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\FAController\script.0035.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "HAController_UNMAINTAINED"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\HAControllerBatch.bat
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0019.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0020.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0021.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0022.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0023.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0024.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0025.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0026.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0027.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0028.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0030.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0033.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0034.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HAController\script.0035.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "Mobster_UNMAINTAINED"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\MobsterBatch.bat
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0010.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0011.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0012.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0014.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0015.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0016.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0017.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0018.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0019.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0020.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0021.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0025.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0026.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0027.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0028.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0029.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0030.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0031.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Mobster\script.0032.ucd
+# End Source File
+# End Group
+# Begin Group "PPP"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\PPPBatch.bat
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0013.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0014.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0022.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0024.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0025.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0026.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0027.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0028.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0029.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0030.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PPP\script.0031.ucd
+# End Source File
+# End Group
+# Begin Group "HostExecuteAsync_UNMAINTAINED"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\HostExecuteBatch.bat
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0010.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0020.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0021.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0022.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0023.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0024.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0025.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0026.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0027.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0028.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0029.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0030.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\HostExecuteAsync\script.0031.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "MNController_UNMAINTAINED"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\MNControllerBatch.bat
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0019.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0020.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0021.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0022.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0023.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0024.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0025.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0029.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0030.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0033.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0034.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0035.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0036.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0037.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0038.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0039.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0040.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0041.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0042.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0043.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\MNController\script.0044.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ScheduleTest"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\ScheduleTestClient\script.0001.ucd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\ScheduleTest\Test1.ini
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\ScheduleTest\Test1.script
+# End Source File
+# End Group
+# Begin Group "Lubbock"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\Lubbock\Lubbock_Test.zip
+# End Source File
+# End Group
+# End Group
+# Begin Group "Private TestScripts"
+
+# PROP Default_Filter ""
+# Begin Group "Demo Scripts"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0020.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0021.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0022.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0023.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "Standard Scripts"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0000.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0005.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.0099.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "Temp Scripts"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\TestScripts\PrivateScripts\script.1000.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ScheduleTestScripts"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\TestScripts\ScheduleTestScripts\sts_0100.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Group
+# Begin Group "PR0094 - TestScripts"
+
+# PROP Default_Filter ""
+# Begin Group "UT_mobster"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0005.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0008.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0014.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0015.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0019.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0024.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0028.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0031.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0032.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0034.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0035.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0036.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0037.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mobster\script.0038.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test14_client0_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test14_client0_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test14_client1_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test14_client1_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test1_client0_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test1_client0_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test1_client1_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test1_client1_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test37_client0_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test37_client0_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test37_client1_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test37_client1_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test5_client0_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test5_client0_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test5_client1_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test5_client1_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test6_client0_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test6_client0_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test6_client1_recv.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mobster\test6_client1_send.btxt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_mncontroller"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mncontroller\script.0012.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mncontroller\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mncontroller\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mncontroller\script.0101.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mncontroller\script.0102.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mncontroller\script.0103.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\Mncontroller\script.0104.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\script.0105.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\script.0106.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\script.0107.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\script.1001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\script.1002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\script.1003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\mncontroller\script.1004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_service_framework"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\ServiceFramework\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_facontroller"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0012.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0101.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0102.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0103.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0200.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0204.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.0205.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.1001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\facontroller\script.1002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_hacontroller"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0012.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0101.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0102.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0103.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0200.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0202.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0205.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.0206.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.1001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hacontroller\script.1002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_pppcontroller"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0101.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0102.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0103.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0110.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0112.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0113.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.0114.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.1000.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.1003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\pppcontroller\script.1004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_hostexecute"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\script.0005.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecute\script.0007.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_devicecontrolchannel"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0010.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0011.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0012.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0014.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0015.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0016.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0017.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0018.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0019.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0031.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0032.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0033.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0034.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0035.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\script.0036.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test1.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test1.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test10.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test10.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test11.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test11.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test12.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test12.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test13.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test13.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test14.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test14.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test15.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test15.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test16.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test16.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test17.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test17.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test18.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test18.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test19.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test19.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test2.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test2.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test3.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test3.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test31.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test31.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test32.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test32.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test33.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test33.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test34.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test34.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test35.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test35.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test36.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test36.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test4.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test5.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test5.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test6.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test6.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test7.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test7.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test8.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test8.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test9.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\devicecontrolchannel\test9.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_uuservice"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0005.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0007.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0008.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0009.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0010.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0011.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UUService\script.0012.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_hostexecuteasync"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0005.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0007.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0008.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0009.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0010.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0011.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0012.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\hostexecuteasync\script.0013.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_usecasecontroller"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0005.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0007.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0008.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0009.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0010.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\UsecaseController\script.0011.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_setdeviceid"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\setdeviceid\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\setdeviceid\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\setdeviceid\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\setdeviceid\sti.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\setdeviceid\sti.0002.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\setdeviceid\sts.0001.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\setdeviceid\sts.0002.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ST_mobster_pppcontroller"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\script.0005.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\script.0006.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobster_pppcontroller\script.0007.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ST_ppp_session"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\script.0050.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\script.0051.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\script.0052.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_ppp_session\script.0053.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ST_mobile_ip"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobile_ip\run_auto_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobile_ip\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobile_ip\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_mobile_ip\script.1001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ST_symbianos_ppp_session"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\dcomm.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\script.0101.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti.0002.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti.0003.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti.0004.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti_chargen.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti_chargen.0002.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti_chargen.0003.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti_chargen.0004.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti_chargen.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti_echo.0003.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sti_echo.0004.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sts.0001.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sts.0002.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sts.0003.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_sessions\sts.0004.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ST_symbianos_ppp_session_md"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\commdb_typhoon_emulator.ne.B.cfg
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\run_manual_verification_tests_A.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\run_manual_verification_tests_B.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\script.0001a.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\script.0001b.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\script.0100.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\script.0101.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\sti.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\sti.0002.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\sti_chargen.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\sti_chargen.0002.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\sts.0001.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_symbianos_ppp_session_multi_device\sts.0002.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "ST_uuservice"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_uuservice\run_manual_verification_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\st_uuservice\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_lubbock_control"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\script.0031.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\script.0032.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\script.0033.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\script.0034.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\script.0035.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\script.0036.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test31.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test31.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test32.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test32.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test33.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test33.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test34.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test34.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test35.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test35.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test36.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_control\test36.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "UT_lubbock_ppp"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\run_manual_interaction_tests.bat
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\sti.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\sti.0002.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\sti_chargen.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\sti_chargen.0002.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\sts.0001.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\lubbock_ppp\sts.0002.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\TestScripts\PR0094\readme.txt
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "SampleScripts"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\SampleScripts\script.0001.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SampleScripts\script.0002.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SampleScripts\script.0003.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SampleScripts\script.0004.ucd
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SampleScripts\sti.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SampleScripts\sti_chargen.0001.ini
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SampleScripts\sts.0001.script
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Group
+# Begin Group "Service Interfaces"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\hacontroller\hacontroller.x
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\pppcontroller\pppcontroller.x
+
+!IF  "$(CFG)" == "UCCS - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "UCCS - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\HOWTO_AddService.txt
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\SCRIPT_Commands.txt
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\ucc.rc
+# End Source File
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/UCCS.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SocketLibrary"=..\SocketLibrary\SocketLibrary.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "UCCS"=.\UCCS.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name SocketLibrary
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Binary file testexecmgmt/ucc/Source/Uccs.v2/Ucc.ico has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/resource.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+* {{NO_DEPENDENCIES}}
+* Microsoft Developer Studio generated include file.
+* Used by ucc.rc
+*
+*/
+
+
+
+#define IDI_ICON1                       101
+#define IDI_ICON2                       102
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        103
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/Uccs.v2/ucc.rc	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,72 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON2               ICON    DISCARDABLE     "Ucc.ico"
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/CSFacontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,780 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Oct 06 12:02:04 2003
+* System Includes
+*
+*/
+
+
+
+
+
+#include <stdio.h>
+#include <signal.h>
+#ifndef WIN32
+#include <unistd.h>
+#include <net/if.h>
+#endif
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcFacontroller.h"
+#include "CSFacontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition
+ * 
+ ***************************************************************************************/
+#define TEMPLATE_CONFIG_FILE			"dynfad.template.conf"
+#define MOBILE_AGENT_COMMAND_LINE		"./dynfad --fg --debug --config "
+#define MAXCOMMANDLINELENGTH			(31 + 256 + 1)
+#define MAXTUNNELS                      32
+#define MAXINTERFACECONFIGENTRY			(IFNAMSIZ + 128)
+#define CONFIGCOUNT						16
+
+
+/*******************************************************************************
+ *
+ * Macro Functions
+ *
+ ******************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSFacontroller::CSFacontroller()
+{
+	iDynamicsCallTimeout = -1;
+	iAgentProcess = NULL;
+}
+
+CSFacontroller::~CSFacontroller()
+{
+	assert( iAgentProcess == NULL );
+}
+
+int CSFacontroller::GetKey()
+{
+	return iKey;
+}
+
+void CSFacontroller::SetKey( int aKey )
+{
+	iKey = aKey;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::cstr_createagent( void )
+{
+	TResult rv;
+	TDCFError terr, terr_a[CONFIGCOUNT];
+	TInterfaceAliasError ierr;
+	TStartupInfo startup_info;
+	CIntegerAllocator *ialloc;
+	char dynamics_config[MAXINTERFACECONFIGENTRY];
+	string interface_name, interface_address;
+	int errcode, i;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// get an address for the new interface alias
+	ialloc = CSvcFacontroller::GetIntegerAllocator();
+	assert( ialloc != NULL );
+	iInterfaceHostAddress = ialloc->AllocateInteger();
+	if( iInterfaceHostAddress == -1 ) {
+	  rv.iServiceResult = ERR_NO_MORE_INTERFACES;
+	  return rv;
+	}
+
+	// create a local copy of the configuration file
+	terr = iDynamicsConfigFile.SetReferenceFile( TEMPLATE_CONFIG_FILE );
+	if( terr != DCE_NONE ) {
+	  ialloc->FreeInteger( iInterfaceHostAddress );
+	  rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+	  rv.iSubComponentResult = (int)terr;
+	  return rv;
+	}
+	terr = iDynamicsConfigFile.CreateLocalCopy( &errcode );
+	if( terr != DCE_NONE ) {
+	  ialloc->FreeInteger( iInterfaceHostAddress );
+	  rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+	  rv.iSubComponentResult = (int)terr;
+	  rv.iData0 = errcode;
+	  return rv;
+	}	  
+
+	// create an alias interface to use
+	startup_info = CSvcFacontroller::GetStartupInfo();
+	ierr = iAgentInterface.CreateNewInterfaceAlias( startup_info.iBaseInterfaceIndex, startup_info.iNetworkMask, iInterfaceHostAddress, &iInterfaceIndex, &errcode );
+	if( ierr != IE_NONE ) {
+	  rv.iServiceResult = ERR_CREATE_INTERFACE_ERROR;
+	  rv.iSubComponentResult = ierr;
+	  rv.iData0 = errcode;
+	  ialloc->FreeInteger( iInterfaceHostAddress );
+	  iDynamicsConfigFile.RemoveLocalCopy( &errcode );
+	  return rv;
+	}
+	ierr = iAgentInterface.GetInterfaceAddress( &interface_address );
+	assert( ierr == IE_NONE );
+
+	// set the interface name in the config file
+	ierr = iAgentInterface.GetInterfaceName( &interface_name );
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "%s 2 -1 10", interface_name.c_str() ); 
+	terr_a[0] = iDynamicsConfigFile.AddListOption( "INTERFACES_BEGIN", "INTERFACES_END", dynamics_config, &errcode );
+
+	// set the tunnel name prefix to a unique value for this agent
+	//	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "TunnelDevice \"TUNL-%s-\"", interface_name.c_str() );
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "TunnelDevice \"TUNL\"" );
+	terr_a[1] = iDynamicsConfigFile.SetSingleOption( "TunnelDevice", dynamics_config, &errcode );
+
+	// set the FA addresses to the alias interface address
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "HighestFAIPAddress %s", interface_address.c_str() );
+	terr_a[2] = iDynamicsConfigFile.SetSingleOption( "HighestFAIPAddress", dynamics_config, &errcode );
+
+	// set the FA addresses to the alias interface address
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "UpperFAIPAddress %s", interface_address.c_str() );
+	terr_a[3] = iDynamicsConfigFile.SetSingleOption( "UpperFAIPAddress", dynamics_config, &errcode );
+
+	// see if any errors occured setting the config info
+	for( i = 0; i < 3; i++ ) {
+		if( terr_a[i] != DCE_NONE ) {
+			rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+			rv.iSubComponentResult = (int)terr_a[i];
+			iAgentInterface.DestroyInterfaceAlias( &errcode );
+			ialloc->FreeInteger( iInterfaceHostAddress );
+			iDynamicsConfigFile.RemoveLocalCopy( &errcode );
+			return rv;
+		}
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+int CSFacontroller::dstr_removeagent( int aArgs, int *aDeleteInstance )
+{
+	int rv = ERR_NONE, errcode;
+	TDCFError terr;
+	TInterfaceAliasError ierr;
+	CIntegerAllocator *ialloc;
+
+	// make sure that the proces isn't running
+	if( iAgentProcess != NULL ) {
+	  *aDeleteInstance = 0;
+	  rv = ERR_INVALIDSTATE;
+	  return rv;
+	}
+
+	// free the interface index
+	ialloc = CSvcFacontroller::GetIntegerAllocator();
+	assert( ialloc != NULL );
+	ialloc->FreeInteger( iInterfaceHostAddress );
+
+	// clean up the config file
+	terr = iDynamicsConfigFile.RemoveLocalCopy( &errcode );
+
+	// destroy the interface alias
+	ierr = iAgentInterface.DestroyInterfaceAlias( &errcode );
+	  
+	// check for errors from the config file - delete the instance in any case
+	if( terr != DCE_NONE ) {
+	  rv = ERR_CONFIG_FILE_ERROR;
+	  return rv;
+	}
+
+	// check for errors from the interface alias - delete the instance
+	if( ierr != IE_NONE ) {
+	  rv = ERR_DESTROY_INTERFACE_ERROR;
+	  return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::startmobileagent( TStartAgentRequest aArgs )
+{
+	TResult rv;
+	int errcode;
+	TCAProcessError perr;
+	char command_line_str[MAXCOMMANDLINELENGTH];
+	TDCFError terr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that there is currently no process
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// do some semantic checking of the params
+	if( (aArgs.iSolicitationMode < -1) || (aArgs.iSolicitationMode > 1) ) {
+		rv.iServiceResult = ERR_INVALIDARG;
+		rv.iData0 = 3;
+		return rv;
+	}
+	if( (aArgs.iSolicitationMode == 1) && (aArgs.iSolicitationInterval < 1) ) {
+		rv.iServiceResult = ERR_INVALIDARG;
+		rv.iData0 = 4;
+		return rv;
+	}
+	if( aArgs.iSolicitationMode != 1 ) {
+	  aArgs.iSolicitationInterval = 1;
+	}
+
+	// add the interface name to the config file
+	snprintf( command_line_str, MAXCOMMANDLINELENGTH, "%s 3 %d %d", aArgs.iLowerInterface, aArgs.iSolicitationMode, aArgs.iSolicitationInterval );
+	terr = iDynamicsConfigFile.AddListOption( "INTERFACES_BEGIN", "INTERFACES_END", command_line_str, &errcode );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		return rv;
+	}
+	
+	// create the new process object
+	iAgentProcess = new CAProcess();
+	assert( iAgentProcess != NULL );
+
+	// construct the command line
+	snprintf( command_line_str, MAXCOMMANDLINELENGTH, "%s%s", MOBILE_AGENT_COMMAND_LINE, iDynamicsConfigFile.GetLocalFilename() );
+
+	// start the actual process
+	perr = iAgentProcess->StartProcess( command_line_str, &errcode, false, false, false ); 
+	if( perr != CAE_NONE ) {
+		rv.iServiceResult = ERR_START_PROCESS_ERROR;
+		rv.iSubComponentResult = (int)perr;
+		delete iAgentProcess;
+		iAgentProcess = NULL;
+		return rv;
+	}
+	iLowerInterface = aArgs.iLowerInterface;
+
+	// done - success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::stopmobileagent( int aArgs )
+{
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+	TDCFError terr;
+	int errcode;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+
+	// if the process isn't started then invalid state
+	if( iAgentProcess == NULL ) {
+	  rv.iServiceResult = ERR_INVALIDSTATE;
+	  return rv;
+	}
+
+	// remove the interface line added in startup
+	terr = iDynamicsConfigFile.RemoveListOption( "INTERFACES_BEGIN", "INTERFACES_END", iLowerInterface.c_str(), &errcode );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		return rv;
+	}
+
+	// if the process isn't running then it has died outside the scope of this controller, clean up the state, return an error since
+	// this is noteworthy and should be either expected or not happen.
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+	  assert( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) );
+	  delete iAgentProcess;
+	  iAgentProcess = NULL;
+	  rv.iServiceResult = ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE;
+	  return rv;
+	}
+
+	// request the process to stop
+	perr = iAgentProcess->RequestStop( SIGTERM );
+	if( perr != CAE_NONE ) {
+	  rv.iServiceResult = ERR_STOP_PROCESS_ERROR;
+	  rv.iSubComponentResult = (int)perr;
+	  return rv;
+	}
+
+	// wait for the process to stop
+	perr = iAgentProcess->WaitForProcessToTerminate( -1 );
+	if( perr != CAE_NONE ) {
+	  rv.iServiceResult = ERR_WAIT_PROCESS_ERROR;
+	  rv.iSubComponentResult = (int)perr;
+	  return rv;
+	}
+
+	// remove the process
+	delete iAgentProcess;
+	iAgentProcess = NULL;
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::getmobileagentstatus( int aArgs )
+{
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+
+	// if the process doesn't exist then we return PS_INVALID
+	if( iAgentProcess == NULL ) {
+		rv.iData0 = PS_INVALID;
+		return rv;
+	}
+
+	// otherwise just return whatever iAgentProcess->GetProcessStatus() returns
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	rv.iData0 = (int)pstatus;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::setsingleoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.SetSingleOption( aArgs.iOptionToken, aArgs.iOptionValue, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::removesingleoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.RemoveSingleOption( aArgs.iOptionToken, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::addlistoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.AddListOption( aArgs.iOptionBlockStart, aArgs.iOptionBlockEnd, aArgs.iOptionValue, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::removelistoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.RemoveListOption( aArgs.iOptionBlockStart, aArgs.iOptionBlockEnd, aArgs.iOptionToken, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+TFaStatusInfo CSFacontroller::getstatus( int aArgs )
+{
+	TFaStatusInfo rv;
+	TDynamicsCallInfo cres;
+	TForeignAgentStatusInfo foreign_agent_info;
+
+	// init the return value
+	memset( &rv, 0, sizeof(rv) );
+	rv.iCallResult.iServiceResult = ERR_NONE;
+	
+	// check that the agent is running
+	rv.iCallResult = is_agent_running();
+	if( rv.iCallResult.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.ForeignAgentGetStatus( &foreign_agent_info );
+	if( cres.iResult != DC_SUCCESS ) {
+		set_dynamics_error( &(rv.iCallResult), &cres );
+		return rv;
+	}
+
+	// set the result
+	rv.iAdvertisementsSent = foreign_agent_info.iAdvertisementsSent;
+	rv.iDiscardedMalformed = foreign_agent_info.iDiscardedMalformed;
+	rv.iDiscardedUnknownExtension = foreign_agent_info.iDiscardedUnknownExtension;
+	rv.iDiscardedVendor = foreign_agent_info.iDiscardedVendor;
+	rv.iPendingRegistrationRequests = foreign_agent_info.iPendingRegistrationRequests;
+	rv.iReplysAccepted = foreign_agent_info.iReplysAccepted;
+	rv.iReplysRejected = foreign_agent_info.iReplysRejected;
+	rv.iRequestsAccepted = foreign_agent_info.iRequestsAccepted;
+	rv.iRequestsRejected = foreign_agent_info.iRequestsRejected;
+	rv.iTunnelCount = foreign_agent_info.iTunnelCount;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: destroytunnelid
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::destroytunnelid( TFaTunnelID aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+
+	// init the return value
+	memset( &rv, 0, sizeof(rv) );
+	rv.iServiceResult = ERR_NONE;
+	
+	// check that the agent is running
+	rv = is_agent_running();
+	if( rv.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.ForeignAgentDestroyTunnel( aArgs.iMobileNodeAddress );
+	if( cres.iResult != DC_SUCCESS ) {
+		set_dynamics_error( &rv, &cres );
+		return rv;
+	}
+
+	// done 
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listtunnels
+ * 
+ ***************************************************************************************/
+TFaTunnelList CSFacontroller::listtunnels( int aArgs )
+{
+	TResult res;
+	TFaTunnelList rv = { 0, NULL };
+	TDynamicsCallInfo cres;
+	TTunnelID tunnel_list[MAXTUNNELS];
+	int tunnel_count = MAXTUNNELS, i;
+
+	// check that the agent is running
+	res = is_agent_running();
+	if( res.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.ForeignAgentGetTunnels( &tunnel_count, tunnel_list );
+	if( cres.iResult != DC_SUCCESS ) {
+		return rv;
+	}
+
+	// allocate memory for the list
+	rv.TFaTunnelList_len = tunnel_count;
+	rv.TFaTunnelList_val = (TFaTunnelID*)calloc( tunnel_count, sizeof(TFaTunnelID) );
+	assert( rv.TFaTunnelList_val != NULL );
+
+	// now return the information
+	for( i = 0; i < tunnel_count; i++ ) {
+		(rv.TFaTunnelList_val)[i].iAgentID = 0;
+		(rv.TFaTunnelList_val)[i].iID = (tunnel_list[i]).iTunnelID;
+		(rv.TFaTunnelList_val)[i].iHomeAgentAddress = (tunnel_list[i]).iHomeAgentAddress;
+		(rv.TFaTunnelList_val)[i].iMobileNodeAddress = (tunnel_list[i]).iMobileNodeAddress;
+	}
+
+	// done - success
+	return rv;
+}
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: gettunnelinfo
+ * 
+ ***************************************************************************************/
+TFaTunnelInfo CSFacontroller::gettunnelinfo( TGetTunnelRequest aArgs )
+{
+	TFaTunnelInfo rv;
+	TDynamicsCallInfo cres;
+	TForeignAgentTunnelInfo fati;
+
+	// init the result
+	memset( &rv, 0, sizeof(rv) );
+	rv.iCallResult.iServiceResult = ERR_NONE;
+
+	// check that the agent is running
+	rv.iCallResult = is_agent_running();
+	if( rv.iCallResult.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.ForeignAgentGetTunnelInfo( aArgs.iMobileNodeAddress, &fati );
+	if( cres.iResult != DC_SUCCESS ) {
+		set_dynamics_error( &(rv.iCallResult), &cres );
+		return rv;
+	}
+
+	// set the info
+	rv.iCareofAddress = fati.iCareofAddress;
+	rv.iCreationTime = fati.iCreationTime;
+	rv.iExpirationTime = fati.iExpirationTime;
+	rv.iHomeAgentAddress = fati.iHomeAgentAddress;
+	rv.iLastTimestamp = fati.iLastTimestamp;
+	rv.iMobileNodeAddress = fati.iMobileNodeAddress;
+	rv.iPrivateHomeAgentID = fati.iPrivateHomeAgentID;
+	rv.iRefreshTime = fati.iRefreshTime;
+	rv.iSPI = fati.iSPI;
+	rv.iTimeout = fati.iTimeout;
+	return rv;
+}
+
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+void CSFacontroller::settimeout( TTimeoutRequest aArgs )
+{
+	iDynamicsCallTimeout = aArgs.iTimeout;
+	iDynamicsCommand.SetTimeout( aArgs.iTimeout );
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: is_agent_running
+ * 
+ ***************************************************************************************/
+TResult CSFacontroller::is_agent_running()
+{	
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// clear the rv
+	memset( &rv, 0, sizeof(rv) );
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: is_agent_running
+ * 
+ ***************************************************************************************/
+void CSFacontroller::set_dynamics_error( TResult *result, TDynamicsCallInfo *cres )
+{
+	result->iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+	result->iSubComponentResult = cres->iResult;
+	result->iData0 = cres->iErrorCode;
+	result->iData1 = cres->iErrorDetail;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/CSFacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Oct 06 12:02:04 2003
+*
+*/
+
+
+
+
+
+#ifndef __CSFACONTROLLER_H__
+#define __CSFACONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <string>
+using namespace std;
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "../include/standard_unix.h"
+#include "../DynamicsConfigurationLibrary/CDynamicsConfigFile.h"
+#include "../ProcessLibrary/proclib.h"
+#include "../AliasLibrary/CInterfaceAlias.h"
+#include "../DynamicsCommandWrapper/CDynamicsCommand.h"
+#include "facontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSFacontroller
+ * 
+ ***************************************************************************************/
+class CSFacontroller
+{
+public:
+	// Standard Methods
+	CSFacontroller();
+	~CSFacontroller();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+	TResult cstr_createagent( void );
+	int dstr_removeagent( int aArgs, int *aDeleteInstance );
+	TResult startmobileagent( TStartAgentRequest aArgs );
+	TResult stopmobileagent( int aArgs );
+	TResult getmobileagentstatus( int aArgs );
+	TResult setsingleoption( TOptionDesc aArgs );
+	TResult removesingleoption( TOptionDesc aArgs );
+	TResult addlistoption( TOptionDesc aArgs );
+	TResult removelistoption( TOptionDesc aArgs );
+	TFaStatusInfo getstatus( int aArgs );
+	TResult destroytunnelid( TFaTunnelID aArgs );
+	TFaTunnelList listtunnels( int aArgs );
+	TFaTunnelInfo gettunnelinfo( TGetTunnelRequest aArgs );
+	void settimeout( TTimeoutRequest aArgs );
+
+private:
+	TResult is_agent_running();
+	void set_dynamics_error( TResult *result, TDynamicsCallInfo *cres );
+
+	int iKey;
+	int iDynamicsCallTimeout;
+	int iInterfaceIndex;
+	int iInterfaceHostAddress;
+	CDynamicsConfigFile iDynamicsConfigFile;
+	CAProcess *iAgentProcess;
+	CInterfaceAlias iAgentInterface;
+	string iLowerInterface;
+	CDynamicsCommand iDynamicsCommand;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/CSvcFacontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,267 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Oct 06 12:02:04 2003
+* System Includes
+*
+*/
+
+
+
+
+
+#include <stdio.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcFacontroller.h"
+#include "facontroller.h"
+#include "standard_service_manager.h"
+
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static TStartupInfo iStartupInfo;
+static CIntegerAllocator *iIntegerAllocator;
+static CComponentManager<CSFacontroller> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcFacontroller::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	int rv;
+	int *integer_ik;
+	TFaTunnelID *tunnel_ik;
+	TOptionDesc *option_ik;
+	TTimeoutRequest *timeout_ik;
+	TStartAgentRequest *startup_ik;
+	TGetTunnelRequest *get_tunnel_req_ik;
+
+	switch( aMethod ) {
+
+	// Methods with a single integer argument that is the key
+	case DSTR_REMOVEAGENT:
+	case STOPMOBILEAGENT:
+	case GETMOBILEAGENTSTATUS:
+	case GETSTATUS:
+	case LISTTUNNELS:
+		integer_ik = (int*)aArgs;
+		rv = *integer_ik;
+		break;
+
+	// Methods with TOptionDesc 
+	case SETSINGLEOPTION:
+	case REMOVESINGLEOPTION:
+	case ADDLISTOPTION:
+	case REMOVELISTOPTION:
+		option_ik = (TOptionDesc*)aArgs;
+		rv = option_ik->iAgentID;
+		break;
+
+	// TStartAgentRequest
+	case STARTMOBILEAGENT:
+	  startup_ik = (TStartAgentRequest*)aArgs;
+	  rv = startup_ik->iAgentID;
+	  break;
+
+	// Tunnel ID
+	case DESTROYTUNNELID:
+		tunnel_ik = (TFaTunnelID*)aArgs;
+		rv = tunnel_ik->iAgentID;
+		break;
+
+	// Timeout
+	case SETTIMEOUT:
+		timeout_ik = (TTimeoutRequest*)aArgs;
+		rv = timeout_ik->iAgentID;
+		break;
+
+	// TGetTunnelRequest
+	case GETTUNNELINFO:
+		get_tunnel_req_ik = (TGetTunnelRequest*)aArgs;
+		rv = get_tunnel_req_ik->iAgentID;
+		break;
+		
+	// error
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcFacontroller::SetError( int aMethod, void *aArgs, int aError )
+{
+	int rv = ERR_NONE;
+	TResult *result_rv;
+	TComponentList *result_cl;
+	TFaStatusInfo *result_fs;
+	TFaTunnelList *result_tl;
+	TFaTunnelInfo *result_ti;
+
+	switch( aMethod ) {
+
+	// TResult
+	case CSTR_CREATEAGENT:
+	case STARTMOBILEAGENT:
+	case STOPMOBILEAGENT:
+	case SETSINGLEOPTION:
+	case REMOVESINGLEOPTION:
+	case ADDLISTOPTION:
+	case REMOVELISTOPTION:
+	case DESTROYTUNNELID:
+		SET_ERROR_CODE( TResult, iServiceResult, result_rv );
+		break;
+
+	// TComponent
+	case LIST_DEVICES:
+		SET_LIST_ERROR_CODE( TComponentList, result_cl );
+		break;
+
+	// TFaStatusInfo
+	case GETSTATUS:
+		SET_ERROR_CODE( TFaStatusInfo, iCallResult.iServiceResult, result_fs );
+		break;
+
+	// TFaTunnelList
+	case LISTTUNNELS:
+		SET_LIST_ERROR_CODE( TFaTunnelList, result_tl );
+		break;
+
+	// TFaTunnelInfo 
+	case GETTUNNELINFO:
+		SET_ERROR_CODE( TFaTunnelInfo, iCallResult.iServiceResult, result_ti );
+		break;
+
+	// error
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+
+	// done
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError - Currently this methods will only ever be caleld for CSTR_CREATEAGENT
+ * 
+ ***************************************************************************************/
+int CSvcFacontroller::GetError( int aMethod, void *aArgs )
+{
+	TResult *result;
+
+	// check assumption
+	assert( aMethod == CSTR_CREATEAGENT );
+
+	// return error code
+	result = (TResult*)aArgs;
+	return result->iServiceResult;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcFacontroller::StartRPCService( CComponentManager<CSFacontroller> *aComponentManager, void *aArg )
+{
+  int err;
+
+  // save the passed args
+  iStartupInfo = *((TStartupInfo*)aArg);
+  
+  // create the component manager
+  assert( iComponentManager == NULL );
+  iComponentManager = aComponentManager;
+  
+  // setup the integer allocator
+  iIntegerAllocator = new CIntegerAllocator();
+  assert( iIntegerAllocator != NULL );
+  err = iIntegerAllocator->AddToIntegerPool( iStartupInfo.iStartHostAddressRange, iStartupInfo.iStopHostAddressRange );
+  if( err == -1 ) {
+    delete iIntegerAllocator;
+    iIntegerAllocator = NULL;
+    return ERR_INTEGER_ALLOCATOR_SETUP_ERROR;
+  }
+  return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcFacontroller::StopRPCService()
+{
+  // cleanup the integer allocator
+  delete iIntegerAllocator;
+  iIntegerAllocator = NULL;
+
+  // cleanup the component manager (stubs do the deletion)
+  iComponentManager = NULL;
+  return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetStartupInfo
+ * 
+ ***************************************************************************************/
+TStartupInfo CSvcFacontroller::GetStartupInfo()
+{
+	return iStartupInfo;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetIntegerAllocator
+ * 
+ ***************************************************************************************/
+CIntegerAllocator *CSvcFacontroller::GetIntegerAllocator()
+{
+  return iIntegerAllocator;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/CSvcFacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Oct 06 12:02:04 2003
+*
+*/
+
+
+
+
+
+#ifndef __CSVCFACONTROLLER_H__
+#define __CSVCFACONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "facontroller.h"
+#include "CSFacontroller.h"
+#include "CComponentManager.h"
+#include "../IntegerAllocatorLibrary/CIntegerAllocator.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcFacontroller
+ * 
+ ***************************************************************************************/
+class CSvcFacontroller
+{
+public:
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSFacontroller> *aComponentManager, void *aArg );
+	static int StopRPCService();
+
+	// Custom
+	static TStartupInfo GetStartupInfo();
+	static CIntegerAllocator *GetIntegerAllocator();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/FAController.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,184 @@
+# Microsoft Developer Studio Project File - Name="FAController" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=FAController - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "FAController.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "FAController.mak" CFG="FAController - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "FAController - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "FAController - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "FAController"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "FAController - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "FAController - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\External\source_for_build\oncrpc" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libdynconf.lib oncrpcms.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ExternalSource\binaries" /libpath:"..\..\BinInternal\\"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "FAController - Win32 Release"
+# Name "FAController - Win32 Debug"
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\facontroller.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\facontroller_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\facontroller_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\facontroller_xdr.c
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSFacontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSFacontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcFacontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcFacontroller.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\DynamicsCommandWrapper\CDynamicsCommand.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\DynamicsConfigurationLibrary\CDynamicsConfigFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\AliasLibrary\CInterfaceAlias.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_service_manager.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_unix.h
+# End Source File
+# End Group
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\facontroller.x
+
+!IF  "$(CFG)" == "FAController - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "FAController - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\facontroller.x
+
+"facontroller.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BuildTools\rpcgen -server  -component_base -wrapstring facontroller.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/FAController.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "FAController"=.\FAController.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+include /home/penuser/3GNetworkEmulator/Makefile.conf
+
+TARGET=../../bin/facontroller
+INCLUDES= -I../include/
+OBJECTS=		CSFacontroller.o 	\
+			CSvcFacontroller.o	\
+			facontroller_svc.o	\
+			facontroller_svc_stub_impl.o	\
+			facontroller_xdr.o
+
+LIBS=-L../../BinInternal -lproc -ldynamicsconfig -lalias -lintalloc -ldynwrap
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) ../../BinInternal/libproc.a ../../BinInternal/libdynamicsconfig.a ../../BinInternal/libalias.a ../../BinInternal/libintalloc.a ../../BinInternal/libdynwrap.a
+	g++ $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ dyntmp*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/facontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,396 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+
+#ifndef __FACONTROLLER_H__
+#define __FACONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TComponentList(...);
+}
+#else
+bool_t xdr_facontroller_TComponentList();
+#endif
+
+#define X_MAXOPTIONTOKENSIZE 512
+#define X_MAXINTERFACENAMESIZE 64
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_DYNAMICS_CALL_FAILED -107
+#define ERR_CONFIG_FILE_ERROR -108
+#define ERR_POLICY_OUTPUT_PARSING_FAILED -110
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_NO_MORE_INTERFACES -112
+#define ERR_CREATE_INTERFACE_ERROR -113
+#define ERR_DESTROY_INTERFACE_ERROR -114
+#define ERR_INTEGER_ALLOCATOR_SETUP_ERROR -115
+
+enum TSoliticationMode {
+	SM_SEND_NEVER = -1,
+	SM_SEND_IN_RESPONSE_TO_SOLICITATION_ONLY = 0,
+	SM_SEND_REGULAR = 1,
+};
+typedef enum TSoliticationMode TSoliticationMode;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TSoliticationMode(...);
+}
+#else
+bool_t xdr_facontroller_TSoliticationMode();
+#endif
+
+
+struct TStartupInfo {
+	int iBaseInterfaceIndex;
+	int iNetworkMask;
+	int iStartHostAddressRange;
+	int iStopHostAddressRange;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TStartupInfo(...);
+}
+#else
+bool_t xdr_facontroller_TStartupInfo();
+#endif
+
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TResult(...);
+}
+#else
+bool_t xdr_facontroller_TResult();
+#endif
+
+
+struct TOptionDesc {
+	int iAgentID;
+	char iOptionFilename[X_MAXOPTIONTOKENSIZE];
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+typedef struct TOptionDesc TOptionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TOptionDesc(...);
+}
+#else
+bool_t xdr_facontroller_TOptionDesc();
+#endif
+
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+typedef struct TTimeoutRequest TTimeoutRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TTimeoutRequest(...);
+}
+#else
+bool_t xdr_facontroller_TTimeoutRequest();
+#endif
+
+
+struct TGetTunnelRequest {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+typedef struct TGetTunnelRequest TGetTunnelRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TGetTunnelRequest(...);
+}
+#else
+bool_t xdr_facontroller_TGetTunnelRequest();
+#endif
+
+
+struct TStartAgentRequest {
+	int iAgentID;
+	char iLowerInterface[X_MAXINTERFACENAMESIZE];
+	TSoliticationMode iSolicitationMode;
+	int iSolicitationInterval;
+};
+typedef struct TStartAgentRequest TStartAgentRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TStartAgentRequest(...);
+}
+#else
+bool_t xdr_facontroller_TStartAgentRequest();
+#endif
+
+
+struct TFaStatusInfo {
+	TResult iCallResult;
+	int iTunnelCount;
+	int iPendingRegistrationRequests;
+	int iRequestsRejected;
+	int iRequestsAccepted;
+	int iReplysAccepted;
+	int iReplysRejected;
+	int iDiscardedUnknownExtension;
+	int iDiscardedMalformed;
+	int iDiscardedVendor;
+	int iAdvertisementsSent;
+};
+typedef struct TFaStatusInfo TFaStatusInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaStatusInfo(...);
+}
+#else
+bool_t xdr_facontroller_TFaStatusInfo();
+#endif
+
+
+struct TFaTunnelID {
+	int iAgentID;
+	int iMobileNodeAddress;
+	int iHomeAgentAddress;
+	int iID;
+};
+typedef struct TFaTunnelID TFaTunnelID;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaTunnelID(...);
+}
+#else
+bool_t xdr_facontroller_TFaTunnelID();
+#endif
+
+
+struct TFaTunnelInfo {
+	TResult iCallResult;
+	u_int iMobileNodeAddress;
+	u_int iCareofAddress;
+	u_int iHomeAgentAddress;
+	int iPrivateHomeAgentID;
+	int iCreationTime;
+	int iExpirationTime;
+	int iRefreshTime;
+	int iLastTimestamp;
+	int iSPI;
+	int iTimeout;
+};
+typedef struct TFaTunnelInfo TFaTunnelInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaTunnelInfo(...);
+}
+#else
+bool_t xdr_facontroller_TFaTunnelInfo();
+#endif
+
+
+typedef struct {
+	u_int TFaTunnelList_len;
+	TFaTunnelID *TFaTunnelList_val;
+} TFaTunnelList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_facontroller_TFaTunnelList(...);
+}
+#else
+bool_t xdr_facontroller_TFaTunnelList();
+#endif
+
+
+#define FACONTROLLER ((u_long)0x34630207)
+#define FACONTROLLER_VERSION ((u_long)7)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_7( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_7();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_7( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_7();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_7( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_7();
+#endif /* __cplusplus */
+#define CSTR_CREATEAGENT ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_createagent_7( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_createagent_7();
+#endif /* __cplusplus */
+#define DSTR_REMOVEAGENT ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removeagent_7( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removeagent_7();
+#endif /* __cplusplus */
+#define STARTMOBILEAGENT ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *startmobileagent_7( TStartAgentRequest * arg, CLIENT *cl );
+}
+#else
+extern TResult *startmobileagent_7();
+#endif /* __cplusplus */
+#define STOPMOBILEAGENT ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopmobileagent_7( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopmobileagent_7();
+#endif /* __cplusplus */
+#define GETMOBILEAGENTSTATUS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getmobileagentstatus_7( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getmobileagentstatus_7();
+#endif /* __cplusplus */
+#define SETSINGLEOPTION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setsingleoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *setsingleoption_7();
+#endif /* __cplusplus */
+#define REMOVESINGLEOPTION ((u_long)33)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removesingleoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removesingleoption_7();
+#endif /* __cplusplus */
+#define ADDLISTOPTION ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *addlistoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *addlistoption_7();
+#endif /* __cplusplus */
+#define REMOVELISTOPTION ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removelistoption_7( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removelistoption_7();
+#endif /* __cplusplus */
+#define GETSTATUS ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TFaStatusInfo *getstatus_7( int * arg, CLIENT *cl );
+}
+#else
+extern TFaStatusInfo *getstatus_7();
+#endif /* __cplusplus */
+#define DESTROYTUNNELID ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *destroytunnelid_7( TFaTunnelID * arg, CLIENT *cl );
+}
+#else
+extern TResult *destroytunnelid_7();
+#endif /* __cplusplus */
+#define LISTTUNNELS ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern TFaTunnelList *listtunnels_7( int * arg, CLIENT *cl );
+}
+#else
+extern TFaTunnelList *listtunnels_7();
+#endif /* __cplusplus */
+#define GETTUNNELINFO ((u_long)15)
+#ifdef __cplusplus
+extern "C" {
+extern TFaTunnelInfo *gettunnelinfo_7( TGetTunnelRequest * arg, CLIENT *cl );
+}
+#else
+extern TFaTunnelInfo *gettunnelinfo_7();
+#endif /* __cplusplus */
+#define SETTIMEOUT ((u_long)13)
+#ifdef __cplusplus
+extern "C" {
+extern void *settimeout_7( TTimeoutRequest * arg, CLIENT *cl );
+}
+#else
+extern void *settimeout_7();
+#endif /* __cplusplus */
+
+#endif /* __FACONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/facontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+
+/*******************************************************************************
+ *
+ * Interface Constants
+ *
+ ******************************************************************************/
+const X_MAXOPTIONTOKENSIZE			= 512;
+const X_MAXINTERFACENAMESIZE		= 64;
+
+
+/*******************************************************************************
+ *
+ * Error codes
+ *
+ ******************************************************************************/
+const ERR_WAIT_PROCESS_ERROR			= -103;
+const ERR_START_PROCESS_ERROR			= -105;
+const ERR_STOP_PROCESS_ERROR			= -106;
+const ERR_DYNAMICS_CALL_FAILED			= -107;
+const ERR_CONFIG_FILE_ERROR				= -108;
+const ERR_POLICY_OUTPUT_PARSING_FAILED			= -110;
+const ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE		= -111;
+const ERR_NO_MORE_INTERFACES					= -112;
+const ERR_CREATE_INTERFACE_ERROR				= -113;
+const ERR_DESTROY_INTERFACE_ERROR				= -114;
+const ERR_INTEGER_ALLOCATOR_SETUP_ERROR			= -115;
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+enum TSoliticationMode {
+	SM_SEND_NEVER								= -1,				
+	SM_SEND_IN_RESPONSE_TO_SOLICITATION_ONLY	= 0,
+	SM_SEND_REGULAR								= 1
+};
+
+struct TStartupInfo {
+	int iBaseInterfaceIndex;
+	int iNetworkMask;
+	int iStartHostAddressRange;
+	int iStopHostAddressRange;
+};
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+
+struct TOptionDesc {
+	int	 iAgentID;
+	char iOptionFilename[X_MAXOPTIONTOKENSIZE];
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+
+struct TGetTunnelRequest {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+
+struct TStartAgentRequest {
+	int iAgentID;
+	char iLowerInterface[X_MAXINTERFACENAMESIZE];
+	TSoliticationMode iSolicitationMode;
+	int iSolicitationInterval;
+};
+
+struct TFaStatusInfo {
+  TResult iCallResult;
+  int iTunnelCount;
+  int iPendingRegistrationRequests;
+  int iRequestsRejected;
+  int iRequestsAccepted;
+  int iReplysAccepted;
+  int iReplysRejected;
+  int iDiscardedUnknownExtension;
+  int iDiscardedMalformed;
+  int iDiscardedVendor;
+  int iAdvertisementsSent;
+};
+
+struct TFaTunnelID {
+	int iAgentID;
+	int iMobileNodeAddress;
+	int iHomeAgentAddress;
+	int iID;
+};
+
+struct TFaTunnelInfo {
+  TResult iCallResult;
+  unsigned int iMobileNodeAddress;
+  unsigned int iCareofAddress;
+  unsigned int iHomeAgentAddress;
+  int iPrivateHomeAgentID;
+  int iCreationTime;
+  int iExpirationTime;
+  int iRefreshTime;
+  int iLastTimestamp;
+  int iSPI;
+  int iTimeout;
+};
+
+typedef TFaTunnelID TFaTunnelList<>;
+
+
+/*******************************************************************************
+ *
+ * FACONTROLLER Interface
+ *
+ ******************************************************************************/
+program FACONTROLLER {
+	version FACONTROLLER_VERSION {
+
+		/* Standard Service Management */
+		int SS_STARTUPRPCSERVICE( TStartupInfo )						= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )								= 2;
+		TComponentList LIST_DEVICES( void )								= 30;
+
+		/* Create instances */
+		TResult CSTR_CREATEAGENT( void )								= 31;
+		int DSTR_REMOVEAGENT( int )										= 32;
+
+		/* Start and stop the mobile agent */
+		TResult STARTMOBILEAGENT( TStartAgentRequest )					= 3;
+		TResult STOPMOBILEAGENT( int )									= 4;
+		TResult GETMOBILEAGENTSTATUS( int )								= 5;
+
+		/* Configure the agent -- must be called before starting the agent */
+		TResult SETSINGLEOPTION( TOptionDesc )							= 6;
+		TResult REMOVESINGLEOPTION( TOptionDesc )						= 33;
+		TResult ADDLISTOPTION( TOptionDesc )							= 7;
+		TResult REMOVELISTOPTION( TOptionDesc )							= 8;
+
+		/* Runtime commands */
+		TFaStatusInfo GETSTATUS( int )									= 9;
+		TResult DESTROYTUNNELID( TFaTunnelID )							= 11;
+		TFaTunnelList LISTTUNNELS( int )								= 12;
+		TFaTunnelInfo GETTUNNELINFO( TGetTunnelRequest )				= 15;	
+
+		/* Set the timeout for all dynamic commands */
+		void SETTIMEOUT( TTimeoutRequest )								= 13;
+	} = 7;
+} = 0x34630207;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/facontroller_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,214 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "facontroller.h"
+
+static void facontroller_7();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+	(void)pmap_unset(FACONTROLLER, FACONTROLLER_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, FACONTROLLER, FACONTROLLER_VERSION, facontroller_7, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (FACONTROLLER, FACONTROLLER_VERSION, udp).\n");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, FACONTROLLER, FACONTROLLER_VERSION, facontroller_7, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (FACONTROLLER, FACONTROLLER_VERSION, tcp).\n");
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+	exit(1);
+}
+
+static void
+facontroller_7(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		TStartupInfo ss_startuprpcservice_7_arg;
+		int sc_shutdownrpcservice_7_arg;
+		int dstr_removeagent_7_arg;
+		TStartAgentRequest startmobileagent_7_arg;
+		int stopmobileagent_7_arg;
+		int getmobileagentstatus_7_arg;
+		TOptionDesc setsingleoption_7_arg;
+		TOptionDesc removesingleoption_7_arg;
+		TOptionDesc addlistoption_7_arg;
+		TOptionDesc removelistoption_7_arg;
+		int getstatus_7_arg;
+		TFaTunnelID destroytunnelid_7_arg;
+		int listtunnels_7_arg;
+		TGetTunnelRequest gettunnelinfo_7_arg;
+		TTimeoutRequest settimeout_7_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_facontroller_TStartupInfo;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_7;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_7;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_facontroller_TComponentList;
+		local = (char *(*)()) list_devices_7;
+		break;
+
+	case CSTR_CREATEAGENT:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) cstr_createagent_7;
+		break;
+
+	case DSTR_REMOVEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) dstr_removeagent_7;
+		break;
+
+	case STARTMOBILEAGENT:
+		xdr_argument = xdr_facontroller_TStartAgentRequest;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) startmobileagent_7;
+		break;
+
+	case STOPMOBILEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) stopmobileagent_7;
+		break;
+
+	case GETMOBILEAGENTSTATUS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) getmobileagentstatus_7;
+		break;
+
+	case SETSINGLEOPTION:
+		xdr_argument = xdr_facontroller_TOptionDesc;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) setsingleoption_7;
+		break;
+
+	case REMOVESINGLEOPTION:
+		xdr_argument = xdr_facontroller_TOptionDesc;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) removesingleoption_7;
+		break;
+
+	case ADDLISTOPTION:
+		xdr_argument = xdr_facontroller_TOptionDesc;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) addlistoption_7;
+		break;
+
+	case REMOVELISTOPTION:
+		xdr_argument = xdr_facontroller_TOptionDesc;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) removelistoption_7;
+		break;
+
+	case GETSTATUS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_facontroller_TFaStatusInfo;
+		local = (char *(*)()) getstatus_7;
+		break;
+
+	case DESTROYTUNNELID:
+		xdr_argument = xdr_facontroller_TFaTunnelID;
+		xdr_result = xdr_facontroller_TResult;
+		local = (char *(*)()) destroytunnelid_7;
+		break;
+
+	case LISTTUNNELS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_facontroller_TFaTunnelList;
+		local = (char *(*)()) listtunnels_7;
+		break;
+
+	case GETTUNNELINFO:
+		xdr_argument = xdr_facontroller_TGetTunnelRequest;
+		xdr_result = xdr_facontroller_TFaTunnelInfo;
+		local = (char *(*)()) gettunnelinfo_7;
+		break;
+
+	case SETTIMEOUT:
+		xdr_argument = xdr_facontroller_TTimeoutRequest;
+		xdr_result = xdr_void;
+		local = (char *(*)()) settimeout_7;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+		exit(1);
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/facontroller_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,787 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Fri Nov 07 13:08:01 2003
+* System Includes
+*
+*/
+
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcFacontroller.h"
+#include "CSFacontroller.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSFacontroller> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_7( TStartupInfo *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSFacontroller>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcFacontroller::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_7( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcFacontroller::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_7( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+TResult *cstr_createagent_7( void *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// create a new component instance
+	instance_key = iComponentManager->CreateInstance();
+	if( instance_key < 0 ) {
+		CSvcFacontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, instance_key );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->cstr_createagent();
+	result = CSvcFacontroller::GetError( CSTR_CREATEAGENT, (void*)&rv );
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	if( result != ERR_NONE ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == 0 );
+	} else { 
+		CSvcFacontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, instance_key );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+int *dstr_removeagent_7( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	int should_delete = 1;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( DSTR_REMOVEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		rv = instance_key;
+		return &rv;
+	}
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->dstr_removeagent( *aArgs, &should_delete );
+
+	result = rv;
+
+	// it is illegal for the method to succeed but not delete the instance
+	assert( (result != ERR_NONE) || (should_delete == 1) );
+
+	// delete the instance if requested
+	if( should_delete != 0 ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == ERR_NONE );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+TResult *startmobileagent_7( TStartAgentRequest *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( STARTMOBILEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->startmobileagent( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+TResult *stopmobileagent_7( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( STOPMOBILEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->stopmobileagent( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+TResult *getmobileagentstatus_7( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( GETMOBILEAGENTSTATUS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getmobileagentstatus( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+TResult *setsingleoption_7( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( SETSINGLEOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->setsingleoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+TResult *removesingleoption_7( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( REMOVESINGLEOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->removesingleoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+TResult *addlistoption_7( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( ADDLISTOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->addlistoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+TResult *removelistoption_7( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( REMOVELISTOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->removelistoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+TFaStatusInfo *getstatus_7( int *aArgs, CLIENT *aDutout )
+{
+	static TFaStatusInfo rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( GETSTATUS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( GETSTATUS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( GETSTATUS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( GETSTATUS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getstatus( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: destroytunnelid
+ * 
+ ***************************************************************************************/
+TResult *destroytunnelid_7( TFaTunnelID *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( DESTROYTUNNELID, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( DESTROYTUNNELID, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( DESTROYTUNNELID, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( DESTROYTUNNELID, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->destroytunnelid( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listtunnels
+ * 
+ ***************************************************************************************/
+TFaTunnelList *listtunnels_7( int *aArgs, CLIENT *aDutout )
+{
+	static TFaTunnelList rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( LISTTUNNELS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( LISTTUNNELS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( LISTTUNNELS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( LISTTUNNELS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->listtunnels( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: gettunnelinfo
+ * 
+ ***************************************************************************************/
+TFaTunnelInfo *gettunnelinfo_7( TGetTunnelRequest *aArgs, CLIENT *aDutout )
+{
+	static TFaTunnelInfo rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcFacontroller::SetError( GETTUNNELINFO, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcFacontroller::SetError( GETTUNNELINFO, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( GETTUNNELINFO, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcFacontroller::SetError( GETTUNNELINFO, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->gettunnelinfo( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+void *settimeout_7( TTimeoutRequest *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_key;
+	CSFacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// set the return value to generic error
+	rv = ERR_FAILED_TO_RETRIEVE_KEY;
+
+	// get the key for the instance from the args
+	instance_key = CSvcFacontroller::GetInstanceKeyFromArgs( SETTIMEOUT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = ERR_NONE;
+	session->settimeout( *aArgs );
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/facontroller/facontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,308 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+
+#include <rpc/rpc.h>
+#include "facontroller.h"
+
+
+bool_t
+xdr_facontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TSoliticationMode(xdrs, objp)
+	XDR *xdrs;
+	TSoliticationMode *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceIndex)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iNetworkMask)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iStartHostAddressRange)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iStopHostAddressRange)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iServiceResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSubComponentResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData0)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData1)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TOptionDesc(xdrs, objp)
+	XDR *xdrs;
+	TOptionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionFilename, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionToken, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionValue, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockStart, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockEnd, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TTimeoutRequest(xdrs, objp)
+	XDR *xdrs;
+	TTimeoutRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TGetTunnelRequest(xdrs, objp)
+	XDR *xdrs;
+	TGetTunnelRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TStartAgentRequest(xdrs, objp)
+	XDR *xdrs;
+	TStartAgentRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iLowerInterface, X_MAXINTERFACENAMESIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_facontroller_TSoliticationMode(xdrs, &objp->iSolicitationMode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSolicitationInterval)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaStatusInfo(xdrs, objp)
+	XDR *xdrs;
+	TFaStatusInfo *objp;
+{
+	if (!xdr_facontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelCount)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPendingRegistrationRequests)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsRejected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsAccepted)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iReplysAccepted)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iReplysRejected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedUnknownExtension)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedMalformed)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedVendor)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iAdvertisementsSent)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaTunnelID(xdrs, objp)
+	XDR *xdrs;
+	TFaTunnelID *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaTunnelInfo(xdrs, objp)
+	XDR *xdrs;
+	TFaTunnelInfo *objp;
+{
+	if (!xdr_facontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iCareofAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPrivateHomeAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCreationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExpirationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRefreshTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLastTimestamp)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSPI)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_facontroller_TFaTunnelList(xdrs, objp)
+	XDR *xdrs;
+	TFaTunnelList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TFaTunnelList_val, (u_int *)&objp->TFaTunnelList_len, ~0, sizeof(TFaTunnelID), (void*)xdr_facontroller_TFaTunnelID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/CNetworkPartitionManager.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,254 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CNetworkPartitionManager
+* System Includes
+*
+*/
+
+
+
+
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <netinet/in.h>
+#endif
+#include <assert.h>
+#include <math.h>
+
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "CNetworkPartitionManager.h"
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: CNetworkPartitionManager
+ *
+ ******************************************************************************/
+CNetworkPartitionManager::CNetworkPartitionManager()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: ~CNetworkPartitionManager
+ *
+ ******************************************************************************/
+CNetworkPartitionManager::~CNetworkPartitionManager()
+{
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: SetConfiguration
+ *
+ ******************************************************************************/
+int CNetworkPartitionManager::SetConfiguration( int aBaseNetworkAddress, int aBaseNetworkBitCount, int aSegmentSize )
+{
+	int err;
+	int i;
+
+	// check the params
+	assert( aBaseNetworkBitCount > 0 );
+	assert( aBaseNetworkBitCount <= 31 );
+	assert( aSegmentSize > 0 );
+
+	// check that the chunk size is a power of two
+	err = IsPowerOfTwo( aSegmentSize );
+	if( err == 0 ) {
+		return -1;
+	}
+
+	// calculate the number of bits for each part
+	iBaseNetworkPartBitcount = aBaseNetworkBitCount;
+	iHostPartBitcount = log2( aSegmentSize );
+	iSegmentPartBitcount = 32 - iBaseNetworkPartBitcount - iHostPartBitcount;
+	if( iSegmentPartBitcount < 1 ) {
+		return -1;
+	}
+	iSegmentCount = 1<<iSegmentPartBitcount;
+
+	// create the useful netmasks
+	iBaseNetworkNetmask = NetmaskFromBitcount( iBaseNetworkPartBitcount );
+	iCompleteSegmentNetmask = NetmaskFromBitcount( 32 - iHostPartBitcount );
+
+	// save the other info
+	iBaseNetworkAddress = htonl((ntohl(aBaseNetworkAddress) & iBaseNetworkNetmask));
+	iSegmentSize = aSegmentSize;
+
+	// now create the list of all available segments
+	err = iAddressAllocator.AddToIntegerPool( 0, iSegmentCount-1 );
+	if( err == -1 ) {
+		return -1;
+	}
+
+	// create a mask for the segment bits in position
+	for( iSegmentMask = 0, i = 0; i < iSegmentPartBitcount; i++ ) {
+	  iSegmentMask |= 1<<(iHostPartBitcount + i);
+	}
+
+
+	// done
+	return 0;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: AllocateNetworkChunk
+ *
+ ******************************************************************************/
+int CNetworkPartitionManager::AllocateNetworkSegment( int *aNetmaskBitcount, int *aSegmentSize )
+{
+	int segment_number, complete_address, shifted_segment_number;
+
+	// check
+	assert( aSegmentSize != NULL );
+
+	// allocate a segment number
+	segment_number = iAddressAllocator.AllocateInteger();
+	if( segment_number == -1 ) {
+	  return -1;
+	}
+	
+
+	// make a complete address for the segment number
+	complete_address = ntohl( iBaseNetworkAddress );
+	shifted_segment_number = (segment_number << iHostPartBitcount) & (iSegmentMask);
+	complete_address |= shifted_segment_number;
+
+
+	// set the return values
+	complete_address = htonl( complete_address );
+	*aNetmaskBitcount = iBaseNetworkPartBitcount + iSegmentPartBitcount;
+	*aSegmentSize = iSegmentSize;
+	assert( (*aNetmaskBitcount + log2(*aSegmentSize)) == 32 );
+
+	// done
+	return complete_address;
+}
+
+
+/*******************************************************************************
+ *
+ * PUBLIC METHOD: FreeNetworkChunk
+ *
+ ******************************************************************************/
+int CNetworkPartitionManager::FreeNetworkSegment( int aSegmentBaseAddress )
+{
+	int i, err;
+	int segment_number;
+	int lower_bits_segment_mask;
+
+	// create a mask for the segment bits in the lower part of the work
+	for( lower_bits_segment_mask = 0, i = 0; i < iSegmentPartBitcount; i++ ) {
+		lower_bits_segment_mask |= 1<<i;
+	}
+
+	// extract the segment number
+	segment_number = ntohl( aSegmentBaseAddress );
+	segment_number = segment_number >> iHostPartBitcount;
+	segment_number &= lower_bits_segment_mask;
+
+	// make sure this number is in the expected range
+	assert( (segment_number >= 0) && (segment_number < iSegmentCount) );
+
+	// free the segment - this will assert that there are no duplicates
+	err = iAddressAllocator.FreeInteger( segment_number );
+	assert( err == 0 );
+
+	// done
+	return 0;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE: log2
+ * 
+ ***************************************************************************************/
+int CNetworkPartitionManager::log2( int aValue )
+{
+	double base;
+	double value;
+	double simple_result, integer_result;
+	int rv;
+
+	// if the value is less than zero then we have an error which I want to catch NOW
+	assert( aValue >= 0 );
+	
+	// if the value is zero then - this is also an error?
+	assert( aValue > 0 );
+
+	// calculate the logarithm using doubles (we have to) and convert back to integer
+	base = 2;
+	value = (double)aValue;
+	simple_result = log(value) / log(base);
+	integer_result = ceil(simple_result);
+	rv = (int)integer_result;
+
+	// since this is not very nice (the need for ceil) I verify the result
+	if( (1<<rv) != aValue ) {
+	  fprintf( stderr, "CRITICAL ERROR: log2() made an incorrect calculation - log2(%d) => %d (%g,%g,%g,%g).\n", aValue, rv, base, value, 
+		   simple_result, integer_result );
+	}
+	assert( (1<<rv) == aValue );
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE: IsPowerOfTwo
+ * 
+ ***************************************************************************************/
+int CNetworkPartitionManager::IsPowerOfTwo( int aValue )
+{
+	int bit_count = 0, i;
+	
+	// check how many bits are set
+	for( i = 0; i < 32; i++ ) {
+		if( (aValue & 0x1) != 0 ) {
+			bit_count++;
+		}
+	}
+
+	// if more than one bit is set then this number is not a power of two
+	return ((bit_count > 1) ? 0 : 1);
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE: NetmaskFromBitcount
+ * 
+ ***************************************************************************************/
+int CNetworkPartitionManager::NetmaskFromBitcount( int aBitCount )
+{
+	int i, netmask = 0;
+	for( netmask = 0, i = 0; i < aBitCount; i++ ) {
+	    netmask |= 1<<(31-i);
+	}
+	return netmask;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/CNetworkPartitionManager.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* CNetworkPartitionManager
+*
+*/
+
+
+
+
+#ifndef __CNETWORKPARTITIONMANAGER_H__
+#define __CNETWORKPARTITIONMANAGER_H__
+
+/*******************************************************************************
+ *
+ * System Includes
+ *
+ ******************************************************************************/
+#include <string>
+using namespace std;
+
+/*******************************************************************************
+ *
+ * Local Includes
+ *
+ ******************************************************************************/
+#include "../IntegerAllocatorLibrary/CIntegerAllocator.h"
+
+
+/*******************************************************************************
+ *
+ * Definitions
+ *
+ ******************************************************************************/
+class CNetworkPartitionManager
+{
+public:
+	CNetworkPartitionManager();
+	~CNetworkPartitionManager();
+
+	int SetConfiguration( int aBaseNetworkAddress, int aBaseNetworkBitCount, int aSegmentSize  );
+	int AllocateNetworkSegment( int *aNetmaskBitcount, int *aSegmentSize );
+	int FreeNetworkSegment( int aSegmentBaseAddress );
+
+private:
+	int log2( int aValue );
+	int IsPowerOfTwo( int aValue );
+	int NetmaskFromBitcount( int aBitCount );
+
+	int iBaseNetworkPartBitcount, iSegmentPartBitcount, iHostPartBitcount; 
+	int iBaseNetworkNetmask, iCompleteSegmentNetmask, iSegmentMask;
+	int iBaseNetworkAddress;
+	int iSegmentSize, iSegmentCount;
+	CIntegerAllocator iAddressAllocator;
+};
+
+#endif //__CNETWORKPARTITIONMANAGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/CSHacontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,959 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Oct 10 17:55:34 2003
+* Switches Includes
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <signal.h>
+#ifndef WIN32
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#else
+#include <winsock2.h>
+#endif
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHacontroller.h"
+#include "CSHacontroller.h"
+#include "../IntegerAllocatorLibrary/CIntegerAllocator.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition
+ * 
+ ***************************************************************************************/
+#define TEMPLATE_HA_CONFIG_FILE			"dynhad.template.conf"
+#define MOBILE_AGENT_COMMAND_LINE		"./dynhad --fg --debug --config "
+#define MAXCOMMANDLINELENGTH			(31 + 256 + 1)
+#define MAXTUNNELS                              32
+#define MAXINTERFACECONFIGENTRY			(IFNAMSIZ + 128)
+
+
+/****************************************************************************************
+ * 
+ * Macro Functions
+ * 
+ ***************************************************************************************/
+#ifdef WIN32
+#define API_SUCCESS                             (0)
+#define dynamics_ha_init(a)			(API_SUCCESS)
+#define dynamics_ha_get_status(a,b)		(API_SUCCESS)
+#define dynamics_ha_get_tunnels(a,b,c)		(API_SUCCESS)
+#define dynamics_ha_get_tunnel_info(a,b,c)	(API_SUCCESS)
+#define dynamics_ha_destroy_tunnel(a,b)		(API_SUCCESS)
+#define dynamics_ha_enable_mobile(a,b,c)	(API_SUCCESS)
+#define dynamics_ha_get_care_of_addr(a,b,c)	(API_SUCCESS)
+#endif
+
+ 
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSHacontroller::CSHacontroller()
+{
+	iDynamicsCallTimeout = -1;
+	iAliasHostAddress = iAliasInterfaceIndex = 0;
+	iAgentProcess = NULL;
+}
+
+CSHacontroller::~CSHacontroller()
+{
+	assert( iAgentProcess == NULL );
+}
+
+int CSHacontroller::GetKey()
+{
+	return iKey;
+}
+
+void CSHacontroller::SetKey( int aKey )
+{
+	iKey = aKey;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::cstr_createagent( void )
+{
+	TResult rv;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// create the virtual network
+	rv = CreateVirtualNetwork();
+	if( rv.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// create the interface alias
+	rv = CreateAliasInterface();
+	if( rv.iServiceResult != ERR_NONE ) {
+		RemoveVirtualNetwork();
+		return rv;
+	}
+
+	// create the dynamics config file
+	rv = CreateDynamicsConfigFile();
+	if( rv.iServiceResult != ERR_NONE ) {
+		RemoveVirtualNetwork();
+		RemoveAliasInterface();
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::dstr_removeagent( int aArgs, int *aDeleteInstance )
+{
+	TResult rv, rv_config, rv_interface, rv_vn;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the proces isn't running
+	if( iAgentProcess != NULL ) {
+	  *aDeleteInstance = 0;
+	  rv.iServiceResult = ERR_INVALIDSTATE;
+	  return rv;
+	}
+
+	// cleanup the virtual network
+	rv_vn = RemoveVirtualNetwork();
+
+	// cleanup the dynamics config file
+	rv_config = RemoveDynamicsConfigFile();
+	
+	// cleanup the alias interface 
+	rv_interface = RemoveAliasInterface();
+
+	// check for errors
+	if( rv_vn.iServiceResult != ERR_NONE ) {
+		return rv_vn;
+	}
+	if( rv_config.iServiceResult != ERR_NONE ) {
+		return rv_config;
+	}
+	if( rv_interface.iServiceResult != ERR_NONE ) {
+		return rv_interface;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::startmobileagent( int aArgs )
+{
+	TResult rv;
+	int errcode;
+	TCAProcessError perr;
+	char command_line_str[MAXCOMMANDLINELENGTH];
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that there is currently no process
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		rv.iSubComponentResult = 0;
+		rv.iData0 = 0;
+		return rv;
+	}
+
+	// create the new process object
+	iAgentProcess = new CAProcess();
+	assert( iAgentProcess != NULL );
+
+	// construct the command line
+	snprintf( command_line_str, MAXCOMMANDLINELENGTH, "%s%s", MOBILE_AGENT_COMMAND_LINE, iDynamicsConfigFile.GetLocalFilename() );
+
+	// start the actual process
+	perr = iAgentProcess->StartProcess( command_line_str, &errcode, false, false, false ); 
+	if( perr != CAE_NONE ) {
+		rv.iServiceResult = ERR_START_PROCESS_ERROR;
+		rv.iSubComponentResult = (int)perr;
+		rv.iData0 = errcode;
+		delete iAgentProcess;
+		iAgentProcess = NULL;
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::stopmobileagent( int aArgs )
+{
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+	
+	// if the process isn't started then invalid state
+	if( iAgentProcess == NULL ) {
+	  rv.iServiceResult = ERR_INVALIDSTATE;
+	  return rv;
+	}
+
+	// if the process isn't running then it has died outside the scope of this controller, clean up the state, return an error since
+	// this is noteworthy and should be either expected or not happen.
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+	  assert( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) );
+	  delete iAgentProcess;
+	  iAgentProcess = NULL;
+	  rv.iServiceResult = ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE;
+	  return rv;
+	}
+
+	// request the process to stop
+	perr = iAgentProcess->RequestStop( SIGTERM );
+	if( perr != CAE_NONE ) {
+	  rv.iServiceResult = ERR_STOP_PROCESS_ERROR;
+	  rv.iSubComponentResult = (int)perr;
+	  return rv;
+	}
+
+	// wait for the process to stop
+	perr = iAgentProcess->WaitForProcessToTerminate( -1 );
+	if( perr != CAE_NONE ) {
+	  rv.iServiceResult = ERR_WAIT_PROCESS_ERROR;
+	  rv.iSubComponentResult = (int)perr;
+	  return rv;
+	}
+
+	// remove the process
+	delete iAgentProcess;
+	iAgentProcess = NULL;
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::getmobileagentstatus( int aArgs )
+{
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// if the process doesn't exist then we return PS_INVALID
+	if( iAgentProcess == NULL ) {
+		rv.iData0 = PS_INVALID;
+		return rv;
+	}
+
+	// otherwise just return whatever iAgentProcess->GetProcessStatus() returns
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	rv.iData0 = (int)pstatus;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::setsingleoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.SetSingleOption( aArgs.iOptionToken, aArgs.iOptionValue, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::removesingleoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.RemoveSingleOption( aArgs.iOptionToken, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::addlistoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.AddListOption( aArgs.iOptionBlockStart, aArgs.iOptionBlockEnd, aArgs.iOptionValue, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::removelistoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the result
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		rv.iSubComponentResult = 0;
+		rv.iData0 = 0;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.RemoveListOption( aArgs.iOptionBlockStart, aArgs.iOptionBlockEnd, aArgs.iOptionToken, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+THaStatus CSHacontroller::getstatus( int aArgs )
+{
+	TResult res;
+	THaStatus rv;
+	TDynamicsCallInfo cres;
+	THomeAgentStatusInfo home_agent_info;
+
+	// init the return value
+	memset( &rv, 0, sizeof(rv) );
+	rv.iCallResult.iServiceResult = ERR_NONE;
+	
+	// add the info about the virtual network
+	rv.iHomeAgentAddress = inet_addr( iAliasInterfaceAddress.c_str() );
+	rv.iVirtualNetworkStartAddress = iVirtualNetworkSegmentAddress;
+	rv.iVirtualNetworkSize = iVirtualNetworkSegmentSize;
+
+	// if the agent is not running then we are done
+	res = is_agent_running();
+	if( res.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.HomeAgentGetStatus( &home_agent_info );
+	if( cres.iResult != DC_SUCCESS ) {
+		set_dynamics_error( &(rv.iCallResult), &cres );
+		return rv;
+	}
+
+	// set the result
+	rv.iAdvertisementsSent = home_agent_info.iAdvertisementsSent;
+	rv.iDiscardedMalformed = home_agent_info.iDiscardedMalformed;
+	rv.iDiscardedUnknownExtension = home_agent_info.iDiscardedUnknownExtension;
+	rv.iDiscardedVendor = home_agent_info.iDiscardedVendor;
+	rv.iRequestsAccepted = home_agent_info.iRequestsAccepted;
+	rv.iRequestsRejected = home_agent_info.iRequestsRejected;
+	rv.iTunnelCount = home_agent_info.iTunnelCount;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: destroytunnelid
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::destroytunnelid( THaTunnelID aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+
+	// init the return value
+	memset( &rv, 0, sizeof(rv) );
+	rv.iServiceResult = ERR_NONE;
+	
+	// check that the agent is running
+	rv = is_agent_running();
+	if( rv.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.HomeAgentDestroyTunnel( aArgs.iMobileNodeAddress );
+	if( cres.iResult != DC_SUCCESS ) {
+		set_dynamics_error( &rv, &cres );
+		return rv;
+	}
+
+	// done 
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listtunnels
+ * 
+ ***************************************************************************************/
+THaTunnelList CSHacontroller::listtunnels( int aArgs )
+{
+	TResult res;
+	THaTunnelList rv = { 0, NULL };
+	TDynamicsCallInfo cres;
+	unsigned int tunnel_list[MAXTUNNELS];
+	int tunnel_count = MAXTUNNELS, i;
+
+	// check that the agent is running
+	res = is_agent_running();
+	if( res.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.HomeAgentGetTunnels( &tunnel_count, tunnel_list );
+	if( cres.iResult != DC_SUCCESS ) {
+		return rv;
+	}
+
+	// allocate memory for the list
+	rv.THaTunnelList_len = tunnel_count;
+	rv.THaTunnelList_val = (THaTunnelID*)calloc( tunnel_count, sizeof(THaTunnelID) );
+	assert( rv.THaTunnelList_val != NULL );
+
+	// now return the information
+	for( i = 0; i < tunnel_count; i++ ) {
+		(rv.THaTunnelList_val)[i].iAgentID = 0;
+		(rv.THaTunnelList_val)[i].iMobileNodeAddress = tunnel_list[i];
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: gettunnelinfo
+ * 
+ ***************************************************************************************/
+THaTunnelInfo CSHacontroller::gettunnelinfo( TGetTunnelRequest aArgs )
+{
+	THaTunnelInfo rv;
+	TDynamicsCallInfo cres;
+	THomeAgentTunnelInfo hati;
+
+	// init the result
+	memset( &rv, 0, sizeof(rv) );
+	rv.iCallResult.iServiceResult = ERR_NONE;
+
+	// check that the agent is running
+	rv.iCallResult = is_agent_running();
+	if( rv.iCallResult.iServiceResult != ERR_NONE ) {
+		return rv;
+	}
+
+	// make the call to dynamics
+	cres = iDynamicsCommand.HomeAgentGetTunnelInfo( aArgs.iMobileNodeAddress, &hati );
+	if( cres.iResult != DC_SUCCESS ) {
+		set_dynamics_error( &(rv.iCallResult), &cres );
+		return rv;
+	}
+
+	// set the info
+	rv.iCareofAddress = hati.iCareofAddress;
+	rv.iCreationTime = hati.iCreationTime;
+	rv.iExpirationTime = hati.iExpirationTime;
+	rv.iHomeAgentAddress = hati.iHomeAgentAddress;
+	rv.iLastTimestamp = hati.iLastTimestamp;
+	rv.iMobileNodeAddress = hati.iMobileNodeAddress;
+	rv.iRefreshTime = hati.iRefreshTime;
+	rv.iSPI = hati.iSPI;
+	rv.iTimeout = hati.iTimeout;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+void CSHacontroller::settimeout( TTimeoutRequest aArgs )
+{
+	iDynamicsCallTimeout = aArgs.iTimeout;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: CreateDynamicsConfigFile
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::CreateDynamicsConfigFile()
+{
+	TResult rv;
+	int errcode;
+	TDCFError config_file_error;
+	char dynamics_config[MAXINTERFACECONFIGENTRY];
+	struct in_addr iaddr;
+	TStartupInfo startupinfo;
+
+	// initialise the rv - always be optimistic!
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+
+	// set the reference file
+	config_file_error = iDynamicsConfigFile.SetReferenceFile( TEMPLATE_HA_CONFIG_FILE );
+	if( config_file_error != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)config_file_error;
+		return rv;
+	}
+
+	// create a local copy
+	config_file_error = iDynamicsConfigFile.CreateLocalCopy( &errcode );
+	if( config_file_error != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)config_file_error;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// get the startup info
+	startupinfo = CSvcHacontroller::GetStartupInfo();
+
+	// add the listen interface
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "eth%d:%d 0 1 30", startupinfo.iBaseInterfaceIndex, iAliasInterfaceIndex );
+	config_file_error = iDynamicsConfigFile.AddListOption( "INTERFACES_BEGIN", "INTERFACES_END", dynamics_config, &errcode );
+	if( config_file_error != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)config_file_error;
+		rv.iData0 = errcode;
+		iDynamicsConfigFile.RemoveLocalCopy( &errcode );
+		return rv;
+	}
+
+	// add the home network addresses to the authorized list
+	iaddr.ADDRESS_INTEGER = iVirtualNetworkSegmentAddress;
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "1000 %s/%d", inet_ntoa(iaddr), iVirtualNetworkSegmentNetmaskBitcount );
+	config_file_error = iDynamicsConfigFile.AddListOption( "AUTHORIZEDLIST_BEGIN", "AUTHORIZEDLIST_END", dynamics_config, &errcode );
+	if( config_file_error != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)config_file_error;
+		rv.iData0 = errcode;
+		iDynamicsConfigFile.RemoveLocalCopy( &errcode );
+		return rv;
+	}
+	
+	// done
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: RemoveDynamicsConfigFile
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::RemoveDynamicsConfigFile()
+{
+	TResult rv;
+	TDCFError terr;
+	int errcode;
+
+	// initialise the rv - always be optimistic!
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+
+	// clean up the config file
+	terr = iDynamicsConfigFile.RemoveLocalCopy( &errcode );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// done
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: CreateAliasInterface
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::CreateAliasInterface()
+{
+	TResult rv;
+	int errcode;
+	CIntegerAllocator *alias_host_address_allocator;
+	TStartupInfo startup_info;
+	TInterfaceAliasError interface_alias_error;
+
+	// initialise the rv - always be optimistic!
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+
+	// get the host address allocator
+	alias_host_address_allocator = CSvcHacontroller::GetAliasHostAddressAllocator();
+
+	// get a host address
+	assert( alias_host_address_allocator != NULL );
+	iAliasHostAddress = alias_host_address_allocator->AllocateInteger();
+	if( iAliasHostAddress == -1 ) {
+		rv.iServiceResult = ERR_NO_MORE_INTERFACES;
+		return rv;
+	}
+//	fprintf( stderr, "DEBUG: iAliasHostAddress = %d\n", iAliasHostAddress );
+
+	// get the startup info
+	startup_info = CSvcHacontroller::GetStartupInfo();
+
+	// create an alias
+	interface_alias_error = iAgentInterface.CreateNewInterfaceAlias( startup_info.iBaseInterfaceIndex, 
+									 startup_info.iBaseInterfaceNetworkMask, 
+									 iAliasHostAddress, &iAliasInterfaceIndex, &errcode );
+	if( interface_alias_error != IE_NONE ) {
+	  rv.iServiceResult = ERR_CREATE_INTERFACE_ERROR;
+	  rv.iSubComponentResult = (int)interface_alias_error;
+	  rv.iData0 = errcode;
+	  alias_host_address_allocator->FreeInteger( iAliasHostAddress );
+	  return rv;
+	}
+
+	// get the complete interface address as a string
+	interface_alias_error = iAgentInterface.GetInterfaceAddress( &iAliasInterfaceAddress );
+	assert( interface_alias_error == IE_NONE );
+
+	// done success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: RemoveAliasInterface
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::RemoveAliasInterface()
+{
+	int err, errcode;
+	TResult rv;
+	TInterfaceAliasError interface_alias_error;
+	CIntegerAllocator *alias_host_address_allocator;
+
+	// initialise the rv - always be optimistic!
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	
+	// destroy the interface alias
+	interface_alias_error = iAgentInterface.DestroyInterfaceAlias( &errcode );
+	if( interface_alias_error != IE_NONE ) {
+		rv.iServiceResult = ERR_DESTROY_INTERFACE_ERROR;
+		rv.iSubComponentResult = (int)interface_alias_error;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// get the host address allocator
+	alias_host_address_allocator = CSvcHacontroller::GetAliasHostAddressAllocator();
+
+	// free the host address
+	err = alias_host_address_allocator->FreeInteger( iAliasHostAddress );
+	assert( err == 0 );
+
+	// done
+	iAliasHostAddress = iAliasInterfaceIndex = 0;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: CreateVirtualNetwork
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::CreateVirtualNetwork()
+{
+	TResult rv;
+	int segment_size, err, segment_netmask_bitcount;
+	CNetworkPartitionManager *virtual_network_partition_allocator;
+
+	// init the rv
+	memset( &rv, 0, sizeof(rv) );
+	rv.iServiceResult = ERR_NONE;
+
+	// get the virtual network partition allocator
+	virtual_network_partition_allocator = CSvcHacontroller::GetNetworkPartitionManager();
+	assert( virtual_network_partition_allocator != NULL );
+
+	// get a virtual network partition to use
+	err = virtual_network_partition_allocator->AllocateNetworkSegment( &segment_netmask_bitcount, &segment_size );
+	if( err == -1 ) {
+		rv.iServiceResult = ERR_NO_MORE_VIRTUAL_NETWORKS;
+		return rv;
+	}
+
+	// save this information 
+	iVirtualNetworkSegmentAddress = err;
+	iVirtualNetworkSegmentSize = segment_size;
+	iVirtualNetworkSegmentNetmaskBitcount = segment_netmask_bitcount;
+
+	// done - ok
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: RemoveVirtualNetwork
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::RemoveVirtualNetwork()
+{
+	int err;
+	TResult rv;
+	CNetworkPartitionManager *virtual_network_partition_allocator;
+
+	// init the rv
+	memset( &rv, 0, sizeof(rv) );
+	rv.iServiceResult = ERR_NONE;
+
+	// get the virtual network partition allocator
+	virtual_network_partition_allocator = CSvcHacontroller::GetNetworkPartitionManager();
+	assert( virtual_network_partition_allocator != NULL );
+
+	// free the network address
+	err = virtual_network_partition_allocator->FreeNetworkSegment( iVirtualNetworkSegmentAddress );
+	assert( err == 0 );
+
+	// clear-up the state
+	iVirtualNetworkSegmentAddress = iVirtualNetworkSegmentSize = 0;
+
+	// done 
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: is_agent_running
+ * 
+ ***************************************************************************************/
+TResult CSHacontroller::is_agent_running()
+{	
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// init the rv
+	memset( &rv, 0, sizeof(rv) );
+	rv.iServiceResult = ERR_NONE;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: is_agent_running
+ * 
+ ***************************************************************************************/
+void CSHacontroller::set_dynamics_error( TResult *result, TDynamicsCallInfo *cres )
+{
+	result->iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+	result->iSubComponentResult = cres->iResult;
+	result->iData0 = cres->iErrorCode;
+	result->iData1 = cres->iErrorDetail;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/CSHacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Oct 10 17:55:34 2003
+*
+*/
+
+
+
+
+#ifndef __CSHACONTROLLER_H__
+#define __CSHACONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "../include/standard_unix.h"
+#include "../DynamicsConfigurationLibrary/CDynamicsConfigFile.h"
+#include "../ProcessLibrary/proclib.h"
+#include "../AliasLibrary/CInterfaceAlias.h"
+#include "../IntegerAllocatorLibrary/CIntegerAllocator.h"
+#include "../DynamicsCommandWrapper/CDynamicsCommand.h"
+#include "hacontroller.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSHacontroller
+ * 
+ ***************************************************************************************/
+class CSHacontroller
+{
+public:
+	// Standard Methods
+	CSHacontroller();
+	~CSHacontroller();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+	TResult cstr_createagent( void );
+	TResult dstr_removeagent( int aArgs, int *aDeleteInstance );
+	TResult startmobileagent( int aArgs );
+	TResult stopmobileagent( int aArgs );
+	TResult getmobileagentstatus( int aArgs );
+	TResult setsingleoption( TOptionDesc aArgs );
+	TResult removesingleoption( TOptionDesc aArgs );
+	TResult addlistoption( TOptionDesc aArgs );
+	TResult removelistoption( TOptionDesc aArgs );
+	THaStatus getstatus( int aArgs );
+	TResult destroytunnelid( THaTunnelID aArgs );
+	THaTunnelList listtunnels( int aArgs );
+	THaTunnelInfo gettunnelinfo( TGetTunnelRequest aArgs );
+	void settimeout( TTimeoutRequest aArgs );
+
+private:
+	TResult CreateDynamicsConfigFile();
+	TResult RemoveDynamicsConfigFile();
+	TResult CreateAliasInterface();
+	TResult RemoveAliasInterface();
+	TResult CreateVirtualNetwork();
+	TResult RemoveVirtualNetwork();
+
+	TResult is_agent_running();
+	void set_dynamics_error( TResult *result, TDynamicsCallInfo *cres );
+
+private:
+	int iKey;
+	int iDynamicsCallTimeout;
+	int iAliasHostAddress, iAliasInterfaceIndex;
+	string iAliasInterfaceAddress;
+	int iVirtualNetworkSegmentAddress;
+	int iVirtualNetworkSegmentSize;
+	int iVirtualNetworkSegmentNetmaskBitcount;
+
+	CDynamicsConfigFile iDynamicsConfigFile;
+	CAProcess *iAgentProcess;
+	CInterfaceAlias iAgentInterface;
+	CDynamicsCommand iDynamicsCommand;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/CSvcHacontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,301 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Oct 13 13:43:15 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <math.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHacontroller.h"
+#include "hacontroller.h"
+#include "standard_service_manager.h"
+
+
+/****************************************************************************************
+ * 
+ * Macro Functions
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static TStartupInfo iStartupInfo;
+static CIntegerAllocator *iAliasHostAddressAllocator;
+static CNetworkPartitionManager *iNetworkPartitionManager;
+static CComponentManager<CSHacontroller> *iComponentManager;
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcHacontroller::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	int rv;
+	int *ik_integer;
+	TOptionDesc *ik_option;
+	THaTunnelID *ik_tunnel_id;
+	TTimeoutRequest *ik_timeout;
+	TGetTunnelRequest *ik_tunnel_info;
+
+	switch( aMethod ) {
+	 
+	  // Methods with an integer arg that is the key
+	case DSTR_REMOVEAGENT:
+	case STARTMOBILEAGENT:
+	case STOPMOBILEAGENT:
+	case GETMOBILEAGENTSTATUS:
+	case GETSTATUS:
+	case LISTTUNNELS:
+	  ik_integer = (int*)aArgs;
+	  rv = *ik_integer;
+	  break;
+
+	  // TOptionDesc
+	case SETSINGLEOPTION:
+	case REMOVESINGLEOPTION:
+	case ADDLISTOPTION:
+	case REMOVELISTOPTION:
+	  ik_option = (TOptionDesc*)aArgs;
+	  rv = ik_option->iAgentID;
+	  break;
+	  
+	  // THaTunnelID
+	case DESTROYTUNNELID:
+	  ik_tunnel_id = (THaTunnelID*)aArgs;
+	  rv = ik_tunnel_id->iAgentID;
+	  break;
+
+	  // Timeout
+	case SETTIMEOUT:
+	  ik_timeout = (TTimeoutRequest*)aArgs;
+	  rv = ik_timeout->iAgentID;
+	  break;
+
+	  // TGetTunnelRequest
+	case GETTUNNELINFO:
+		ik_tunnel_info = (TGetTunnelRequest*)aArgs;
+		rv = ik_tunnel_info->iAgentID;
+		break;
+
+	  // Invalid
+	default:
+	  rv = ERR_INVALID_METHOD;
+	  break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcHacontroller::SetError( int aMethod, void *aArgs, int aError )
+{
+  int rv = ERR_NONE;
+  TResult *rv_result;
+  TComponentList *rv_cl;
+  THaStatus *rv_status;
+  THaTunnelList *rv_tunnellist;
+  THaTunnelInfo *rv_tunnel_info;
+
+  switch( aMethod ) {
+    
+    // TComponentList
+  case LIST_DEVICES:
+    SET_LIST_ERROR_CODE( TComponentList, rv_cl );
+    break;
+    
+    // TResult
+  case CSTR_CREATEAGENT:
+  case DSTR_REMOVEAGENT:
+  case STARTMOBILEAGENT:
+  case STOPMOBILEAGENT:
+  case SETSINGLEOPTION:
+  case REMOVESINGLEOPTION:
+  case ADDLISTOPTION:
+  case REMOVELISTOPTION:
+  case DESTROYTUNNELID:
+    SET_ERROR_CODE( TResult, iServiceResult, rv_result );
+    break;
+    
+    // THaStatus
+  case GETSTATUS:
+    SET_ERROR_CODE( THaStatus, iCallResult.iServiceResult, rv_status );
+    break;
+
+    // THaTunnelList
+  case LISTTUNNELS:
+    SET_LIST_ERROR_CODE( THaTunnelList, rv_tunnellist );
+    break;
+
+	// THaTunnelInfo
+  case GETTUNNELINFO:
+	SET_ERROR_CODE( THaTunnelInfo, iCallResult.iServiceResult, rv_tunnel_info );
+	break;
+
+    // Invalid
+  default:
+    rv = ERR_INVALID_METHOD;
+    break;
+  }
+  return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError
+ * 
+ ***************************************************************************************/
+int CSvcHacontroller::GetError( int aMethod, void *aArgs )
+{
+  TResult *result;
+  
+  // check assumption
+  assert( (aMethod == CSTR_CREATEAGENT) || (aMethod == DSTR_REMOVEAGENT) );
+  
+  // return error code
+  result = (TResult*)aArgs;
+  return result->iServiceResult;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcHacontroller::StartRPCService( CComponentManager<CSHacontroller> *aComponentManager, TStartupInfo *aArg )
+{
+	int err;
+
+	// save the startup info
+	iStartupInfo = *((TStartupInfo*)aArg);
+
+	// store the component manager
+	assert( iComponentManager == NULL );
+	iComponentManager = aComponentManager;
+
+	// setup the home address integer allocator
+	iAliasHostAddressAllocator = new CIntegerAllocator();
+	assert( iAliasHostAddressAllocator != NULL );
+	err = iAliasHostAddressAllocator->AddToIntegerPool( iStartupInfo.iBaseInterfaceStartHostAddressRange, 
+							    iStartupInfo.iBaseInterfaceStopHostAddressRange );
+	if( err == -1 ) {
+		delete iAliasHostAddressAllocator;
+		iAliasHostAddressAllocator = NULL;
+	    return ERR_INTEGER_ALLOCATOR_SETUP_ERROR;
+	}
+
+	// setup the network partition manager 
+	iNetworkPartitionManager = new CNetworkPartitionManager();
+	assert( iNetworkPartitionManager != NULL );
+	err = iNetworkPartitionManager->SetConfiguration( iStartupInfo.iVirtualNetworkPrefix, 
+							  iStartupInfo.iVirtualNetworkPrefixMask, 
+							  iStartupInfo.iVirtualNetworkAllocSize );
+	if( err == -1 ) {
+		delete iAliasHostAddressAllocator;
+		iAliasHostAddressAllocator = NULL;
+		delete iNetworkPartitionManager;
+		iNetworkPartitionManager = NULL;
+		return ERR_VIRTUAL_NETWORK_CONFIGURATION_ERROR;
+	}
+
+
+	// done - success	
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcHacontroller::StopRPCService()
+{
+	// delete the host address allocator
+	delete iAliasHostAddressAllocator;
+	iAliasHostAddressAllocator = NULL;
+
+	// delete the subnet address allocator
+	delete iNetworkPartitionManager;
+	iNetworkPartitionManager = NULL;
+
+	// cleanup the component manager (stubs do the deletion)
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetStartupInfo
+ * 
+ ***************************************************************************************/
+TStartupInfo CSvcHacontroller::GetStartupInfo()
+{
+	return iStartupInfo;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetAliasHostAddressAllocator
+ * 
+ ***************************************************************************************/
+CIntegerAllocator *CSvcHacontroller::GetAliasHostAddressAllocator()
+{
+	return iAliasHostAddressAllocator;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetAliasHostAddressAllocator
+ * 
+ ***************************************************************************************/
+CNetworkPartitionManager *CSvcHacontroller::GetNetworkPartitionManager()
+{
+	return iNetworkPartitionManager;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/CSvcHacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Mon Oct 13 13:43:15 2003
+*
+*/
+
+
+
+
+#ifndef __CSVCHACONTROLLER_H__
+#define __CSVCHACONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "hacontroller.h"
+#include "CSHacontroller.h"
+#include "CComponentManager.h"
+#include "../AliasLibrary/CInterfaceAlias.h"
+#include "CNetworkPartitionManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcHacontroller
+ * 
+ ***************************************************************************************/
+class CSvcHacontroller
+{
+public:
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSHacontroller> *aComponentManager, TStartupInfo *aArg );
+	static int StopRPCService();
+
+	// Custom
+	static TStartupInfo GetStartupInfo();
+	static CIntegerAllocator *GetAliasHostAddressAllocator();
+	static CNetworkPartitionManager *GetNetworkPartitionManager();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/HAController.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,231 @@
+# Microsoft Developer Studio Project File - Name="HAController" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=HAController - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "HAController.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "HAController.mak" CFG="HAController - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "HAController - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "HAController - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "HAController"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "HAController - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "HAController - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\External\source_for_build\oncrpc" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libintalloc.lib libdynconf.lib oncrpcms.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ExternalSource\binaries" /libpath:"..\..\BinInternal"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "HAController - Win32 Release"
+# Name "HAController - Win32 Debug"
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hacontroller.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\hacontroller_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hacontroller_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\hacontroller_xdr.c
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSHacontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSHacontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcHacontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcHacontroller.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\DynamicsCommandWrapper\CDynamicsCommand.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\DynamicsConfigurationLibrary\CDynamicsConfigFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\IntegerAllocatorLibrary\CIntegerAllocator.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\AliasLibrary\CInterfaceAlias.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CNetworkPartitionManager.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\ConfigurationFiles\dynhad.ref_template.conf
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\penstd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_service_manager.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_unix.h
+# End Source File
+# End Group
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\DynamicsCommandWrapper\CDynamicsCommand.cpp
+
+!IF  "$(CFG)" == "HAController - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "HAController - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\IntegerAllocatorLibrary\CIntegerAllocator.cpp
+
+!IF  "$(CFG)" == "HAController - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "HAController - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\CNetworkPartitionManager.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\hacontroller.x
+
+!IF  "$(CFG)" == "HAController - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "HAController - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\hacontroller.x
+
+"hacontroller.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BuildTools\rpcgen -server  -component_base -wrapstring hacontroller.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/HAController.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "HAController"=.\HAController.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+include /home/penuser/3GNetworkEmulator/Makefile.conf
+
+TARGET=../../bin/hacontroller
+INCLUDES= -I../include
+OBJECTS=	CSHacontroller.o 		\
+		CSvcHacontroller.o		\
+		hacontroller_svc.o		\
+		hacontroller_svc_stub_impl.o	\
+		hacontroller_xdr.o		\
+		CNetworkPartitionManager.o	
+
+LIBS=-L../../BinInternal/ -lalias -ldynamicsconfig -lintalloc -lproc -ldynwrap
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) ../../BinInternal/libalias.a ../../BinInternal/libdynamicsconfig.a ../../BinInternal/libintalloc.a ../../BinInternal/libproc.a ../../BinInternal/libdynwrap.a
+	g++ $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ dyntmp*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/hacontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,367 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __HACONTROLLER_H__
+#define __HACONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TComponentList(...);
+}
+#else
+bool_t xdr_hacontroller_TComponentList();
+#endif
+
+#define X_MAXOPTIONTOKENSIZE 512
+#define X_MAXINTERFACENAMESIZE 64
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_DYNAMICS_CALL_FAILED -107
+#define ERR_CONFIG_FILE_ERROR -108
+#define ERR_POLICY_OUTPUT_PARSING_FAILED -110
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_NO_MORE_INTERFACES -112
+#define ERR_CREATE_INTERFACE_ERROR -113
+#define ERR_DESTROY_INTERFACE_ERROR -114
+#define ERR_INTEGER_ALLOCATOR_SETUP_ERROR -115
+#define ERR_VIRTUAL_NETWORK_CONFIGURATION_ERROR -116
+#define ERR_NO_MORE_VIRTUAL_NETWORKS -117
+
+struct TStartupInfo {
+	int iBaseInterfaceIndex;
+	int iBaseInterfaceNetworkMask;
+	int iBaseInterfaceStartHostAddressRange;
+	int iBaseInterfaceStopHostAddressRange;
+	int iVirtualNetworkPrefix;
+	int iVirtualNetworkPrefixMask;
+	int iVirtualNetworkAllocSize;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TStartupInfo(...);
+}
+#else
+bool_t xdr_hacontroller_TStartupInfo();
+#endif
+
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TResult(...);
+}
+#else
+bool_t xdr_hacontroller_TResult();
+#endif
+
+
+struct TOptionDesc {
+	int iAgentID;
+	char iOptionFilename[X_MAXOPTIONTOKENSIZE];
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+typedef struct TOptionDesc TOptionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TOptionDesc(...);
+}
+#else
+bool_t xdr_hacontroller_TOptionDesc();
+#endif
+
+
+struct THaStatus {
+	TResult iCallResult;
+	int iTunnelCount;
+	int iRequestsRejected;
+	int iRequestsAccepted;
+	int iDiscardedUnknownExtension;
+	int iDiscardedMalformed;
+	int iDiscardedVendor;
+	int iAdvertisementsSent;
+	int iHomeAgentAddress;
+	int iVirtualNetworkStartAddress;
+	int iVirtualNetworkSize;
+};
+typedef struct THaStatus THaStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaStatus(...);
+}
+#else
+bool_t xdr_hacontroller_THaStatus();
+#endif
+
+
+struct THaTunnelInfo {
+	TResult iCallResult;
+	u_int iMobileNodeAddress;
+	u_int iCareofAddress;
+	u_int iHomeAgentAddress;
+	int iCreationTime;
+	int iExpirationTime;
+	int iRefreshTime;
+	int iLastTimestamp;
+	int iSPI;
+	int iTimeout;
+};
+typedef struct THaTunnelInfo THaTunnelInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaTunnelInfo(...);
+}
+#else
+bool_t xdr_hacontroller_THaTunnelInfo();
+#endif
+
+
+struct THaTunnelID {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+typedef struct THaTunnelID THaTunnelID;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaTunnelID(...);
+}
+#else
+bool_t xdr_hacontroller_THaTunnelID();
+#endif
+
+
+typedef struct {
+	u_int THaTunnelList_len;
+	THaTunnelID *THaTunnelList_val;
+} THaTunnelList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_THaTunnelList(...);
+}
+#else
+bool_t xdr_hacontroller_THaTunnelList();
+#endif
+
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+typedef struct TTimeoutRequest TTimeoutRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TTimeoutRequest(...);
+}
+#else
+bool_t xdr_hacontroller_TTimeoutRequest();
+#endif
+
+
+struct TGetTunnelRequest {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+typedef struct TGetTunnelRequest TGetTunnelRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_hacontroller_TGetTunnelRequest(...);
+}
+#else
+bool_t xdr_hacontroller_TGetTunnelRequest();
+#endif
+
+
+#define HACONTROLLER ((u_long)0x34630208)
+#define HACONTROLLER_VERSION ((u_long)8)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_8( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_8();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_8( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_8();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_8( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_8();
+#endif /* __cplusplus */
+#define CSTR_CREATEAGENT ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_createagent_8( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_createagent_8();
+#endif /* __cplusplus */
+#define DSTR_REMOVEAGENT ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *dstr_removeagent_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *dstr_removeagent_8();
+#endif /* __cplusplus */
+#define STARTMOBILEAGENT ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *startmobileagent_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *startmobileagent_8();
+#endif /* __cplusplus */
+#define STOPMOBILEAGENT ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopmobileagent_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopmobileagent_8();
+#endif /* __cplusplus */
+#define GETMOBILEAGENTSTATUS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getmobileagentstatus_8( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getmobileagentstatus_8();
+#endif /* __cplusplus */
+#define SETSINGLEOPTION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setsingleoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *setsingleoption_8();
+#endif /* __cplusplus */
+#define REMOVESINGLEOPTION ((u_long)33)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removesingleoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removesingleoption_8();
+#endif /* __cplusplus */
+#define ADDLISTOPTION ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *addlistoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *addlistoption_8();
+#endif /* __cplusplus */
+#define REMOVELISTOPTION ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removelistoption_8( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removelistoption_8();
+#endif /* __cplusplus */
+#define GETSTATUS ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern THaStatus *getstatus_8( int * arg, CLIENT *cl );
+}
+#else
+extern THaStatus *getstatus_8();
+#endif /* __cplusplus */
+#define DESTROYTUNNELID ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *destroytunnelid_8( THaTunnelID * arg, CLIENT *cl );
+}
+#else
+extern TResult *destroytunnelid_8();
+#endif /* __cplusplus */
+#define LISTTUNNELS ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern THaTunnelList *listtunnels_8( int * arg, CLIENT *cl );
+}
+#else
+extern THaTunnelList *listtunnels_8();
+#endif /* __cplusplus */
+#define GETTUNNELINFO ((u_long)14)
+#ifdef __cplusplus
+extern "C" {
+extern THaTunnelInfo *gettunnelinfo_8( TGetTunnelRequest * arg, CLIENT *cl );
+}
+#else
+extern THaTunnelInfo *gettunnelinfo_8();
+#endif /* __cplusplus */
+#define SETTIMEOUT ((u_long)13)
+#ifdef __cplusplus
+extern "C" {
+extern void *settimeout_8( TTimeoutRequest * arg, CLIENT *cl );
+}
+#else
+extern void *settimeout_8();
+#endif /* __cplusplus */
+
+#endif /* __HACONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/hacontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+
+/*******************************************************************************
+ *
+ * Constants
+ *
+ ******************************************************************************/
+const X_MAXOPTIONTOKENSIZE				= 512;
+const X_MAXINTERFACENAMESIZE			= 64;
+
+
+/*******************************************************************************
+ *
+ * Error codes
+ *
+ ******************************************************************************/
+const ERR_WAIT_PROCESS_ERROR			= -103;
+const ERR_START_PROCESS_ERROR			= -105;
+const ERR_STOP_PROCESS_ERROR			= -106;
+const ERR_DYNAMICS_CALL_FAILED			= -107;
+const ERR_CONFIG_FILE_ERROR				= -108;
+const ERR_POLICY_OUTPUT_PARSING_FAILED			= -110;
+const ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE		= -111;
+const ERR_NO_MORE_INTERFACES					= -112;
+const ERR_CREATE_INTERFACE_ERROR				= -113;
+const ERR_DESTROY_INTERFACE_ERROR				= -114;
+const ERR_INTEGER_ALLOCATOR_SETUP_ERROR			= -115;
+const ERR_VIRTUAL_NETWORK_CONFIGURATION_ERROR	= -116;
+const ERR_NO_MORE_VIRTUAL_NETWORKS				= -117;
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+struct TStartupInfo {
+	int iBaseInterfaceIndex;
+	int iBaseInterfaceNetworkMask;
+	int iBaseInterfaceStartHostAddressRange;
+	int iBaseInterfaceStopHostAddressRange;
+	int iVirtualNetworkPrefix;
+	int iVirtualNetworkPrefixMask;
+	int iVirtualNetworkAllocSize;
+};
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+
+struct TOptionDesc {
+	int	 iAgentID;
+	char iOptionFilename[X_MAXOPTIONTOKENSIZE];
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+
+struct THaStatus {
+  TResult iCallResult;
+  int iTunnelCount;
+  int iRequestsRejected;
+  int iRequestsAccepted;
+  int iDiscardedUnknownExtension;
+  int iDiscardedMalformed;
+  int iDiscardedVendor;
+  int iAdvertisementsSent;
+  int iHomeAgentAddress;
+  int iVirtualNetworkStartAddress;
+  int iVirtualNetworkSize;
+};
+
+struct THaTunnelInfo {
+  TResult iCallResult;
+  unsigned int iMobileNodeAddress;
+  unsigned int iCareofAddress;
+  unsigned int iHomeAgentAddress;
+  int iCreationTime;
+  int iExpirationTime;
+  int iRefreshTime;
+  int iLastTimestamp;
+  int iSPI;
+  int iTimeout;
+};
+
+struct THaTunnelID {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+
+typedef THaTunnelID THaTunnelList<>;
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+
+struct TGetTunnelRequest {
+	int iAgentID;
+	int iMobileNodeAddress;
+};
+
+/*******************************************************************************
+ *
+ * HACONTROLLER Interface
+ *
+ ******************************************************************************/
+program HACONTROLLER {
+	version HACONTROLLER_VERSION {
+
+		/* Initialise the service */
+		int SS_STARTUPRPCSERVICE( TStartupInfo )		= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )				= 2;
+		TComponentList LIST_DEVICES( void )				= 30;
+
+		/* Create instances */
+		TResult CSTR_CREATEAGENT( void )				= 31;
+		TResult DSTR_REMOVEAGENT( int )					= 32;
+
+		/* Start and stop the mobile agent */
+		TResult STARTMOBILEAGENT( int )					= 3;
+		TResult STOPMOBILEAGENT( int )					= 4;
+		TResult GETMOBILEAGENTSTATUS( int )				= 5;
+
+		/* Configure the agent -- must be called before starting the agent */
+		TResult SETSINGLEOPTION( TOptionDesc )			= 6;
+		TResult REMOVESINGLEOPTION( TOptionDesc )		= 33;
+		TResult ADDLISTOPTION( TOptionDesc )			= 7;
+		TResult REMOVELISTOPTION( TOptionDesc )			= 8;
+
+		/* Dynamic commands */
+		THaStatus GETSTATUS( int )						= 9;
+		TResult DESTROYTUNNELID( THaTunnelID )			= 11;
+		THaTunnelList LISTTUNNELS( int )				= 12;
+		THaTunnelInfo GETTUNNELINFO( TGetTunnelRequest )	= 14;
+
+		/* Set the timeout for all dynamic commands */
+		void SETTIMEOUT( TTimeoutRequest )				= 13;
+	} = 8;
+} = 0x34630208;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/hacontroller_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "hacontroller.h"
+
+static void hacontroller_8();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+	(void)pmap_unset(HACONTROLLER, HACONTROLLER_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, HACONTROLLER, HACONTROLLER_VERSION, hacontroller_8, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (HACONTROLLER, HACONTROLLER_VERSION, udp).\n");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, HACONTROLLER, HACONTROLLER_VERSION, hacontroller_8, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (HACONTROLLER, HACONTROLLER_VERSION, tcp).\n");
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+	exit(1);
+}
+
+static void
+hacontroller_8(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		TStartupInfo ss_startuprpcservice_8_arg;
+		int sc_shutdownrpcservice_8_arg;
+		int dstr_removeagent_8_arg;
+		int startmobileagent_8_arg;
+		int stopmobileagent_8_arg;
+		int getmobileagentstatus_8_arg;
+		TOptionDesc setsingleoption_8_arg;
+		TOptionDesc removesingleoption_8_arg;
+		TOptionDesc addlistoption_8_arg;
+		TOptionDesc removelistoption_8_arg;
+		int getstatus_8_arg;
+		THaTunnelID destroytunnelid_8_arg;
+		int listtunnels_8_arg;
+		TGetTunnelRequest gettunnelinfo_8_arg;
+		TTimeoutRequest settimeout_8_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_hacontroller_TStartupInfo;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_8;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_8;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_hacontroller_TComponentList;
+		local = (char *(*)()) list_devices_8;
+		break;
+
+	case CSTR_CREATEAGENT:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) cstr_createagent_8;
+		break;
+
+	case DSTR_REMOVEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) dstr_removeagent_8;
+		break;
+
+	case STARTMOBILEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) startmobileagent_8;
+		break;
+
+	case STOPMOBILEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) stopmobileagent_8;
+		break;
+
+	case GETMOBILEAGENTSTATUS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) getmobileagentstatus_8;
+		break;
+
+	case SETSINGLEOPTION:
+		xdr_argument = xdr_hacontroller_TOptionDesc;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) setsingleoption_8;
+		break;
+
+	case REMOVESINGLEOPTION:
+		xdr_argument = xdr_hacontroller_TOptionDesc;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) removesingleoption_8;
+		break;
+
+	case ADDLISTOPTION:
+		xdr_argument = xdr_hacontroller_TOptionDesc;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) addlistoption_8;
+		break;
+
+	case REMOVELISTOPTION:
+		xdr_argument = xdr_hacontroller_TOptionDesc;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) removelistoption_8;
+		break;
+
+	case GETSTATUS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hacontroller_THaStatus;
+		local = (char *(*)()) getstatus_8;
+		break;
+
+	case DESTROYTUNNELID:
+		xdr_argument = xdr_hacontroller_THaTunnelID;
+		xdr_result = xdr_hacontroller_TResult;
+		local = (char *(*)()) destroytunnelid_8;
+		break;
+
+	case LISTTUNNELS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_hacontroller_THaTunnelList;
+		local = (char *(*)()) listtunnels_8;
+		break;
+
+	case GETTUNNELINFO:
+		xdr_argument = xdr_hacontroller_TGetTunnelRequest;
+		xdr_result = xdr_hacontroller_THaTunnelInfo;
+		local = (char *(*)()) gettunnelinfo_8;
+		break;
+
+	case SETTIMEOUT:
+		xdr_argument = xdr_hacontroller_TTimeoutRequest;
+		xdr_result = xdr_void;
+		local = (char *(*)()) settimeout_8;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+		exit(1);
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/hacontroller_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,786 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Wed Nov 12 15:31:59 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcHacontroller.h"
+#include "CSHacontroller.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSHacontroller> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_8( TStartupInfo *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSHacontroller>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcHacontroller::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_8( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcHacontroller::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_8( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+TResult *cstr_createagent_8( void *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// create a new component instance
+	instance_key = iComponentManager->CreateInstance();
+	if( instance_key < 0 ) {
+		CSvcHacontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, instance_key );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->cstr_createagent();
+	result = CSvcHacontroller::GetError( CSTR_CREATEAGENT, (void*)&rv );
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	if( result != ERR_NONE ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == 0 );
+	} else { 
+		CSvcHacontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, instance_key );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+TResult *dstr_removeagent_8( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	int should_delete = 1;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( DSTR_REMOVEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( DSTR_REMOVEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		CSvcHacontroller::SetError( DSTR_REMOVEAGENT, (void*)&rv, instance_key );
+		return &rv;
+	}
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( DSTR_REMOVEAGENT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->dstr_removeagent( *aArgs, &should_delete );
+
+	result = CSvcHacontroller::GetError( DSTR_REMOVEAGENT, (void*)&rv );
+
+	// it is illegal for the method to succeed but not delete the instance
+	assert( (result != ERR_NONE) || (should_delete == 1) );
+
+	// delete the instance if requested
+	if( should_delete != 0 ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == ERR_NONE );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+TResult *startmobileagent_8( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( STARTMOBILEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->startmobileagent( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+TResult *stopmobileagent_8( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( STOPMOBILEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->stopmobileagent( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+TResult *getmobileagentstatus_8( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( GETMOBILEAGENTSTATUS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getmobileagentstatus( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+TResult *setsingleoption_8( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( SETSINGLEOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->setsingleoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+TResult *removesingleoption_8( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( REMOVESINGLEOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->removesingleoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+TResult *addlistoption_8( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( ADDLISTOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->addlistoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+TResult *removelistoption_8( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( REMOVELISTOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->removelistoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+THaStatus *getstatus_8( int *aArgs, CLIENT *aDutout )
+{
+	static THaStatus rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( GETSTATUS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( GETSTATUS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( GETSTATUS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( GETSTATUS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getstatus( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: destroytunnelid
+ * 
+ ***************************************************************************************/
+TResult *destroytunnelid_8( THaTunnelID *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( DESTROYTUNNELID, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( DESTROYTUNNELID, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( DESTROYTUNNELID, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( DESTROYTUNNELID, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->destroytunnelid( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listtunnels
+ * 
+ ***************************************************************************************/
+THaTunnelList *listtunnels_8( int *aArgs, CLIENT *aDutout )
+{
+	static THaTunnelList rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( LISTTUNNELS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( LISTTUNNELS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( LISTTUNNELS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( LISTTUNNELS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->listtunnels( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: gettunnelinfo
+ * 
+ ***************************************************************************************/
+THaTunnelInfo *gettunnelinfo_8( TGetTunnelRequest *aArgs, CLIENT *aDutout )
+{
+	static THaTunnelInfo rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcHacontroller::SetError( GETTUNNELINFO, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcHacontroller::SetError( GETTUNNELINFO, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( GETTUNNELINFO, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcHacontroller::SetError( GETTUNNELINFO, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->gettunnelinfo( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+void *settimeout_8( TTimeoutRequest *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_key;
+	CSHacontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// set the return value to generic error
+	rv = ERR_FAILED_TO_RETRIEVE_KEY;
+
+	// get the key for the instance from the args
+	instance_key = CSvcHacontroller::GetInstanceKeyFromArgs( SETTIMEOUT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = ERR_NONE;
+	session->settimeout( *aArgs );
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/hacontroller/hacontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,270 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "hacontroller.h"
+
+
+bool_t
+xdr_hacontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceIndex)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceNetworkMask)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceStartHostAddressRange)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iBaseInterfaceStopHostAddressRange)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkPrefix)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkPrefixMask)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkAllocSize)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iServiceResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSubComponentResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData0)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData1)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TOptionDesc(xdrs, objp)
+	XDR *xdrs;
+	TOptionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionFilename, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionToken, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionValue, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockStart, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockEnd, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaStatus(xdrs, objp)
+	XDR *xdrs;
+	THaStatus *objp;
+{
+	if (!xdr_hacontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelCount)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsRejected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRequestsAccepted)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedUnknownExtension)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedMalformed)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iDiscardedVendor)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iAdvertisementsSent)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkStartAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iVirtualNetworkSize)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaTunnelInfo(xdrs, objp)
+	XDR *xdrs;
+	THaTunnelInfo *objp;
+{
+	if (!xdr_hacontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iCareofAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iCreationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExpirationTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRefreshTime)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLastTimestamp)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSPI)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaTunnelID(xdrs, objp)
+	XDR *xdrs;
+	THaTunnelID *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_THaTunnelList(xdrs, objp)
+	XDR *xdrs;
+	THaTunnelList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->THaTunnelList_val, (u_int *)&objp->THaTunnelList_len, ~0, sizeof(THaTunnelID), (void*)xdr_hacontroller_THaTunnelID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TTimeoutRequest(xdrs, objp)
+	XDR *xdrs;
+	TTimeoutRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_hacontroller_TGetTunnelRequest(xdrs, objp)
+	XDR *xdrs;
+	TGetTunnelRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMobileNodeAddress)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/include/CComponentManager.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __CCOMPONENTMANAGER_H__
+#define __CCOMPONENTMANAGER_H__
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <stdio.h>
+#include <assert.h>
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+
+/****************************************************************************************
+ * 
+ * Class CComponentManager
+ * 
+ ***************************************************************************************/
+template <class T>
+class CComponentManager
+{
+public:
+	CComponentManager( int aMaxComponents )
+	{
+		// check params
+		assert( aMaxComponents > 0 );
+
+		// set the state
+		iComponentCount = 0;
+		iMaxComponents = aMaxComponents;
+		iComponentList = (T**)calloc( iMaxComponents, sizeof(T*) );
+		assert( iComponentList != NULL );
+	}
+
+	~CComponentManager()
+	{
+		assert( iComponentCount == 0 );
+		free( iComponentList );
+	}
+
+	int CreateInstance() 
+	{
+		int i;
+
+		// make sure there is room
+		if( iComponentCount == iMaxComponents ) {
+			return ERR_CANNOT_CREATE_NEW_INSTANCE;
+		}
+
+		// find a free index
+		for( i = 0; i < iMaxComponents; i++ ) {
+			if( iComponentList[i] == NULL )
+				break;
+		}
+		assert( i < iMaxComponents );
+
+		// create the new instance
+		iComponentList[i] = new T();
+		assert( iComponentList[i] != NULL );
+
+		// set the key
+		(iComponentList[i])->SetKey( i );
+
+		// update the count
+		iComponentCount++;
+
+		// done - return the key
+		return i;
+	}
+
+	int DeleteInstance( int aInstanceKey )
+	{
+		int is_key_valid;
+
+		// check that the key is valid
+		is_key_valid = IsValidKey( aInstanceKey );
+		assert( is_key_valid != 0 );
+
+		// verify the key
+		assert( (iComponentList[aInstanceKey])->GetKey() == aInstanceKey );
+
+		// delete the instace
+		delete (iComponentList[aInstanceKey]);
+		iComponentList[aInstanceKey] = NULL;
+		iComponentCount--;
+
+		// done
+		return ERR_NONE;
+	}
+
+	int IsValidKey( int aInstanceKey )
+	{
+		return ((aInstanceKey >= 0) && (aInstanceKey < iMaxComponents) && (iComponentList[aInstanceKey] != NULL) );
+	}
+
+	T *GetInstance( int aInstanceKey )
+	{
+		// validate the param
+		if( (aInstanceKey < 0) || (aInstanceKey >= iMaxComponents) ) {
+			return NULL;
+		}
+		return iComponentList[aInstanceKey];
+	}
+
+	int GetInstanceCount()
+	{
+		return iComponentCount;
+	}
+
+	int DeleteAllInstances()
+	{
+		int i, err;
+		for( i = 0; i < iMaxComponents; i++ ) {
+			if( iComponentList[i] != NULL ) {
+				err = DeleteInstance( i );
+				assert( err == ERR_NONE );
+			}
+		}
+		assert( iComponentCount == 0 );
+		return ERR_NONE;
+	}
+
+
+private:
+	int iComponentCount;
+	int iMaxComponents;
+	T **iComponentList;
+};
+
+#endif //__CCOMPONENTMANAGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/include/penstd.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __PENSTD_H__
+#define __PENSTD_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALID_CALL -18
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_penstd_TComponentList(...);
+}
+#else
+bool_t xdr_penstd_TComponentList();
+#endif
+
+#endif /* __PENSTD_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/include/penstd.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Constants - STANDARD SET
+*
+*/
+
+
+/* success -- returned by client stubs and return values */
+const ERR_NONE									= 0;
+
+/* invalid return code used as a place holder */
+const ERR_INVALID_ERROR_CODE					= -16;
+
+/* service stub implementation (returned in RV - i.e. as the result) */
+const ERR_SERVICE_ALREADY_STARTED				= -1;
+const ERR_SERVICE_NOT_RUNNING					= -2;
+const ERR_ACTIVE_USER_SESSIONS					= -3;
+const ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS		= -4;
+const ERR_FAILED_TO_CREATE_COMPONENT_MANAGER	= -5;
+const ERR_FAILED_TO_RETRIEVE_KEY				= -6;
+const ERR_INSTANCE_DOES_NOT_EXIST				= -7;
+
+/* component manager (returned in RV - i.e. as the result ) */
+const ERR_CANNOT_CREATE_NEW_INSTANCE			= -9;
+
+/* set by the stub glue code as the completion code (i.e. as the RCC) */
+const ERR_MISSING_PARAMETER						= -17;
+const ERR_INVALID_METHOD						= -8;
+
+/* client stubs return one of these values or ERR_NONE (i.e. as the RCC) */
+const ERR_STUB_ALREADY_CONNECTED				= -10;
+const ERR_FAILED_TO_CONNECT						= -11;
+const ERR_STUB_NOT_CONNECTED					= -12;
+const ERR_INVALID_RV_POINTER					= -13;
+const ERR_RPC_ERROR								= -14;
+const ERR_INVALID_SERVICE						= -15;
+const ERR_INVALID_CALL							= -18;
+
+/* standard error values returned from methods (RV) */
+const ERR_INVALIDARG							= -50;
+const ERR_INVALIDSTATE							= -51;
+const ERR_GENERAL								= -52;
+
+/* info - required for the framework */
+const INFO_MAXIMUM_OBJECTS						= 256;
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+typedef int TComponentList<>;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/include/standard_service_manager.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* standard_service_manager
+*
+*/
+
+
+
+
+#ifndef __STANDARD_SERVICE_MANAGER_H__
+#define __STANDARD_SERVICE_MANAGER_H__
+
+
+/****************************************************************************************
+ * 
+ * Macro Functions
+ * 
+ ***************************************************************************************/
+#define SET_ERROR_CODE(type_name,member_name,ptr_to_result)    { \
+                                                                 (ptr_to_result) = (type_name*)aArgs;                    \
+                                                                 memset( ptr_to_result, 0, sizeof(type_name) );        \
+                                                                 (ptr_to_result)->member_name = aError;                  \
+                                                               }
+
+#define SET_LIST_ERROR_CODE(type_name,ptr_to_result)           { \
+                                                                 assert( aError != ERR_NONE );                         \
+                                                                 ptr_to_result = (type_name*)aArgs;                    \
+                                                                 if( ptr_to_result->type_name##_len != 0 ) {           \
+                                                                   free( ptr_to_result->type_name##_val );             \
+                                                                   ptr_to_result->type_name##_val = NULL;              \
+                                                                   ptr_to_result->type_name##_len = 0;                 \
+                                                                 }                                                     \
+							       }			
+
+/****************************************************************************************
+ * 
+ * Done
+ * 
+ ***************************************************************************************/
+#endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/include/standard_unix.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* Switches
+*
+*/
+
+
+
+
+#ifndef __STANDARD_UNIX_H__
+#define __STANDARD_UNIX_H__
+
+// COMPILE ONLY - these defs get things to compile - not work!!!
+#ifdef WIN32
+#define mktime(x)		((time_t)0)
+#define strptime(a,b,c)	
+#define ioctl(a,b,c)	(0)
+#endif
+
+// COMPILE ONLY - Windows doesn't define SIGKILL
+#ifdef WIN32
+#define SIGKILL 0
+#endif
+
+// COMPILE ONLY - Ioctl constants
+#ifdef WIN32
+#define SIOCGIFDSTADDR 0
+#define SIOCSIFADDR 0
+#define SIOCSIFDSTADDR 0
+struct ifreq {
+	char *ifr_name;
+	struct sockaddr ifr_addr;
+	struct sockaddr ifr_dstaddr;
+};
+#endif
+
+// Windows doesn't have getppid()
+#ifdef WIN32
+#define getppid()	(-1)
+#endif
+
+// Windows has inet_addr instead of inet_aton
+#ifdef WIN32
+#define inet_aton(str,pstruct)	(((pstruct)->ADDRESS_INTEGER = inet_addr(str)), 1)
+#endif
+
+// Windows has different naming conventions for some string methods.
+#ifdef WIN32
+#define	snprintf	_snprintf
+#define strncasecmp	_strnicmp
+#endif
+
+// Windows and Linux have different Sleep function - Windows has milliseconds while Linux
+// just has seconds. This is dangerous - so I replace with a standard millisecond version
+#ifndef WIN32
+#define SleepForMilliseconds(x)		sleep(((x)/1000))
+#else
+#define SleepForMilliseconds(x)		Sleep((x))
+#endif
+
+// Windows doesn't like these includes - but almost all use them - so include them here to collect hash-if-defs
+#ifndef WIN32
+#include <unistd.h>
+#include <errno.h>
+#endif
+
+// Windows doesn't define snprintf 
+#ifdef WIN32
+#define snprintf _snprintf
+#endif
+
+// Windows doesn't follow berkely in_addr perfectly
+#ifdef WIN32
+#define ADDRESS_INTEGER S_un.S_addr
+#else
+#define ADDRESS_INTEGER s_addr
+#endif
+
+// Windows doesn't define IFNAMSIZ
+#ifdef WIN32
+#define IFNAMSIZ			100
+#endif
+
+// Windows doesn't have pid_t
+#ifdef WIN32
+#define pid_t int
+#endif
+
+// Windows doesn't have sighandler_t
+#ifdef WIN32
+typedef void (*sighandler_t)(int);
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/include/strncpynt.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __STRNCPYNT_H__
+#define __STRNCPYNT_H__
+
+#define STRNCPY_NULL_TERMINATE( dest, src, dest_size )		{ strncpy((dest),(src),(dest_size)-1); (dest)[(dest_size)-1] = 0; }
+
+#endif //__STRNCPYNT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/CSMncontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1151 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Wed Oct 01 09:46:52 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <signal.h>
+#ifndef WIN32
+#include <unistd.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcMncontroller.h"
+#include "CSMncontroller.h"
+#include "standard_unix.h"
+#include "strncpynt.h"
+
+
+/****************************************************************************************
+ * 
+ * Definitions
+ * 
+ ***************************************************************************************/
+#define TEMPLATE_CONFIG_FILE			"dynmnd.template.conf"
+#define MOBILE_AGENT_COMMAND_LINE		"./dynmnd --fg --debug --config "
+#define MAXCOMMANDLINELENGTH			(31 + 256 + 1)
+#define MAXFOREIGNAGENTCOUNT			32
+#define MAXINTERFACECONFIGENTRY			(IFNAMSIZ + 128)
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSMncontroller::CSMncontroller()
+{
+	iDynamicsCallTimeout = -1;
+	iAgentProcess = NULL;
+}
+
+CSMncontroller::~CSMncontroller()
+{
+	assert( iAgentProcess == NULL );
+}
+
+int CSMncontroller::GetKey()
+{
+	return iKey;
+}
+
+void CSMncontroller::SetKey( int aKey )
+{
+	iKey = aKey;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::cstr_createagent( void )
+{
+	TResult rv;
+	int errcode;
+	TDCFError terr;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// create a local copy of the configuration file
+	terr = iDynamicsConfigFile.SetReferenceFile( TEMPLATE_CONFIG_FILE );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		return rv;
+	}
+	terr = iDynamicsConfigFile.CreateLocalCopy( &errcode );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+int CSMncontroller::dstr_removeagent( int aArgs, int *aDeleteInstance )
+{
+	int rv = ERR_NONE, errcode;
+	TDCFError terr;
+
+	// make sure that the proces isn't running
+	if( iAgentProcess != NULL ) {
+		*aDeleteInstance = 0;
+		rv = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// clean up the config file
+	terr = iDynamicsConfigFile.RemoveLocalCopy( &errcode );
+	if( terr != DCE_NONE ) {
+		rv = ERR_CONFIG_FILE_ERROR;
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::startmobileagent( int aArgs )
+{
+	TResult rv;
+	int errcode;
+	TCAProcessError perr;
+	char command_line_str[MAXCOMMANDLINELENGTH];
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that there is currently no process
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// create the new process object
+	iAgentProcess = new CAProcess();
+	assert( iAgentProcess != NULL );
+
+	// construct the command line
+	snprintf( command_line_str, MAXCOMMANDLINELENGTH, "%s%s", MOBILE_AGENT_COMMAND_LINE, iDynamicsConfigFile.GetLocalFilename() );
+
+	// start the actual process
+	perr = iAgentProcess->StartProcess( command_line_str, &errcode, false, false, false ); 
+	if( perr != CAE_NONE ) {
+		rv.iServiceResult = ERR_START_PROCESS_ERROR;
+		rv.iSubComponentResult = (int)perr;
+		delete iAgentProcess;
+		iAgentProcess = NULL;
+		return rv;
+	}
+
+	// done - success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::stopmobileagent( int aArgs )
+{
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// if the process isn't started then invalid state
+	if( iAgentProcess == NULL ) {
+	  rv.iServiceResult = ERR_INVALIDSTATE;
+	  return rv;
+	}
+
+	// if the process isn't running then it has died outside the scope of this controller, clean up the state, return an error since
+	// this is noteworthy and should be either expected or not happen.
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+	  assert( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) );
+	  delete iAgentProcess;
+	  iAgentProcess = NULL;
+	  rv.iServiceResult = ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE;
+	  return rv;
+	}
+
+	// request the process to stop
+	perr = iAgentProcess->RequestStop( SIGTERM );
+	if( perr != CAE_NONE ) {
+	  rv.iServiceResult = ERR_STOP_PROCESS_ERROR;
+	  rv.iSubComponentResult = (int)perr;
+	  return rv;
+	}
+
+	// wait for the process to stop
+	perr = iAgentProcess->WaitForProcessToTerminate( -1 );
+	if( perr != CAE_NONE ) {
+	  rv.iServiceResult = ERR_WAIT_PROCESS_ERROR;
+	  rv.iSubComponentResult = (int)perr;
+	  return rv;
+	}
+
+	// remove the process
+	delete iAgentProcess;
+	iAgentProcess = NULL;
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::getmobileagentstatus( int aArgs )
+{
+	TResult rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// init the rv - note that we include the result even though it is always ERR_NONE
+	// here because the stub may return an error
+	memset( &rv, 0, sizeof(rv) );
+	rv.iServiceResult = ERR_NONE;
+
+	// if the process doesn't exist then we return PS_INVALID
+	if( iAgentProcess == NULL ) {
+		rv.iData0 = PS_INVALID;
+		return rv;
+	}
+
+	// otherwise just return whatever iAgentProcess->GetProcessStatus() returns
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	rv.iData0 = (int)pstatus;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::setsingleoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.SetSingleOption( aArgs.iOptionToken, aArgs.iOptionValue, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::removesingleoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.RemoveSingleOption( aArgs.iOptionToken, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::addlistoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.AddListOption( aArgs.iOptionBlockStart, aArgs.iOptionBlockEnd, aArgs.iOptionValue, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::removelistoption( TOptionDesc aArgs )
+{
+	TResult rv;
+	int errcode;
+	TDCFError cerr;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// modify the config file
+	cerr = iDynamicsConfigFile.RemoveListOption( aArgs.iOptionBlockStart, aArgs.iOptionBlockEnd, aArgs.iOptionToken, &errcode );
+	if( cerr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)cerr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// return success
+	rv.iServiceResult = ERR_NONE;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getcareofaddress
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::sethomeaddress( THomeAddressDesc aArgs )
+{
+	TResult rv;
+	char dynamics_config[MAXINTERFACECONFIGENTRY];
+	struct in_addr home_address, home_network_address, home_agent_address;
+	TDCFError terr;
+	int errcode;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// make sure that the process isn't running
+	if( iAgentProcess != NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// validate the arguments
+	if( aArgs.iHomeAddress == -1 ) {
+	  rv.iServiceResult = ERR_INVALIDARG;
+	  rv.iData0 = 2;
+	  return rv;
+	}
+	if( (aArgs.iHomeAddressPrefix < 1) || (aArgs.iHomeAddressPrefix > 31) ) {
+		rv.iServiceResult = ERR_INVALIDARG;
+		rv.iData0 = 3;
+		return rv;
+	}
+	if( aArgs.iHomeAgentAddress == -1 ) {
+	  rv.iServiceResult = ERR_INVALIDARG;
+	  rv.iData0 = 4;
+	  return rv;
+	}
+
+	// if the home address specified is zero, then we take this as meaning that the user
+	// wants to reset the interface back to it's original (PPP configured) address. This
+	// doesn't effect the entries in the configuration file at all
+	if( aArgs.iHomeAddress == 0 ) {
+	  return rv;
+	}
+
+	// set the home address on the interface
+	rv = SetInterfaceAddress( aArgs.iInterfaceName, aArgs.iHomeAddress );
+	if( rv.iServiceResult != ERR_NONE ) {
+	  return rv;
+	}
+
+	// set the home address in the dynamics config file
+	home_address.ADDRESS_INTEGER = aArgs.iHomeAddress;
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "MNHomeIPAddress %s", inet_ntoa(home_address) );
+	terr = iDynamicsConfigFile.SetSingleOption( "MNHomeIPAddress", dynamics_config, &errcode );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// set the home network prefix in the dynamics config file
+	home_network_address = GetNetworkAddressFromHostAddress( aArgs.iHomeAddress, aArgs.iHomeAddressPrefix );
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "HomeNetPrefix %s/%d", inet_ntoa(home_network_address), aArgs.iHomeAddressPrefix );
+	terr = iDynamicsConfigFile.SetSingleOption( "HomeNetPrefix", dynamics_config, &errcode );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// set the home agent address 
+	home_agent_address.ADDRESS_INTEGER = aArgs.iHomeAgentAddress;
+	snprintf( dynamics_config, MAXINTERFACECONFIGENTRY, "HAIPAddress %s", inet_ntoa(home_agent_address) );
+	fprintf( stderr, "DEBUG: setting option '%s'\n", dynamics_config );
+	terr = iDynamicsConfigFile.SetSingleOption( "HAIPAddress", dynamics_config, &errcode );
+	if( terr != DCE_NONE ) {
+		rv.iServiceResult = ERR_CONFIG_FILE_ERROR;
+		rv.iSubComponentResult = (int)terr;
+		rv.iData0 = errcode;
+		return rv;
+	}
+
+	// done
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getcareofaddress
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::getcareofaddress( int aArgs )
+{
+	TResult rv;
+	struct in_addr addr = { 0 };
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// use the dynamics command wrapper to make the call
+	cres = iDynamicsCommand.MobileNodeAgentGetCareofAddress( &addr );
+	
+	// if the call failed then set the TResult correctly
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iSubComponentResult = cres.iResult;
+		rv.iData0 = cres.iErrorCode;
+		rv.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// otherwise pack up the successful return info
+	rv.iServiceResult = ERR_NONE;
+	rv.iData0 = addr.ADDRESS_INTEGER;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+TMobileNodeStatus CSMncontroller::getstatus( int aArgs )
+{
+	TMobileNodeStatus rv;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+	TDynamicsCallInfo cres;
+	TMobileNodeAgentStatusInfo mobile_node_status;
+
+	// init the return value
+	memset( &rv, 0, sizeof(rv) );
+	rv.iCallResult.iServiceResult = ERR_NONE;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iCallResult.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iCallResult.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// make the call
+	cres = iDynamicsCommand.MobileNodeAgentGetStatus( &mobile_node_status );
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iCallResult.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iCallResult.iSubComponentResult = cres.iResult;
+		rv.iCallResult.iData0 = cres.iErrorCode;
+		rv.iCallResult.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// copy the data from mobile_node_status to the rv
+	rv.iColocatedAddress = mobile_node_status.iColocatedAddress;
+	rv.iConnected = mobile_node_status.iConnected;
+	rv.iForeignAgentAddress = mobile_node_status.iForeignAgentAddress;
+	rv.iHomeAddress = mobile_node_status.iHomeAddress;
+	rv.iHomeAgentAddress = mobile_node_status.iHomeAgentAddress;
+	memcpy( rv.iInfoText, mobile_node_status.iInfoText, X_MAXINFOLEN );
+	memcpy( rv.iLastErrorString, mobile_node_status.iLastErrorString, X_MAXERRORSTRING );
+	rv.iLifetimeRemaining = mobile_node_status.iLifetimeRemaining;
+	rv.iLocalAddress = mobile_node_status.iLocalAddress;
+	rv.iReplyCode = mobile_node_status.iReplyCode;
+	rv.iSecondsSinceLastReply = mobile_node_status.iSecondsSinceLastReply;
+	rv.iSecondsSinceLastRequest = mobile_node_status.iTunnelMode;
+	rv.iTunnelUp = mobile_node_status.iTunnelUp;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: connect
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::connect( TTunnelingModeDesc aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// call the wrapper
+	cres = iDynamicsCommand.MobileNodeAgentConnect();
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iSubComponentResult = cres.iResult;
+		rv.iData0 = cres.iErrorCode;
+		rv.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: disconnect
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::disconnect( int aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// call the wrapper
+	cres = iDynamicsCommand.MobileNodeAgentDisconnect();
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iSubComponentResult = cres.iResult;
+		rv.iData0 = cres.iErrorCode;
+		rv.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: confirm
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::confirm( int aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// call the wrapper
+	cres = iDynamicsCommand.MobileNodeAgentConfirm();
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iSubComponentResult = cres.iResult;
+		rv.iData0 = cres.iErrorCode;
+		rv.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: rescaninterfaces
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::rescaninterfaces( int aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// call the wrapper
+	cres = iDynamicsCommand.MobileNodeAgentRescan();
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iSubComponentResult = cres.iResult;
+		rv.iData0 = cres.iErrorCode;
+		rv.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// success
+	return rv;
+}
+
+
+/****************************************************************************************
+ *
+ * PUBLIC FUNCTION: setfapolicy - aPolicyDesc is a bitfield with each bit representing
+ * a particular policy that should be turned on or off. The values for each
+ * policy are in the interface file (.x). We try and set the policy for each
+ * bit regardless of whether some calls fail. The result is the OR of all the
+ * results (i.e. if one fails the op fails). To get more info about which
+ * succeeded you can just call getpolicy.
+ *
+ ***************************************************************************************/
+TResult CSMncontroller::setfapolicy( TPolicyRequest aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// call the wrapper
+	cres = iDynamicsCommand.MobileNodeAgentSetPolicy( aArgs.iPolicy );
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iSubComponentResult = cres.iResult;
+		rv.iData0 = cres.iErrorCode;
+		rv.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getfapolicy
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::getfapolicy( int aArgs )
+{
+	TResult rv;
+	TDynamicsCallInfo cres;
+	int policy_vector;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// initialise the return value
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// call the wrapper
+	cres = iDynamicsCommand.MobileNodeAgentGetPolicy( &policy_vector );
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iSubComponentResult = cres.iResult;
+		rv.iData0 = cres.iErrorCode;
+		rv.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// success
+	rv.iServiceResult = ERR_NONE;
+	rv.iData0 = policy_vector;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listforeignagents
+ * 
+ ***************************************************************************************/
+TForeignAgentList CSMncontroller::listforeignagents( int aArgs )
+{
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+	int foreign_agent_count = MAXFOREIGNAGENTCOUNT, i;
+	TMobileNodeForeignAgentInfo foreign_agent_list[MAXFOREIGNAGENTCOUNT];
+	TForeignAgentList rv = { 0, NULL };
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		return rv;
+	}
+
+	// call the dynamics wrapper
+	cres = iDynamicsCommand.MobileNodeAgentGetForeignAgentList( &foreign_agent_count, foreign_agent_list);
+	if( cres.iResult != DC_SUCCESS ) {
+		return rv;
+	}
+
+	// allocate the memory 
+	rv.TForeignAgentList_len = foreign_agent_count;
+	rv.TForeignAgentList_val = (TForeignAgentInfo*)calloc( foreign_agent_count, sizeof(TForeignAgentInfo) );
+	assert( rv.TForeignAgentList_val != NULL );
+
+	// copy the entries - all entries default to 0 due to calloc()
+	for( i = 0; i < foreign_agent_count; i++ ) {
+		(rv.TForeignAgentList_val)[i].iCallResult.iServiceResult = ERR_NONE;
+		(rv.TForeignAgentList_val)[i].iForeignAgentAddress = (foreign_agent_list[i]).iForeignAgentAddress;
+		(rv.TForeignAgentList_val)[i].iInterfaceIndex = (foreign_agent_list[i]).iInterfaceIndex;
+		(rv.TForeignAgentList_val)[i].iInUse = (foreign_agent_list[i]).iInUse;
+		(rv.TForeignAgentList_val)[i].iLastAdvertisement = (foreign_agent_list[i]).iLastAdvertisement;
+		(rv.TForeignAgentList_val)[i].iPriority = (foreign_agent_list[i]).iPriority;
+		memcpy( (rv.TForeignAgentList_val)[i].iInterfaceName, (foreign_agent_list[i]).iInterfaceName, X_MAXINTERFACENAMELEN );
+		memcpy( (rv.TForeignAgentList_val)[i].iNAI, (foreign_agent_list[i]).iNAI, X_MAXNAILEN );
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getforeignagentinfo
+ * 
+ ***************************************************************************************/
+TForeignAgentInfo CSMncontroller::getforeignagentinfo( TForeignAgentInfoRequest aArgs )
+{
+	TDynamicsCallInfo cres;
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+	TMobileNodeForeignAgentInfo foreign_agent_info;
+	TForeignAgentInfo rv;
+
+	// init the result
+	memset( &rv, 0, sizeof(rv) );
+	rv.iCallResult.iServiceResult = ERR_NONE;
+
+	// check that the agent was running
+	if( iAgentProcess == NULL ) {
+		rv.iCallResult.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// check that the agent is still runnning
+	perr = iAgentProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+		rv.iCallResult.iServiceResult = ERR_INVALIDSTATE;
+		return rv;
+	}
+
+	// call the dynamics wrapper
+	cres = iDynamicsCommand.MobileNodeAgentGetForeignAgentInfo( aArgs.iForeignAgentID, &foreign_agent_info );
+	if( cres.iResult != DC_SUCCESS ) {
+		rv.iCallResult.iServiceResult = ERR_DYNAMICS_CALL_FAILED;
+		rv.iCallResult.iSubComponentResult = cres.iResult;
+		rv.iCallResult.iData0 = cres.iErrorCode;
+		rv.iCallResult.iData1 = cres.iErrorDetail;
+		return rv;
+	}
+
+	// set the result
+	rv.iForeignAgentAddress = foreign_agent_info.iForeignAgentAddress;
+	rv.iInterfaceIndex = foreign_agent_info.iInterfaceIndex;
+	rv.iInUse = foreign_agent_info.iInUse;
+	rv.iLastAdvertisement = foreign_agent_info.iLastAdvertisement;
+	rv.iPriority = foreign_agent_info.iPriority;
+	memcpy( rv.iInterfaceName, foreign_agent_info.iInterfaceName, X_MAXINTERFACENAMELEN );
+	memcpy( rv.iNAI, foreign_agent_info.iNAI, X_MAXNAILEN );
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+void CSMncontroller::settimeout( TTimeoutRequest aArgs )
+{
+	iDynamicsCallTimeout = aArgs.iTimeout;
+	iDynamicsCommand.SetTimeout( aArgs.iTimeout );
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: SetInterfaceAddress
+ * 
+ ***************************************************************************************/
+TResult CSMncontroller::SetInterfaceAddress( char *aInterfaceName, int aAddress )
+{
+	TResult rv;
+	int sockfd, err;
+	struct ifreq ifr;
+	struct sockaddr_in destination_address, *saddr;
+
+	// check parameters
+	assert( aInterfaceName );
+
+	// init the response
+	rv.iServiceResult = ERR_NONE;
+	rv.iSubComponentResult = 0;
+	rv.iData0 = 0;
+	rv.iData1 = 0;
+
+	// create a socket to make ioctl calls on
+	sockfd = socket( AF_INET, SOCK_DGRAM, 0 );
+	if( sockfd <= 0 ) {
+		rv.iServiceResult = ERR_SET_INTERFACE_ADDRESS_ERROR;
+		rv.iSubComponentResult = SIE_SOCKET_FAILED;
+		rv.iData0 = errno;
+		return rv;
+	}	
+
+	// setup the request
+	STRNCPY_NULL_TERMINATE( ifr.ifr_name, aInterfaceName, IFNAMSIZ );
+
+	// get the current pointopoint address
+	err = ioctl( sockfd, SIOCGIFDSTADDR, &ifr );
+	if( err == -1 ) {
+		rv.iServiceResult = ERR_SET_INTERFACE_ADDRESS_ERROR;
+		rv.iSubComponentResult = SIE_IOCTL_GET_DESTINATION_ADDRESS_FAILED;
+		rv.iData0 = errno;
+		return rv;
+	}
+	destination_address = (*((struct sockaddr_in*)(&(ifr.ifr_dstaddr))));
+
+	// set the interface address
+	saddr = (struct sockaddr_in*)(&(ifr.ifr_addr));
+	saddr->sin_family = AF_INET;
+	saddr->sin_port = 0;
+	saddr->sin_addr.ADDRESS_INTEGER = aAddress;
+	err = ioctl( sockfd, SIOCSIFADDR, &ifr );
+	if( err == -1 ) {
+		rv.iServiceResult = ERR_SET_INTERFACE_ADDRESS_ERROR;
+		rv.iSubComponentResult = SIE_IOCTL_SET_ADDRESS_FAILED;
+		rv.iData0 = errno;
+		return rv;
+	}
+  
+	// setting the interface address seems to also set the the pointopoint (destination) 
+	// address to the same thing, so set it back to what it was or routing won't work
+	saddr = (struct sockaddr_in*)(&(ifr.ifr_dstaddr));
+	*saddr = destination_address; 
+	err = ioctl( sockfd, SIOCSIFDSTADDR, &ifr );
+	if( err == -1 ) {
+		rv.iServiceResult = ERR_SET_INTERFACE_ADDRESS_ERROR;
+		rv.iSubComponentResult = SIE_IOCTL_SET_DESTINATION_ADDRESS_FAILED;
+		rv.iData0 = errno;
+		return rv;
+	}
+
+	// done
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: GetNetworkAddressFromHostAddress
+ * 
+ ***************************************************************************************/
+struct in_addr CSMncontroller::GetNetworkAddressFromHostAddress( int aAddress, int aNetmask )
+{
+	struct in_addr rv;
+	int netmask, i;
+
+	// create the netmask
+	for( netmask = 0, i = 0; i < aNetmask; i++ ) {
+	    netmask |= 1<<(31-i);
+	}
+
+	// get the 
+	rv.ADDRESS_INTEGER = ntohl( aAddress );
+	rv.ADDRESS_INTEGER &= netmask;
+	rv.ADDRESS_INTEGER = htonl( rv.ADDRESS_INTEGER );
+
+	// done
+	return rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/CSMncontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Wed Oct 01 09:46:52 2003
+*
+*/
+
+
+
+
+#ifndef __CSMNCONTROLLER_H__
+#define __CSMNCONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "mncontroller.h"
+#include "../DynamicsConfigurationLibrary/CDynamicsConfigFile.h"
+#include "../ProcessLibrary/proclib.h"
+#include "../DynamicsCommandWrapper/CDynamicsCommand.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSMncontroller
+ * 
+ ***************************************************************************************/
+class CSMncontroller
+{
+public:
+	// Standard Methods
+	CSMncontroller();
+	~CSMncontroller();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+	TResult cstr_createagent( void );
+	int dstr_removeagent( int aArgs, int *aDeleteInstance );
+	TResult startmobileagent( int aArgs );
+	TResult stopmobileagent( int aArgs );
+	TResult getmobileagentstatus( int aArgs );
+	TResult setsingleoption( TOptionDesc aArgs );
+	TResult removesingleoption( TOptionDesc aArgs );
+	TResult addlistoption( TOptionDesc aArgs );
+	TResult removelistoption( TOptionDesc aArgs );
+	TResult sethomeaddress( THomeAddressDesc aArgs );
+	TResult getcareofaddress( int aArgs );
+	TMobileNodeStatus getstatus( int aArgs );
+	TResult connect( TTunnelingModeDesc aArgs );
+	TResult disconnect( int aArgs );
+	TResult confirm( int aArgs );
+	TResult rescaninterfaces( int aArgs );
+	TResult setfapolicy( TPolicyRequest aArgs );
+	TResult getfapolicy( int aArgs );
+	TForeignAgentList listforeignagents( int aArgs );
+	TForeignAgentInfo getforeignagentinfo( TForeignAgentInfoRequest aArgs );
+	void settimeout( TTimeoutRequest aArgs );
+
+private:
+	TResult SetInterfaceAddress( char *aInterfaceName, int aAddress );
+	struct in_addr GetNetworkAddressFromHostAddress( int aAddress, int aNetmask );
+
+	int iKey;
+	int iDynamicsCallTimeout;
+	CDynamicsConfigFile iDynamicsConfigFile;
+	CAProcess *iAgentProcess;
+	CDynamicsCommand iDynamicsCommand;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/CSvcMncontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Wed Oct 01 17:43:02 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcMncontroller.h"
+#include "mncontroller.h"
+#include "standard_service_manager.h"
+
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSMncontroller> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcMncontroller::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	int rv;
+	int *integer_ik;
+	TOptionDesc *option_ik;
+	TTunnelingModeDesc *tunnel_mode_ik;
+	TPolicyRequest *policy_ik;
+	TTimeoutRequest *timeout_ik;
+	TForeignAgentInfoRequest *fa_info_ik;
+	THomeAddressDesc *home_address_desc_ik;
+
+	switch( aMethod ) {
+
+	// Handle cases where there is an integer argument that is the instance key
+	case DSTR_REMOVEAGENT:
+	case STARTMOBILEAGENT:
+	case STOPMOBILEAGENT:
+	case GETMOBILEAGENTSTATUS:
+	case GETCAREOFADDRESS:
+	case DISCONNECT:
+	case CONFIRM:
+	case RESCANINTERFACES:
+	case GETFAPOLICY:
+	case GETSTATUS:
+	case LISTFOREIGNAGENTS:
+		integer_ik = (int*)aArgs;
+		rv = *integer_ik;
+		break;
+
+	// Handle options
+	case SETSINGLEOPTION:
+	case REMOVESINGLEOPTION:
+	case ADDLISTOPTION:
+	case REMOVELISTOPTION:
+		option_ik = (TOptionDesc*)aArgs;
+		rv = option_ik->iAgentID;
+		break;
+
+	// THomeAddressDesc
+	case SETHOMEADDRESS:
+		home_address_desc_ik = (THomeAddressDesc*)aArgs;
+		rv = home_address_desc_ik->iAgentID;
+		break;
+
+	// TForeignAgentInfoRequest
+	case GETFOREIGNAGENTINFO:
+		fa_info_ik = (TForeignAgentInfoRequest*)aArgs;
+		rv = fa_info_ik->iAgentID;
+		break;
+
+	// Connect
+	case CONNECT:
+		tunnel_mode_ik = (TTunnelingModeDesc*)aArgs;
+		rv = tunnel_mode_ik->iAgentID;
+		break;
+
+	// Policy
+	case SETFAPOLICY:
+		policy_ik = (TPolicyRequest*)aArgs;
+		rv = policy_ik->iAgentID;
+		break;
+
+	// Timeout
+	case SETTIMEOUT:
+		timeout_ik = (TTimeoutRequest*)aArgs;
+		rv = timeout_ik->iAgentID;
+		break;
+
+	// Default
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcMncontroller::SetError( int aMethod, void *aArgs, int aError )
+{
+	int rv = ERR_NONE;
+	TResult *result_rv;
+	TComponentList *result_cl;
+	TForeignAgentList *result_fal;
+	TForeignAgentInfo *result_fai;
+	TMobileNodeStatus *result_status;
+
+	switch( aMethod ) {
+
+	// Handle the TResult case
+	case CSTR_CREATEAGENT:
+	case STARTMOBILEAGENT:
+	case STOPMOBILEAGENT:
+	case GETMOBILEAGENTSTATUS:
+	case SETSINGLEOPTION:
+	case REMOVESINGLEOPTION:
+	case ADDLISTOPTION:
+	case REMOVELISTOPTION:
+	case SETHOMEADDRESS:
+	case SETFAPOLICY:
+	case GETFAPOLICY:
+	case CONNECT:
+	case DISCONNECT:
+	case CONFIRM:
+	case RESCANINTERFACES:
+	case GETCAREOFADDRESS:
+		SET_ERROR_CODE( TResult, iServiceResult, result_rv );
+		break;
+
+	// Handle TMobileNodeStatus
+	case GETSTATUS:
+		result_status = (TMobileNodeStatus*)aArgs;
+		memset( result_status, 0, sizeof(*result_status) );
+		(result_status->iCallResult).iServiceResult = aError;
+		break;
+
+	// Handle ListDevices
+	case LIST_DEVICES:
+	    SET_LIST_ERROR_CODE( TComponentList, result_cl );
+		break;
+
+	// List Foreign Agents	
+	case LISTFOREIGNAGENTS:
+	    SET_LIST_ERROR_CODE( TForeignAgentList, result_fal );
+		break;
+
+	// Foreign agent info
+	case GETFOREIGNAGENTINFO:
+		result_fai = (TForeignAgentInfo*)aArgs;
+		memset( result_fai, 0, sizeof(*result_fai) );
+		(result_fai->iCallResult).iServiceResult = aError;
+		break;
+
+	// Default
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError
+ * 
+ ***************************************************************************************/
+int CSvcMncontroller::GetError( int aMethod, void *aArgs )
+{
+	TResult *result;
+
+	// check assumption
+	assert( aMethod == CSTR_CREATEAGENT );
+
+	// return error code
+	result = (TResult*)aArgs;
+	return result->iServiceResult;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcMncontroller::StartRPCService( CComponentManager<CSMncontroller> *aComponentManager, void *aArg )
+{
+	assert( iComponentManager == NULL );
+	iComponentManager = aComponentManager;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcMncontroller::StopRPCService()
+{
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/CSvcMncontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Wed Oct 01 17:43:02 2003
+*
+*/
+
+
+
+
+#ifndef __CSVCMNCONTROLLER_H__
+#define __CSVCMNCONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "mncontroller.h"
+#include "CSMncontroller.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcMncontroller
+ * 
+ ***************************************************************************************/
+class CSvcMncontroller
+{
+public:
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSMncontroller> *aComponentManager, void *aArg );
+	static int StopRPCService();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/HOWTO_add_new_methods.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,21 @@
+
+ --**-- HOWTO: Add new methods --**--
+
+ This is just a quick note that describes how to add a new method to an existing service. 
+
+ The problem is that once you've written a service, you've modified the CSvc class and 
+ the CS class, so the code generator can't update these for you. So you have to do a
+ couple of things manually - and this note is to make sure you don't miss something.
+
+ (1) Add to the .x file and regenerate the basic files.
+
+ (2) Add the signature to the CS.h file, put it in the correct order to keep things clean.
+
+ (3) Add the implementation to the CS.cpp file. There is nothing much to remember here,
+	 just make sure you return a normal value (call it rv) and everything is OK. 
+
+ (4) Add a section to the instance keys.
+
+ (5) Add a section to SetError().
+
+ DONE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/MNController.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,206 @@
+# Microsoft Developer Studio Project File - Name="MNController" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=MNController - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "MNController.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "MNController.mak" CFG="MNController - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "MNController - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "MNController - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "MNController"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "MNController - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "MNController - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\External\source_for_build\oncrpc" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libproc.lib libdynconf.lib oncrpcms.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\BinInternal\\" /libpath:"..\..\ExternalSource\binaries"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "MNController - Win32 Release"
+# Name "MNController - Win32 Debug"
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\mncontroller.h
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSMncontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSMncontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcMncontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcMncontroller.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\mncontroller_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mncontroller_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mncontroller_xdr.c
+# End Source File
+# End Group
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\DynamicsCommandWrapper\CDynamicsCommand.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\penstd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_service_manager.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_unix.h
+# End Source File
+# End Group
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\DynamicsCommandWrapper\CDynamicsCommand.cpp
+
+!IF  "$(CFG)" == "MNController - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "MNController - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\mncontroller.x
+
+!IF  "$(CFG)" == "MNController - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "MNController - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\mncontroller.x
+
+"mncontroller.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BuildTools\rpcgen -server  -component_base -wrapstring mncontroller.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\HOWTO_add_new_methods.txt
+
+!IF  "$(CFG)" == "MNController - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "MNController - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/MNController.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "MNController"=.\MNController.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+include /home/penuser/3GNetworkEmulator/Makefile.conf
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=../../bin/mncontroller
+CFLAGS=		-Wall -gstabs #-ftest-coverage -fprofile-arcs
+INCLUDES= -I../include/
+OBJECTS=	CSMncontroller.o		\
+		CSvcMncontroller.o		\
+		mncontroller_svc.o		\
+		mncontroller_svc_stub_impl.o	\
+		mncontroller_xdr.o		
+
+LIBS=-L../../BinInternal/ -lproc -ldynamicsconfig -ldynwrap
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) ../../BinInternal/libproc.a ../../BinInternal/libdynamicsconfig.a ../../BinInternal/libdynwrap.a
+	g++ $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ dyntmp* *.bb *.bbg *.gcov
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/mncontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,470 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __MNCONTROLLER_H__
+#define __MNCONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_INVALID_METHOD -8
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TComponentList(...);
+}
+#else
+bool_t xdr_mncontroller_TComponentList();
+#endif
+
+#define X_MAXINTERFACENAMELEN 64
+#define X_MAXNAILEN 128
+#define X_MAXOPTIONTOKENSIZE 512
+#define X_MAXINFOLEN 128
+#define X_MAXERRORSTRING 256
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_DYNAMICS_CALL_FAILED -107
+#define ERR_CONFIG_FILE_ERROR -108
+#define ERR_POLICY_OUTPUT_PARSING_FAILED -110
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_SET_INTERFACE_ADDRESS_ERROR -112
+#define FP_EARLY_EXPIRE 1
+#define FP_NEWEST_FA 2
+#define FP_EAGER 4
+#define FP_NEWEST_ADV 8
+
+enum TMnTunnelingMode {
+	TM_NO_TUNNEL = 0,
+	TM_FULL_TUNNEL = 1,
+	TM_TRIANGLE_TUNNEL = 2,
+};
+typedef enum TMnTunnelingMode TMnTunnelingMode;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TMnTunnelingMode(...);
+}
+#else
+bool_t xdr_mncontroller_TMnTunnelingMode();
+#endif
+
+
+enum TSetInterfaceErrors {
+	SIE_SOCKET_FAILED = 0,
+	SIE_IOCTL_GET_DESTINATION_ADDRESS_FAILED = 1,
+	SIE_IOCTL_SET_ADDRESS_FAILED = 2,
+	SIE_IOCTL_SET_DESTINATION_ADDRESS_FAILED = 3,
+};
+typedef enum TSetInterfaceErrors TSetInterfaceErrors;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TSetInterfaceErrors(...);
+}
+#else
+bool_t xdr_mncontroller_TSetInterfaceErrors();
+#endif
+
+
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TResult(...);
+}
+#else
+bool_t xdr_mncontroller_TResult();
+#endif
+
+
+struct THomeAddressDesc {
+	int iAgentID;
+	int iHomeAddressPrefix;
+	int iHomeAddress;
+	int iHomeAgentAddress;
+	char iInterfaceName[X_MAXINTERFACENAMELEN];
+};
+typedef struct THomeAddressDesc THomeAddressDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_THomeAddressDesc(...);
+}
+#else
+bool_t xdr_mncontroller_THomeAddressDesc();
+#endif
+
+
+struct TOptionDesc {
+	int iAgentID;
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+typedef struct TOptionDesc TOptionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TOptionDesc(...);
+}
+#else
+bool_t xdr_mncontroller_TOptionDesc();
+#endif
+
+
+struct TTunnelingModeDesc {
+	int iAgentID;
+	TMnTunnelingMode iTunnelMode;
+};
+typedef struct TTunnelingModeDesc TTunnelingModeDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TTunnelingModeDesc(...);
+}
+#else
+bool_t xdr_mncontroller_TTunnelingModeDesc();
+#endif
+
+
+struct TPolicyRequest {
+	int iAgentID;
+	int iPolicy;
+};
+typedef struct TPolicyRequest TPolicyRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TPolicyRequest(...);
+}
+#else
+bool_t xdr_mncontroller_TPolicyRequest();
+#endif
+
+
+struct TForeignAgentInfoRequest {
+	int iAgentID;
+	int iForeignAgentID;
+};
+typedef struct TForeignAgentInfoRequest TForeignAgentInfoRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TForeignAgentInfoRequest(...);
+}
+#else
+bool_t xdr_mncontroller_TForeignAgentInfoRequest();
+#endif
+
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+typedef struct TTimeoutRequest TTimeoutRequest;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TTimeoutRequest(...);
+}
+#else
+bool_t xdr_mncontroller_TTimeoutRequest();
+#endif
+
+
+struct TMobileNodeStatus {
+	TResult iCallResult;
+	int iConnected;
+	int iTunnelUp;
+	u_int iLocalAddress;
+	u_int iColocatedAddress;
+	u_int iForeignAgentAddress;
+	u_int iHomeAgentAddress;
+	u_int iHomeAddress;
+	int iLifetimeRemaining;
+	int iTunnelMode;
+	int iSecondsSinceLastRequest;
+	int iSecondsSinceLastReply;
+	int iReplyCode;
+	char iInfoText[X_MAXINFOLEN];
+	char iLastErrorString[X_MAXERRORSTRING];
+};
+typedef struct TMobileNodeStatus TMobileNodeStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TMobileNodeStatus(...);
+}
+#else
+bool_t xdr_mncontroller_TMobileNodeStatus();
+#endif
+
+
+struct TForeignAgentInfo {
+	TResult iCallResult;
+	u_int iForeignAgentAddress;
+	char iInterfaceName[X_MAXINTERFACENAMELEN];
+	int iPriority;
+	int iInUse;
+	int iInterfaceIndex;
+	int iLastAdvertisement;
+	char iNAI[X_MAXNAILEN];
+	int iAdvertisementExpiry;
+};
+typedef struct TForeignAgentInfo TForeignAgentInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TForeignAgentInfo(...);
+}
+#else
+bool_t xdr_mncontroller_TForeignAgentInfo();
+#endif
+
+
+typedef struct {
+	u_int TForeignAgentList_len;
+	TForeignAgentInfo *TForeignAgentList_val;
+} TForeignAgentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_mncontroller_TForeignAgentList(...);
+}
+#else
+bool_t xdr_mncontroller_TForeignAgentList();
+#endif
+
+
+#define MNCONTROLLER ((u_long)0x34630205)
+#define MNCONTROLLER_VERSION ((u_long)5)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_5( void * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_5();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_5( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_5();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_5( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_5();
+#endif /* __cplusplus */
+#define CSTR_CREATEAGENT ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_createagent_5( void * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_createagent_5();
+#endif /* __cplusplus */
+#define DSTR_REMOVEAGENT ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern int *dstr_removeagent_5( int * arg, CLIENT *cl );
+}
+#else
+extern int *dstr_removeagent_5();
+#endif /* __cplusplus */
+#define STARTMOBILEAGENT ((u_long)3)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *startmobileagent_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *startmobileagent_5();
+#endif /* __cplusplus */
+#define STOPMOBILEAGENT ((u_long)4)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopmobileagent_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopmobileagent_5();
+#endif /* __cplusplus */
+#define GETMOBILEAGENTSTATUS ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getmobileagentstatus_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getmobileagentstatus_5();
+#endif /* __cplusplus */
+#define SETSINGLEOPTION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setsingleoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *setsingleoption_5();
+#endif /* __cplusplus */
+#define REMOVESINGLEOPTION ((u_long)33)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removesingleoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removesingleoption_5();
+#endif /* __cplusplus */
+#define ADDLISTOPTION ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *addlistoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *addlistoption_5();
+#endif /* __cplusplus */
+#define REMOVELISTOPTION ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *removelistoption_5( TOptionDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *removelistoption_5();
+#endif /* __cplusplus */
+#define SETHOMEADDRESS ((u_long)23)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *sethomeaddress_5( THomeAddressDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *sethomeaddress_5();
+#endif /* __cplusplus */
+#define GETCAREOFADDRESS ((u_long)9)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getcareofaddress_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getcareofaddress_5();
+#endif /* __cplusplus */
+#define CONNECT ((u_long)12)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *connect_5( TTunnelingModeDesc * arg, CLIENT *cl );
+}
+#else
+extern TResult *connect_5();
+#endif /* __cplusplus */
+#define DISCONNECT ((u_long)13)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *disconnect_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *disconnect_5();
+#endif /* __cplusplus */
+#define CONFIRM ((u_long)16)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *confirm_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *confirm_5();
+#endif /* __cplusplus */
+#define RESCANINTERFACES ((u_long)17)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *rescaninterfaces_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *rescaninterfaces_5();
+#endif /* __cplusplus */
+#define SETFAPOLICY ((u_long)18)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *setfapolicy_5( TPolicyRequest * arg, CLIENT *cl );
+}
+#else
+extern TResult *setfapolicy_5();
+#endif /* __cplusplus */
+#define GETFAPOLICY ((u_long)19)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *getfapolicy_5( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *getfapolicy_5();
+#endif /* __cplusplus */
+#define GETSTATUS ((u_long)11)
+#ifdef __cplusplus
+extern "C" {
+extern TMobileNodeStatus *getstatus_5( int * arg, CLIENT *cl );
+}
+#else
+extern TMobileNodeStatus *getstatus_5();
+#endif /* __cplusplus */
+#define LISTFOREIGNAGENTS ((u_long)20)
+#ifdef __cplusplus
+extern "C" {
+extern TForeignAgentList *listforeignagents_5( int * arg, CLIENT *cl );
+}
+#else
+extern TForeignAgentList *listforeignagents_5();
+#endif /* __cplusplus */
+#define GETFOREIGNAGENTINFO ((u_long)21)
+#ifdef __cplusplus
+extern "C" {
+extern TForeignAgentInfo *getforeignagentinfo_5( TForeignAgentInfoRequest * arg, CLIENT *cl );
+}
+#else
+extern TForeignAgentInfo *getforeignagentinfo_5();
+#endif /* __cplusplus */
+#define SETTIMEOUT ((u_long)22)
+#ifdef __cplusplus
+extern "C" {
+extern void *settimeout_5( TTimeoutRequest * arg, CLIENT *cl );
+}
+#else
+extern void *settimeout_5();
+#endif /* __cplusplus */
+
+#endif /* __MNCONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/mncontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+
+/*******************************************************************************
+ *
+ * Interface Constants
+ *
+ ******************************************************************************/
+const X_MAXINTERFACENAMELEN		= 64;
+const X_MAXNAILEN				= 128;
+const X_MAXOPTIONTOKENSIZE		= 512;
+const X_MAXINFOLEN              = 128;
+const X_MAXERRORSTRING          = 256;
+
+
+/*******************************************************************************
+ *
+ * Error codes
+ *
+ ******************************************************************************/
+const ERR_WAIT_PROCESS_ERROR			= -103;
+const ERR_START_PROCESS_ERROR			= -105;
+const ERR_STOP_PROCESS_ERROR			= -106;
+const ERR_DYNAMICS_CALL_FAILED			= -107;
+const ERR_CONFIG_FILE_ERROR				= -108;
+const ERR_POLICY_OUTPUT_PARSING_FAILED	= -110;
+const ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE		= -111;
+const ERR_SET_INTERFACE_ADDRESS_ERROR			= -112;
+
+
+/*******************************************************************************
+ *
+ * Constant values passed as parameters
+ *
+ ******************************************************************************/
+const FP_EARLY_EXPIRE	= 1;
+const FP_NEWEST_FA		= 2;
+const FP_EAGER			= 4;
+const FP_NEWEST_ADV		= 8;
+
+enum TMnTunnelingMode {
+	TM_NO_TUNNEL,
+	TM_FULL_TUNNEL,
+	TM_TRIANGLE_TUNNEL
+};
+
+enum TSetInterfaceErrors {
+	SIE_SOCKET_FAILED,
+	SIE_IOCTL_GET_DESTINATION_ADDRESS_FAILED,
+	SIE_IOCTL_SET_ADDRESS_FAILED,
+	SIE_IOCTL_SET_DESTINATION_ADDRESS_FAILED
+};
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+struct TResult {
+	int iServiceResult;
+	int iSubComponentResult;
+	int iData0;
+	int iData1;
+};
+
+struct THomeAddressDesc {
+	int		iAgentID;
+	int		iHomeAddressPrefix;
+	int		iHomeAddress;
+	int		iHomeAgentAddress;
+	char	iInterfaceName[X_MAXINTERFACENAMELEN];
+}; 
+
+struct TOptionDesc {
+	int  iAgentID;
+	char iOptionToken[X_MAXOPTIONTOKENSIZE];
+	char iOptionValue[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockStart[X_MAXOPTIONTOKENSIZE];
+	char iOptionBlockEnd[X_MAXOPTIONTOKENSIZE];
+};
+
+struct TTunnelingModeDesc {
+	int iAgentID;
+	TMnTunnelingMode iTunnelMode;
+};
+
+struct TPolicyRequest {
+	int iAgentID;
+	int iPolicy;
+};
+
+struct TForeignAgentInfoRequest {
+	int iAgentID;
+	int iForeignAgentID;
+};
+
+struct TTimeoutRequest {
+	int iAgentID;
+	int iTimeout;
+};
+
+struct TMobileNodeStatus {
+  TResult iCallResult;
+  int iConnected;
+  int iTunnelUp;
+  unsigned int iLocalAddress;
+  unsigned int iColocatedAddress;
+  unsigned int iForeignAgentAddress;
+  unsigned int iHomeAgentAddress;
+  unsigned int iHomeAddress;
+  int iLifetimeRemaining;
+  int iTunnelMode;
+  int iSecondsSinceLastRequest;
+  int iSecondsSinceLastReply;
+  int iReplyCode;
+  char iInfoText[X_MAXINFOLEN];
+  char iLastErrorString[X_MAXERRORSTRING];
+};
+
+struct TForeignAgentInfo {
+  TResult iCallResult;
+  unsigned int iForeignAgentAddress;
+  char iInterfaceName[X_MAXINTERFACENAMELEN];
+  int iPriority;
+  int iInUse;
+  int iInterfaceIndex;
+  int iLastAdvertisement;
+  char iNAI[X_MAXNAILEN];
+  int iAdvertisementExpiry;
+};
+
+typedef struct TForeignAgentInfo TForeignAgentList<>;
+
+
+/*******************************************************************************
+ *
+ * MNCONTROLLER Interface
+ *
+ ******************************************************************************/
+program MNCONTROLLER {
+	version MNCONTROLLER_VERSION {
+
+		/* Standard Service Management */
+		int SS_STARTUPRPCSERVICE( void )								= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )								= 2;
+		TComponentList LIST_DEVICES( void )								= 30;
+
+		/* Create instances */
+		TResult CSTR_CREATEAGENT( void )								= 31;
+		int DSTR_REMOVEAGENT( int )										= 32;
+
+		/* Start and stop the mobile agent */
+		TResult STARTMOBILEAGENT( int )									= 3;
+		TResult STOPMOBILEAGENT( int )									= 4;
+		TResult GETMOBILEAGENTSTATUS( int )									= 5;
+
+		/* Configure the agent -- must be called before starting the agent */
+		TResult SETSINGLEOPTION( TOptionDesc )							= 6;
+		TResult REMOVESINGLEOPTION( TOptionDesc )						= 33;
+		TResult ADDLISTOPTION( TOptionDesc )							= 7;
+		TResult REMOVELISTOPTION( TOptionDesc )							= 8;
+
+		/* Custom configuration */
+		TResult SETHOMEADDRESS( THomeAddressDesc )						= 23;
+
+		/* Runtime commands */
+		TResult GETCAREOFADDRESS( int )									= 9;
+		TResult CONNECT( TTunnelingModeDesc )							= 12;		
+		TResult DISCONNECT( int )										= 13;
+		TResult CONFIRM( int )											= 16;
+		TResult RESCANINTERFACES( int )									= 17;	
+		TResult SETFAPOLICY( TPolicyRequest )							= 18;
+		TResult GETFAPOLICY( int )										= 19;
+
+		TMobileNodeStatus GETSTATUS( int )								= 11;		
+		TForeignAgentList LISTFOREIGNAGENTS( int )							= 20;		
+		TForeignAgentInfo GETFOREIGNAGENTINFO( TForeignAgentInfoRequest )	= 21;		
+
+		/* Set the timeout for all dynamic commands */
+		void SETTIMEOUT( TTimeoutRequest )								= 22;
+	} = 5; 
+} = 0x34630205;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/mncontroller_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,261 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "mncontroller.h"
+
+static void mncontroller_5();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+	(void)pmap_unset(MNCONTROLLER, MNCONTROLLER_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, MNCONTROLLER, MNCONTROLLER_VERSION, mncontroller_5, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (MNCONTROLLER, MNCONTROLLER_VERSION, udp).\n");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, MNCONTROLLER, MNCONTROLLER_VERSION, mncontroller_5, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (MNCONTROLLER, MNCONTROLLER_VERSION, tcp).\n");
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+	exit(1);
+}
+
+static void
+mncontroller_5(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		int sc_shutdownrpcservice_5_arg;
+		int dstr_removeagent_5_arg;
+		int startmobileagent_5_arg;
+		int stopmobileagent_5_arg;
+		int getmobileagentstatus_5_arg;
+		TOptionDesc setsingleoption_5_arg;
+		TOptionDesc removesingleoption_5_arg;
+		TOptionDesc addlistoption_5_arg;
+		TOptionDesc removelistoption_5_arg;
+		THomeAddressDesc sethomeaddress_5_arg;
+		int getcareofaddress_5_arg;
+		TTunnelingModeDesc connect_5_arg;
+		int disconnect_5_arg;
+		int confirm_5_arg;
+		int rescaninterfaces_5_arg;
+		TPolicyRequest setfapolicy_5_arg;
+		int getfapolicy_5_arg;
+		int getstatus_5_arg;
+		int listforeignagents_5_arg;
+		TForeignAgentInfoRequest getforeignagentinfo_5_arg;
+		TTimeoutRequest settimeout_5_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_5;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_5;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_mncontroller_TComponentList;
+		local = (char *(*)()) list_devices_5;
+		break;
+
+	case CSTR_CREATEAGENT:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) cstr_createagent_5;
+		break;
+
+	case DSTR_REMOVEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) dstr_removeagent_5;
+		break;
+
+	case STARTMOBILEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) startmobileagent_5;
+		break;
+
+	case STOPMOBILEAGENT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) stopmobileagent_5;
+		break;
+
+	case GETMOBILEAGENTSTATUS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) getmobileagentstatus_5;
+		break;
+
+	case SETSINGLEOPTION:
+		xdr_argument = xdr_mncontroller_TOptionDesc;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) setsingleoption_5;
+		break;
+
+	case REMOVESINGLEOPTION:
+		xdr_argument = xdr_mncontroller_TOptionDesc;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) removesingleoption_5;
+		break;
+
+	case ADDLISTOPTION:
+		xdr_argument = xdr_mncontroller_TOptionDesc;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) addlistoption_5;
+		break;
+
+	case REMOVELISTOPTION:
+		xdr_argument = xdr_mncontroller_TOptionDesc;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) removelistoption_5;
+		break;
+
+	case SETHOMEADDRESS:
+		xdr_argument = xdr_mncontroller_THomeAddressDesc;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) sethomeaddress_5;
+		break;
+
+	case GETCAREOFADDRESS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) getcareofaddress_5;
+		break;
+
+	case CONNECT:
+		xdr_argument = xdr_mncontroller_TTunnelingModeDesc;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) connect_5;
+		break;
+
+	case DISCONNECT:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) disconnect_5;
+		break;
+
+	case CONFIRM:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) confirm_5;
+		break;
+
+	case RESCANINTERFACES:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) rescaninterfaces_5;
+		break;
+
+	case SETFAPOLICY:
+		xdr_argument = xdr_mncontroller_TPolicyRequest;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) setfapolicy_5;
+		break;
+
+	case GETFAPOLICY:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TResult;
+		local = (char *(*)()) getfapolicy_5;
+		break;
+
+	case GETSTATUS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TMobileNodeStatus;
+		local = (char *(*)()) getstatus_5;
+		break;
+
+	case LISTFOREIGNAGENTS:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_mncontroller_TForeignAgentList;
+		local = (char *(*)()) listforeignagents_5;
+		break;
+
+	case GETFOREIGNAGENTINFO:
+		xdr_argument = xdr_mncontroller_TForeignAgentInfoRequest;
+		xdr_result = xdr_mncontroller_TForeignAgentInfo;
+		local = (char *(*)()) getforeignagentinfo_5;
+		break;
+
+	case SETTIMEOUT:
+		xdr_argument = xdr_mncontroller_TTimeoutRequest;
+		xdr_result = xdr_void;
+		local = (char *(*)()) settimeout_5;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+		exit(1);
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/mncontroller_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1080 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Tue Nov 11 18:52:30 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcMncontroller.h"
+#include "CSMncontroller.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSMncontroller> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_5( void *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSMncontroller>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcMncontroller::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_5( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcMncontroller::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_5( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_createagent
+ * 
+ ***************************************************************************************/
+TResult *cstr_createagent_5( void *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// create a new component instance
+	instance_key = iComponentManager->CreateInstance();
+	if( instance_key < 0 ) {
+		CSvcMncontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, instance_key );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->cstr_createagent();
+	result = CSvcMncontroller::GetError( CSTR_CREATEAGENT, (void*)&rv );
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	if( result != ERR_NONE ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == 0 );
+	} else { 
+		CSvcMncontroller::SetError( CSTR_CREATEAGENT, (void*)&rv, instance_key );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removeagent
+ * 
+ ***************************************************************************************/
+int *dstr_removeagent_5( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	int should_delete = 1;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( DSTR_REMOVEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		rv = instance_key;
+		return &rv;
+	}
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->dstr_removeagent( *aArgs, &should_delete );
+
+	result = rv;
+
+	// it is illegal for the method to succeed but not delete the instance
+	assert( (result != ERR_NONE) || (should_delete == 1) );
+
+	// delete the instance if requested
+	if( should_delete != 0 ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == ERR_NONE );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: startmobileagent
+ * 
+ ***************************************************************************************/
+TResult *startmobileagent_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( STARTMOBILEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( STARTMOBILEAGENT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->startmobileagent( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopmobileagent
+ * 
+ ***************************************************************************************/
+TResult *stopmobileagent_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( STOPMOBILEAGENT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( STOPMOBILEAGENT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->stopmobileagent( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getmobileagentstatus
+ * 
+ ***************************************************************************************/
+TResult *getmobileagentstatus_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( GETMOBILEAGENTSTATUS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( GETMOBILEAGENTSTATUS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getmobileagentstatus( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setsingleoption
+ * 
+ ***************************************************************************************/
+TResult *setsingleoption_5( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( SETSINGLEOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( SETSINGLEOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->setsingleoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removesingleoption
+ * 
+ ***************************************************************************************/
+TResult *removesingleoption_5( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( REMOVESINGLEOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( REMOVESINGLEOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->removesingleoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: addlistoption
+ * 
+ ***************************************************************************************/
+TResult *addlistoption_5( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( ADDLISTOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( ADDLISTOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->addlistoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: removelistoption
+ * 
+ ***************************************************************************************/
+TResult *removelistoption_5( TOptionDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( REMOVELISTOPTION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( REMOVELISTOPTION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->removelistoption( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sethomeaddress
+ * 
+ ***************************************************************************************/
+TResult *sethomeaddress_5( THomeAddressDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( SETHOMEADDRESS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( SETHOMEADDRESS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( SETHOMEADDRESS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( SETHOMEADDRESS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->sethomeaddress( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getcareofaddress
+ * 
+ ***************************************************************************************/
+TResult *getcareofaddress_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( GETCAREOFADDRESS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( GETCAREOFADDRESS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( GETCAREOFADDRESS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( GETCAREOFADDRESS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getcareofaddress( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: connect
+ * 
+ ***************************************************************************************/
+TResult *connect_5( TTunnelingModeDesc *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( CONNECT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( CONNECT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( CONNECT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( CONNECT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->connect( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: disconnect
+ * 
+ ***************************************************************************************/
+TResult *disconnect_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( DISCONNECT, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( DISCONNECT, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( DISCONNECT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( DISCONNECT, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->disconnect( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: confirm
+ * 
+ ***************************************************************************************/
+TResult *confirm_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( CONFIRM, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( CONFIRM, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( CONFIRM, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( CONFIRM, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->confirm( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: rescaninterfaces
+ * 
+ ***************************************************************************************/
+TResult *rescaninterfaces_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( RESCANINTERFACES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( RESCANINTERFACES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( RESCANINTERFACES, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( RESCANINTERFACES, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->rescaninterfaces( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: setfapolicy
+ * 
+ ***************************************************************************************/
+TResult *setfapolicy_5( TPolicyRequest *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( SETFAPOLICY, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( SETFAPOLICY, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( SETFAPOLICY, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( SETFAPOLICY, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->setfapolicy( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getfapolicy
+ * 
+ ***************************************************************************************/
+TResult *getfapolicy_5( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( GETFAPOLICY, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( GETFAPOLICY, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( GETFAPOLICY, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( GETFAPOLICY, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getfapolicy( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getstatus
+ * 
+ ***************************************************************************************/
+TMobileNodeStatus *getstatus_5( int *aArgs, CLIENT *aDutout )
+{
+	static TMobileNodeStatus rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( GETSTATUS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( GETSTATUS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( GETSTATUS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( GETSTATUS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getstatus( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: listforeignagents
+ * 
+ ***************************************************************************************/
+TForeignAgentList *listforeignagents_5( int *aArgs, CLIENT *aDutout )
+{
+	static TForeignAgentList rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( LISTFOREIGNAGENTS, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( LISTFOREIGNAGENTS, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( LISTFOREIGNAGENTS, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( LISTFOREIGNAGENTS, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->listforeignagents( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getforeignagentinfo
+ * 
+ ***************************************************************************************/
+TForeignAgentInfo *getforeignagentinfo_5( TForeignAgentInfoRequest *aArgs, CLIENT *aDutout )
+{
+	static TForeignAgentInfo rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcMncontroller::SetError( GETFOREIGNAGENTINFO, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcMncontroller::SetError( GETFOREIGNAGENTINFO, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( GETFOREIGNAGENTINFO, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcMncontroller::SetError( GETFOREIGNAGENTINFO, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getforeignagentinfo( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: settimeout
+ * 
+ ***************************************************************************************/
+void *settimeout_5( TTimeoutRequest *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_key;
+	CSMncontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// set the return value to generic error
+	rv = ERR_FAILED_TO_RETRIEVE_KEY;
+
+	// get the key for the instance from the args
+	instance_key = CSvcMncontroller::GetInstanceKeyFromArgs( SETTIMEOUT, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		rv = ERR_INSTANCE_DOES_NOT_EXIST;
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = ERR_NONE;
+	session->settimeout( *aArgs );
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/mncontroller/mncontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "mncontroller.h"
+
+
+bool_t
+xdr_mncontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TMnTunnelingMode(xdrs, objp)
+	XDR *xdrs;
+	TMnTunnelingMode *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TSetInterfaceErrors(xdrs, objp)
+	XDR *xdrs;
+	TSetInterfaceErrors *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iServiceResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSubComponentResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData0)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iData1)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_THomeAddressDesc(xdrs, objp)
+	XDR *xdrs;
+	THomeAddressDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAddressPrefix)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInterfaceName, X_MAXINTERFACENAMELEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TOptionDesc(xdrs, objp)
+	XDR *xdrs;
+	TOptionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionToken, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionValue, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockStart, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iOptionBlockEnd, X_MAXOPTIONTOKENSIZE, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TTunnelingModeDesc(xdrs, objp)
+	XDR *xdrs;
+	TTunnelingModeDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_mncontroller_TMnTunnelingMode(xdrs, &objp->iTunnelMode)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TPolicyRequest(xdrs, objp)
+	XDR *xdrs;
+	TPolicyRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPolicy)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TForeignAgentInfoRequest(xdrs, objp)
+	XDR *xdrs;
+	TForeignAgentInfoRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iForeignAgentID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TTimeoutRequest(xdrs, objp)
+	XDR *xdrs;
+	TTimeoutRequest *objp;
+{
+	if (!xdr_int(xdrs, &objp->iAgentID)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTimeout)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TMobileNodeStatus(xdrs, objp)
+	XDR *xdrs;
+	TMobileNodeStatus *objp;
+{
+	if (!xdr_mncontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iConnected)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelUp)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iLocalAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iColocatedAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iForeignAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iHomeAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLifetimeRemaining)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iTunnelMode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSecondsSinceLastRequest)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSecondsSinceLastReply)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iReplyCode)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInfoText, X_MAXINFOLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iLastErrorString, X_MAXERRORSTRING, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TForeignAgentInfo(xdrs, objp)
+	XDR *xdrs;
+	TForeignAgentInfo *objp;
+{
+	if (!xdr_mncontroller_TResult(xdrs, &objp->iCallResult)) {
+		return (FALSE);
+	}
+	if (!xdr_u_int(xdrs, &objp->iForeignAgentAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInterfaceName, X_MAXINTERFACENAMELEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iPriority)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iInUse)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iInterfaceIndex)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLastAdvertisement)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iNAI, X_MAXNAILEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iAdvertisementExpiry)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_mncontroller_TForeignAgentList(xdrs, objp)
+	XDR *xdrs;
+	TForeignAgentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TForeignAgentList_val, (u_int *)&objp->TForeignAgentList_len, ~0, sizeof(TForeignAgentInfo), (void*)xdr_mncontroller_TForeignAgentInfo)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/CSPppcontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,642 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Oct 17 09:37:12 2003
+*
+*/
+
+
+
+
+/****************************************************************************************
+ * 
+ * System Includes
+ * 
+ ***************************************************************************************/
+#include <stdio.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifndef WIN32
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcPppcontroller.h"
+#include "CSPppcontroller.h"
+#include "../include/standard_unix.h"
+#include "../include/strncpynt.h"
+#include "../DynamicsConfigurationLibrary/file_utilities.h"
+
+
+/****************************************************************************************
+ * 
+ * Definitions
+ * 
+ ***************************************************************************************/
+#define MAXLOGNAME				64
+#define MAXCOMMANDLINE			2048
+#define MAXLOGLINELENGTH		1024
+#define PPPD_BINARY				"./pppd"
+#define GATEWAY_BINARY			"./pppdgateway"
+#define MAXINTERFACENAMESIZE	64
+#define MAXLISTLINES			32
+#define CONNECTED_STRING		"Script /etc/ppp/ip-up finished"
+#define DISCONNECTED_STRING		"Connection terminated"
+
+#define IS_INLINE_WHITESPACE(c)	(((c) == ' ')||((c) == '\t'))
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+CSPppcontroller::CSPppcontroller()
+{
+	iProcess = NULL;
+	iSessionStatus = SS_NOT_STARTED;
+}
+
+CSPppcontroller::~CSPppcontroller()
+{
+	assert( iProcess == NULL );
+}
+
+int CSPppcontroller::GetKey()
+{
+	return iKey;
+}
+
+void CSPppcontroller::SetKey( int aKey )
+{
+	iKey = aKey;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startpppsession
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::cstr_startpppsession( TPppSessionConfig aArgs )
+{
+	int err, errcode;
+	TResult rv = { ERR_NONE, 0, 0 };
+	char logfilename[MAXLOGNAME];
+	char commandline[MAXCOMMANDLINE];
+	TCAProcessError perr;
+
+	// check that we are not already started
+	assert( iProcess == NULL );
+
+	// save the config
+	iSessionConfig = aArgs;
+
+	// construct the name of the logfile
+	snprintf( logfilename, MAXLOGNAME, "pppd%04d.log", iKey );
+
+	// remove the file if it exists -- if an error other than file not exists happens then exit
+	err = unlink( logfilename );
+	if( (err != 0) && (errno != ENOENT) ) {
+		rv.iStandardResult = ERR_LOG_FILE_ERROR;
+		rv.iExtendedCode = 0;
+		rv.iSystemError = errno;
+		return rv;
+	}
+
+	// construct the command line for the PPP session
+#ifndef __UNIT_TEST_13
+	snprintf( commandline, MAXCOMMANDLINE, "%s pty \'%s %s %s %d\' logfile %s %s", PPPD_BINARY, GATEWAY_BINARY, 
+		  iSessionConfig.iMobsterAddress, iSessionConfig.iMobsterPort, iSessionConfig.iMTID, logfilename, iSessionConfig.iSessionConfiguration );
+#else
+	snprintf( commandline, MAXCOMMANDLINE, "%s notty logfile %s %s", PPPD_BINARY, logfilename, iSessionConfig.iSessionConfiguration );
+#endif
+	
+	// now start the process
+	iProcess = new CAProcess();
+	assert( iProcess != NULL );
+	perr = iProcess->StartProcess( commandline, &errcode, false, false, true );
+	if( perr != CAE_NONE ) {
+		rv.iStandardResult = ERR_START_PROCESS_ERROR;
+		rv.iExtendedCode = (int)perr;
+		rv.iSystemError = errcode;
+		delete iProcess;
+		iProcess = NULL;
+		return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removepppsession
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::dstr_removepppsession( int aArgs, int *aDeleteInstance )
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+	char logfilename[MAXLOGNAME];
+
+	// make sure that we still have a process
+	assert( iProcess != NULL );
+
+	// get the status of the process to make sure we are ok
+	perr = iProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus == PS_STARTED ) {
+	  *aDeleteInstance = 0;
+	  rv.iStandardResult = ERR_INVALIDSTATE;
+	  return rv;
+	}
+
+	// remove the log file
+	snprintf( logfilename, MAXLOGNAME, "pppd%04d.log", iKey );
+	unlink( logfilename );
+
+	// ok - remove the process
+	delete iProcess;
+	iProcess = NULL;
+
+	// done - success
+	*aDeleteInstance = 1; 
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: killsession
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::killsession( int aArgs )
+{
+	return StopProcessWithSignal( SIGKILL );
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopsession
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::stopsession( int aArgs )
+{
+	return StopProcessWithSignal( SIGTERM );
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getsessioninfo
+ * 
+ ***************************************************************************************/
+TPppSessionDesc CSPppcontroller::getsessioninfo( int aArgs )
+{
+	TPppSessionDesc rv;
+	TResult res;
+	int exitcode = 0;
+	TCAProcessError perr;
+	TProcessStatus pstatus = PS_INVALID;
+	TProcessExitReason preason = ER_INVALID;
+
+	// check state
+	assert( iProcess != NULL );
+	memset( &rv, 0, sizeof(rv) );
+
+	// interrogate the process	
+	perr = iProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) ) {
+		perr = iProcess->GetExitReason( &preason );
+		assert( perr == CAE_NONE );
+	}
+	if( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) ) {
+		perr = iProcess->GetExitCode( &exitcode );
+		assert( perr == CAE_NONE );
+	}
+
+	// update the dynamic config
+	res = GetInterfaceName();
+	if( res.iStandardResult != ERR_NONE ) {
+		rv.iErrorCode = res.iStandardResult;
+		rv.iErrorDetail = res.iExtendedCode;
+		return rv;
+	}
+	res = UpdateSessionStatus();
+	if( res.iStandardResult != ERR_NONE ) {
+		rv.iErrorCode = res.iStandardResult;
+		rv.iErrorDetail = res.iExtendedCode;
+		return rv;
+	}
+	res = GetIPAddresses();
+	if( res.iStandardResult != ERR_NONE ) {
+		rv.iErrorCode = res.iStandardResult;
+		rv.iErrorDetail = res.iExtendedCode;
+		return rv;
+	}
+
+	// now return the info
+	rv.iErrorCode = ERR_NONE;
+	rv.iErrorDetail = 0;
+	rv.iConfig = iSessionConfig;
+	rv.iProcessStatus = (int)pstatus;
+	rv.iProcessExitReason = (int)preason;
+	rv.iProcessExitCode = exitcode;
+	rv.iSessionStatus = iSessionStatus;
+	STRNCPY_NULL_TERMINATE( rv.iInterfaceName, iInterfaceName.c_str(), MAXSESSIONNAMELEN );
+	rv.iLocalIPAddress = iLocalIPAddress;
+	rv.iRemoteIPAddress = iRemoteIPAddress;
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getppplog
+ * 
+ ***************************************************************************************/
+TVarData CSPppcontroller::getppplog( int aArgs )
+{
+	TVarData rv;
+	TResult res;
+	char logname[MAXLOGNAME];
+
+	// get the logfilename 
+	snprintf( logname, MAXLOGNAME, "pppd%04d.log", iKey );
+
+	// now copy the file into the vardata buffer
+	res = CopyFileIntoBuffer( logname, &rv );
+	if( res.iStandardResult != ERR_NONE ) {
+		assert( rv.TVarData_len == 0 );
+		assert( rv.TVarData_val == NULL );
+	}
+
+	// done
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: StopProcessWithSignal
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::StopProcessWithSignal( int aSignal )
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	TCAProcessError perr;
+	TProcessStatus pstatus;
+
+	// since we create in the constructor and stop in the destructor there must be a process
+	assert( iProcess != NULL );
+
+	// if the process isn't running then it has died outside the scope of this controller, 
+	// clean up the state, return an error since this is noteworthy and should be either 
+	// expected or not happen.
+	perr = iProcess->GetProcessStatus( &pstatus );
+	assert( perr == CAE_NONE );
+	if( pstatus != PS_STARTED ) {
+	  assert( (pstatus == PS_STOPPED) || (pstatus == PS_ABANDONNED) );
+	  rv.iStandardResult = ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE;
+	  return rv;
+	}
+
+	// request the process to stop
+	perr = iProcess->RequestStop( aSignal );
+	if( perr != CAE_NONE ) {
+	  rv.iStandardResult = ERR_STOP_PROCESS_ERROR;
+	  rv.iExtendedCode = (int)perr;
+	  return rv;
+	}
+
+	// wait for the process to stop
+	perr = iProcess->WaitForProcessToTerminate( -1 );
+	if( perr != CAE_NONE ) {
+	  rv.iStandardResult = ERR_WAIT_PROCESS_ERROR;
+	  rv.iExtendedCode = (int)perr;
+	  return rv;
+	}
+
+	// done - success
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: GetInterfaceName
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::GetInterfaceName()
+{
+	TResult rv;
+	string line;
+	char interface_name[MAXINTERFACENAMESIZE];
+
+	// clear the interface (so if not found we don't have an old value)
+	iInterfaceName = "";
+
+	// we want to know the interface name, on line "Using interface pppX";
+	rv = GetTokenFromFile( "Using", &line, MM_FIRST );
+	if( rv.iStandardResult != ERR_NONE ) {
+		if( rv.iStandardResult == ERR_INVALIDARG ) {
+			rv.iStandardResult = ERR_NONE;
+			rv.iExtendedCode = 0;
+		}
+		return rv;
+	}
+
+	// now grab the interface name
+	sscanf( line.c_str(), "Using interface %s", interface_name );
+	iInterfaceName = interface_name;	
+	
+	// done - success;	
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: GetIPAddresses
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::GetIPAddresses()
+{
+	TResult rv;
+	string line;
+	char address[MAXINTERFACENAMESIZE];
+
+	// clear old values
+	iLocalIPAddress = iRemoteIPAddress = 0;
+
+	// we want to know the local IP address
+	rv = GetTokenFromFile( "local  IP address", &line, MM_LAST );
+	if( rv.iStandardResult != ERR_NONE ) {
+	  if( rv.iStandardResult == ERR_INVALIDARG ) {
+	    rv.iStandardResult = ERR_NONE;
+	    rv.iExtendedCode = 0;
+	  }
+	  return rv;
+	}
+
+	// grab address
+	sscanf( line.c_str(), "local  IP address %s", address );
+	iLocalIPAddress = inet_addr( address );
+
+	// we want to know the remote IP address
+	rv = GetTokenFromFile( "remote IP address", &line, MM_LAST );
+	if( rv.iStandardResult != ERR_NONE ) {
+	  if( rv.iStandardResult == ERR_INVALIDARG ) {
+	    rv.iStandardResult = ERR_NONE;
+	    rv.iExtendedCode = 0;
+	  }
+	  return rv;
+	}
+
+	// grab address
+	sscanf( line.c_str(), "remote IP address %s", address );
+	iRemoteIPAddress = inet_addr( address );
+
+	// done - success;	
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: UpdateSessionStatus
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::UpdateSessionStatus()
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	TFUError ferr;
+	int mline[MAXLISTLINES], match_count, errcode, once_connected, disconnected;
+	char logfilename[MAXLOGNAME];
+	struct stat fstat;
+
+	// get the logfilename 
+	snprintf( logfilename, MAXLOGNAME, "pppd%04d.log", iKey );
+
+	// see if the file exists - if not then the status is SS_NOT_STARTED
+	errcode = stat( logfilename, &fstat );
+	if( (errcode == -1) && (errno == ENOENT) ) {
+		iSessionStatus = SS_NOT_STARTED;
+		return rv;
+	}
+
+	// look for the line with the CONNECTED_STRING prefix
+	match_count = MAXLISTLINES;
+	ferr = FindMatchingLinesByRawPrefix( logfilename, CONNECTED_STRING, mline, &match_count, &errcode );
+	if( ferr != FUE_NONE ) {
+		rv.iStandardResult = ERR_LOG_FILE_ERROR;
+		rv.iExtendedCode = (int)ferr;
+		rv.iSystemError = errcode;
+		return rv;
+	}
+	once_connected = ((match_count > 0) ? 1 : 0);
+
+	// look for the line with the DISCONNECTED_STRING prefix
+	match_count = MAXLISTLINES;
+	ferr = FindMatchingLinesByRawPrefix( logfilename, DISCONNECTED_STRING, mline, &match_count, &errcode );
+	if( ferr != FUE_NONE ) {
+		rv.iStandardResult = ERR_LOG_FILE_ERROR;
+		rv.iExtendedCode = (int)ferr;
+		rv.iSystemError = errcode;
+		return rv;
+	}
+	disconnected  = ((match_count > 0) ? 1 : 0);
+
+	// set the state based on the log
+	if( (once_connected == 0) && (disconnected == 0) ) {
+		iSessionStatus = SS_CONNECTING;
+	} else if( (once_connected == 1) && (disconnected == 0) ) {
+		iSessionStatus = SS_CONNECTED;
+	} else if( (once_connected == 1) && (disconnected == 1) ) {
+		iSessionStatus = SS_DISCONNECTED;
+	} else if( (once_connected == 0) && (disconnected == 1) ) {
+		iSessionStatus = SS_DISCONNECTED;
+	}
+			
+	// done - success
+	return rv;
+}
+
+
+/*******************************************************************************
+ *
+ * PRIVATE FUNCTION: CopyFileIntoBuffer
+ *
+ ******************************************************************************/
+TResult CSPppcontroller::CopyFileIntoBuffer( char *aFilename, TVarData *aData )
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	int err;
+	int filesize;
+	int i;
+	char c;
+	FILE *fp;
+
+	// check params
+	assert( aFilename != NULL );
+	assert( aData != NULL );
+
+	// initialise the data to empty
+	aData->TVarData_val = NULL;
+	aData->TVarData_len = 0;
+
+	// open the logfile
+	fp = fopen( aFilename, "rb" );
+	if( fp == NULL ) {
+		rv.iStandardResult = ERR_LOG_FILE_ERROR;
+		rv.iExtendedCode = 0;
+		rv.iSystemError = errno;
+		return rv;
+	}
+
+	// get the file size
+	fseek( fp, 0, SEEK_END );
+	filesize = ftell( fp );
+	fseek( fp, 0, SEEK_SET );
+
+	// if the filesize is zero then just return
+	if( filesize == 0 ) {
+	  return rv;
+	}
+
+	// allocate space for the file data
+	aData->TVarData_val = (char*)calloc( (filesize + 1), 1 );
+	assert( aData->TVarData_val != NULL );
+	aData->TVarData_len = (filesize + 1);
+
+	// now copy the data
+	for( i = 0; i < filesize; i++ ) {
+
+		// read one byte
+		err = fread( &c, 1, 1, fp );
+		if( err != 1 ) {
+			free( aData->TVarData_val );
+			aData->TVarData_val = NULL;
+			aData->TVarData_len = 0;
+			rv.iStandardResult = ERR_LOG_FILE_ERROR;
+			rv.iExtendedCode = 0;
+			rv.iSystemError = errno;
+			fclose( fp );
+			return rv;
+		}
+
+		// save the byte in the buffer
+		(aData->TVarData_val)[i] = c;
+	}
+
+	// cleanup and return 
+	fclose( fp );
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PRIVATE FUNCTION: GetTokenFromFile
+ * 
+ ***************************************************************************************/
+TResult CSPppcontroller::GetTokenFromFile( string aPrefix, string *aLine, TMultiMatchSemantics aMultiMatchSemantics )
+{
+	TResult rv = { ERR_NONE, 0, 0 };
+	TFUError ferr;
+	char logfilename[MAXLOGNAME];
+	char cline[MAXLOGLINELENGTH];
+	int mline[MAXLISTLINES], match_count, errcode, entry;
+	struct stat fstat;
+
+	// check params
+	assert( aLine != NULL );
+
+	// get the logfilename 
+	snprintf( logfilename, MAXLOGNAME, "pppd%04d.log", iKey );
+
+	//	fprintf( stderr, "DEBUG: request for lines starting with '%s'\n", aPrefix.c_str() );
+
+	// see if the file exists - if not then just return - this is NOT an error
+	errcode = stat( logfilename, &fstat );
+	if( (errcode == -1) && (errno == ENOENT) ) {
+		rv.iStandardResult = ERR_INVALIDARG;
+		rv.iExtendedCode = 1;
+		//		fprintf( stderr, "DEBUG: file doesn't exist.\n" );
+		return rv;
+	}
+
+	// look for the lines that match the prefix
+	match_count = MAXLISTLINES;
+	ferr = FindMatchingLinesByRawPrefix( logfilename, (char*)aPrefix.c_str(), mline, &match_count, &errcode );
+	if( ferr != FUE_NONE ) {
+		rv.iStandardResult = ERR_LOG_FILE_ERROR;
+		rv.iExtendedCode = (int)ferr;
+		rv.iSystemError = errcode;
+		//		fprintf( stderr, "DEBUG: error parsing logfile.\n" );
+		return rv;
+	}
+
+	// if there is no match then nothing to do
+	if( match_count == 0 ) {
+		rv.iStandardResult = ERR_INVALIDARG;
+		rv.iExtendedCode = 2;
+		//		fprintf( stderr, "DEBUG: no matches.\n" );
+		return rv;
+	}
+
+	// if there are multiple matches then print warning (just for the admin)
+	if( match_count > 1 ) {
+	  //	  fprintf( stderr, "WARNING: multiple matches for token \"%s\" in '%s'.\n", aPrefix.c_str(), logfilename );  
+	}
+
+	// handle multiple matches
+	if( (aMultiMatchSemantics == MM_ERROR) && (match_count > 1) ) {
+		rv.iStandardResult = ERR_MULTIPLE_MATCHES_IN_LOG_FILE;
+		return rv;
+	}
+	entry = ((aMultiMatchSemantics == MM_FIRST) ? 0 : (match_count-1));
+
+	// now get the matching line 
+	ferr = GetLine( logfilename, mline[entry], cline, MAXLOGLINELENGTH, &errcode );
+	if( ferr != FUE_NONE ) {
+		rv.iStandardResult = ERR_LOG_FILE_ERROR;
+		rv.iExtendedCode = (int)ferr;
+		rv.iSystemError = errcode;
+		//		fprintf( stderr, "DEBUG: error getting the matching line.\n" );
+		return rv;
+	}
+
+	// copy the line into the passed buffer
+	(*aLine) = cline;
+	//	fprintf( stderr, "DEBUG: successfully retrieved line '%s'\n", aLine->c_str() );
+
+	// done - success;	
+	return rv;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/CSPppcontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Oct 17 09:37:12 2003
+*
+*/
+
+
+
+
+#ifndef __CSPPPCONTROLLER_H__
+#define __CSPPPCONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "pppcontroller.h"
+#include "../ProcessLibrary/proclib.h"
+
+
+/****************************************************************************************
+ * 
+ * Types
+ * 
+ ***************************************************************************************/
+typedef enum {
+	MM_FIRST,
+	MM_LAST,
+	MM_ERROR
+} TMultiMatchSemantics;
+
+/****************************************************************************************
+ * 
+ * Definition: CSPppcontroller
+ * 
+ ***************************************************************************************/
+class CSPppcontroller
+{
+public:
+	// Standard Methods
+	CSPppcontroller();
+	~CSPppcontroller();
+	int GetKey();
+	void SetKey( int aKey );
+
+	// RPC Service Methods
+	TResult cstr_startpppsession( TPppSessionConfig aArgs );
+	TResult dstr_removepppsession( int aArgs, int *aDeleteInstance );
+	TResult killsession( int aArgs );
+	TResult stopsession( int aArgs );
+	TPppSessionDesc getsessioninfo( int aArgs );
+	TVarData getppplog( int aArgs );
+
+private:
+	TResult GetInterfaceName();
+	TResult UpdateSessionStatus();
+	TResult CopyFileIntoBuffer( char *aFilename, TVarData *aData );
+	TResult GetTokenFromFile( string aPrefix, string *aToken, TMultiMatchSemantics aMultiMatchSemantics );
+	TResult GetIPAddresses();
+
+	int iKey;
+	CAProcess *iProcess;
+	TResult StopProcessWithSignal( int aSignal );
+	TPppSessionConfig iSessionConfig;
+	string iInterfaceName;
+	TPppSessionStatus iSessionStatus;
+	int iLocalIPAddress;
+	int iRemoteIPAddress;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/CSvcPppcontroller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,215 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Oct 17 09:37:11 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <signal.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcPppcontroller.h"
+#include "pppcontroller.h"
+#include "../include/standard_unix.h"
+#include "../include/standard_service_manager.h"
+
+
+/****************************************************************************************
+ * 
+ * File-scope variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSPppcontroller> *iComponentManager;
+static pid_t iServerProcess;
+
+
+/*******************************************************************************
+ *
+ * SIGNAL HANDLER - SIGTERM: We need pppd to start in our process group so that
+ * we can send signals to it (to stop it). The problem is that when you try
+ * and kill pppd it sends a term signal to everyone in it's process group. So,
+ * we should just ignore SIGTERM and if anyone wants to kill us manually they
+ * can use SIGINT (or SIGKILL in times of need). The problem with this is that
+ * when we fork processes, but before we exec pppd, the child is also ignoring
+ * SIGTERM and if we try and kill it before it is exec'd then it won't die 
+ * and we wait on the pid forever. We could make wait more intelligent
+ * (i.e. timeout and resend the signal) but that is not so nice as waitpid
+ * doesn't have a timeout -- means we have to use WNOHANG and poll every
+ * X seconds which isn't gret. Instead we record the pid of the main process
+ * and check this in the signal handler. If it matches then the signal is
+ * ignored -- otherwise the process is terminated.
+ *
+ ******************************************************************************/
+void handle_sigterm( int sig )
+{
+  pid_t pid, ppid;
+  pid = getpid();
+  if( pid == iServerProcess ) {
+    return;
+  } 
+  ppid = getppid();
+  fprintf( stderr, "INFO: SIGTERM received before exec (pid = %d, ppid = %d).\n", pid, ppid );
+  exit( -1 );
+}
+
+
+/****************************************************************************************
+ * 
+ * Implementation
+ * 
+ ***************************************************************************************/
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetInstanceKeyFromArgs
+ * 
+ ***************************************************************************************/
+int CSvcPppcontroller::GetInstanceKeyFromArgs( int aMethod, void *aArgs )
+{
+	int rv;
+	int *ik_integer;
+	switch( aMethod ) {
+
+	// integer instance keys
+	case DSTR_REMOVEPPPSESSION:
+	case KILLSESSION:
+	case STOPSESSION:
+	case GETSESSIONINFO:
+	case GETPPPLOG:
+		ik_integer = (int*)aArgs;
+		rv = *ik_integer;
+		break;
+
+	// error
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: SetError
+ * 
+ ***************************************************************************************/
+int CSvcPppcontroller::SetError( int aMethod, void *aArgs, int aError )
+{
+	int rv = ERR_NONE;
+	TResult *rv_result;
+	TComponentList *rv_component_list;
+	TPppSessionDesc *rv_session_desc;
+	TVarData *rv_var_data;
+
+	switch( aMethod ) {
+
+	// TComponentList
+	case LIST_DEVICES:
+		SET_LIST_ERROR_CODE( TComponentList, rv_component_list );
+		break;
+
+	// TPppSessionDesc
+	case GETSESSIONINFO:
+		SET_ERROR_CODE( TPppSessionDesc, iErrorCode, rv_session_desc );
+		break;
+
+	// TVarData
+	case GETPPPLOG:
+		SET_LIST_ERROR_CODE( TVarData, rv_var_data );
+		break;
+
+	// TResult return
+	case CSTR_STARTPPPSESSION:
+	case DSTR_REMOVEPPPSESSION:
+	case KILLSESSION:
+	case STOPSESSION:
+		SET_ERROR_CODE( TResult, iStandardResult, rv_result );
+		break;
+
+	// Error
+	default:
+		rv = ERR_INVALID_METHOD;
+		break;
+	}
+	return rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: GetError
+ * 
+ ***************************************************************************************/
+int CSvcPppcontroller::GetError( int aMethod, void *aArgs )
+{
+  TResult *result;
+  
+  // check assumption
+  assert( (aMethod == CSTR_STARTPPPSESSION) || (aMethod == DSTR_REMOVEPPPSESSION) );
+  
+  // return error code
+  result = (TResult*)aArgs;
+  return result->iStandardResult;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StartRPCService
+ * 
+ ***************************************************************************************/
+int CSvcPppcontroller::StartRPCService( CComponentManager<CSPppcontroller> *aComponentManager, TStartupInfo *aArg )
+{	
+	sighandler_t oh;
+
+	// get the server process's ID for the signal handler
+	iServerProcess = getpid();
+
+	// register the sigterm handler
+	oh = signal( SIGTERM, handle_sigterm );
+	if( oh == SIG_ERR ) {
+		return ERR_SET_SIGNAL_ERROR;
+	}
+
+	// setup the component manager
+	assert( iComponentManager == NULL );
+	iComponentManager = aComponentManager;
+	return ERR_NONE;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC: StopRPCService
+ * 
+ ***************************************************************************************/
+int CSvcPppcontroller::StopRPCService()
+{
+	iComponentManager = NULL;
+	return ERR_NONE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/CSvcPppcontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* This file was autogenerated by rpcgen, but should be modified by the developer.
+* Make sure you don't use the -component_mod flag in future or this file will be overwritten.
+* Fri Oct 17 09:37:11 2003
+*
+*/
+
+
+
+
+#ifndef __CSVCPPPCONTROLLER_H__
+#define __CSVCPPPCONTROLLER_H__
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "pppcontroller.h"
+#include "CSPppcontroller.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Definition: CSvcPppcontroller
+ * 
+ ***************************************************************************************/
+class CSvcPppcontroller
+{
+public:
+	static int GetInstanceKeyFromArgs( int aMethod, void *aArgs );
+	static int SetError( int aMethod, void *aArgs, int aError );
+	static int GetError( int aMethod, void *aArgs );
+	static int StartRPCService( CComponentManager<CSPppcontroller> *aComponentManager, TStartupInfo *aArg );
+	static int StopRPCService();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/Makefile	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,37 @@
+##########################################################################
+#
+# Makefile for ...
+#
+##########################################################################
+
+##########################################################################
+#
+# Definitions
+#
+##########################################################################
+TARGET=../../bin/pppcontroller
+INCLUDES=	-I../include
+OBJECTS=	CSPppcontroller.o		\
+		CSvcPppcontroller.o		\
+		pppcontroller_svc.o		\
+		pppcontroller_svc_stub_impl.o	\
+		pppcontroller_xdr.o		
+
+LIBS= -L../../BinInternal/ -L../../ExternalSource/binaries/ -lproc -ldynamicsconfig
+
+##########################################################################
+#
+# Rules
+#
+##########################################################################
+$(TARGET):	$(OBJECTS) ../../BinInternal/libproc.a ../../BinInternal/libdynamicsconfig.a
+	g++ -Wall -gstabs -o $(TARGET) $(OBJECTS) $(LIBS)
+
+%.o:	%.c
+	gcc -Wall -gstabs $(INCLUDES) -c $< -o $@
+
+%.o:	%.cpp
+	g++ -Wall -gstabs $(INCLUDES) -c $< -o $@
+
+clean:
+	rm -r -f $(TARGET) *.o *~ dyntmp*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/pppcontroller.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,193 @@
+# Microsoft Developer Studio Project File - Name="pppcontroller" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=pppcontroller - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "pppcontroller.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "pppcontroller.mak" CFG="pppcontroller - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "pppcontroller - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "pppcontroller - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "pppcontroller - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF  "$(CFG)" == "pppcontroller - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\External\source_for_build\oncrpc" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oncrpcms.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\BinInternal" /libpath:"..\..\External\binaries_for_build"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "pppcontroller - Win32 Release"
+# Name "pppcontroller - Win32 Debug"
+# Begin Group "RPC Generated Files"
+
+# PROP Default_Filter ""
+# Begin Group "include - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\pppcontroller.h
+# End Source File
+# End Group
+# Begin Group "source - nomod"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\pppcontroller_svc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\pppcontroller_svc_stub_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\pppcontroller_xdr.c
+# End Source File
+# End Group
+# Begin Group "modified"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CSPppcontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSPppcontroller.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcPppcontroller.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CSvcPppcontroller.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\include\CComponentManager.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\DynamicsConfigurationLibrary\file_utilities.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ProcessLibrary\proclib.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_service_manager.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\standard_unix.h
+# End Source File
+# End Group
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\pdsnc_service.cpp
+
+!IF  "$(CFG)" == "pppcontroller - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "pppcontroller - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\pppcontroller.x
+
+!IF  "$(CFG)" == "pppcontroller - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "pppcontroller - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\pppcontroller.x
+
+"pppcontroller.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+	..\..\BinInternal\rpcgen -server  -component_base -wrapstring pppcontroller.x
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/pppcontroller.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "pppcontroller"=.\pppcontroller.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/pppcontroller.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef __PPPCONTROLLER_H__
+#define __PPPCONTROLLER_H__
+#include <rpc/types.h>
+#include <rpc/rpc.h>
+
+#define ERR_NONE 0
+#define ERR_INVALID_ERROR_CODE -16
+#define ERR_SERVICE_ALREADY_STARTED -1
+#define ERR_SERVICE_NOT_RUNNING -2
+#define ERR_ACTIVE_USER_SESSIONS -3
+#define ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS -4
+#define ERR_FAILED_TO_CREATE_COMPONENT_MANAGER -5
+#define ERR_FAILED_TO_RETRIEVE_KEY -6
+#define ERR_INSTANCE_DOES_NOT_EXIST -7
+#define ERR_CANNOT_CREATE_NEW_INSTANCE -9
+#define ERR_MISSING_PARAMETER -17
+#define ERR_INVALID_METHOD -8
+#define ERR_STUB_ALREADY_CONNECTED -10
+#define ERR_FAILED_TO_CONNECT -11
+#define ERR_STUB_NOT_CONNECTED -12
+#define ERR_INVALID_RV_POINTER -13
+#define ERR_RPC_ERROR -14
+#define ERR_INVALID_SERVICE -15
+#define ERR_INVALIDARG -50
+#define ERR_INVALIDSTATE -51
+#define ERR_GENERAL -52
+#define INFO_MAXIMUM_OBJECTS 256
+
+typedef struct {
+	u_int TComponentList_len;
+	int *TComponentList_val;
+} TComponentList;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TComponentList(...);
+}
+#else
+bool_t xdr_pppcontroller_TComponentList();
+#endif
+
+#define MAXADDRLEN 64
+#define MAXPORTLEN 16
+#define MAXCONFIGURATIONLENGTH 1024
+#define MAXSESSIONNAMELEN 16
+#define INVALID_SESSION_ID 0xFFFFFFFF
+#define ERR_WAIT_PROCESS_ERROR -103
+#define ERR_START_PROCESS_ERROR -105
+#define ERR_STOP_PROCESS_ERROR -106
+#define ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE -111
+#define ERR_SET_SIGNAL_ERROR -120
+#define ERR_LOG_FILE_ERROR -121
+#define ERR_MULTIPLE_MATCHES_IN_LOG_FILE -122
+
+enum TPppSessionStatus {
+	SS_NOT_STARTED = 0,
+	SS_CONNECTING = 1,
+	SS_CONNECTED = 2,
+	SS_DISCONNECTING = 3,
+	SS_DISCONNECTED = 4,
+};
+typedef enum TPppSessionStatus TPppSessionStatus;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TPppSessionStatus(...);
+}
+#else
+bool_t xdr_pppcontroller_TPppSessionStatus();
+#endif
+
+
+struct TStartupInfo {
+	int iEmpty;
+};
+typedef struct TStartupInfo TStartupInfo;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TStartupInfo(...);
+}
+#else
+bool_t xdr_pppcontroller_TStartupInfo();
+#endif
+
+
+struct TPppSessionConfig {
+	char iMobsterAddress[MAXADDRLEN];
+	char iMobsterPort[MAXPORTLEN];
+	char iSessionConfiguration[MAXCONFIGURATIONLENGTH];
+	int iMTID;
+};
+typedef struct TPppSessionConfig TPppSessionConfig;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TPppSessionConfig(...);
+}
+#else
+bool_t xdr_pppcontroller_TPppSessionConfig();
+#endif
+
+
+struct TPppSessionDesc {
+	int iErrorCode;
+	int iErrorDetail;
+	TPppSessionConfig iConfig;
+	TPppSessionStatus iSessionStatus;
+	char iInterfaceName[MAXSESSIONNAMELEN];
+	int iLocalIPAddress;
+	int iRemoteIPAddress;
+	int iProcessStatus;
+	int iProcessExitReason;
+	int iProcessExitCode;
+};
+typedef struct TPppSessionDesc TPppSessionDesc;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TPppSessionDesc(...);
+}
+#else
+bool_t xdr_pppcontroller_TPppSessionDesc();
+#endif
+
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+typedef struct TResult TResult;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TResult(...);
+}
+#else
+bool_t xdr_pppcontroller_TResult();
+#endif
+
+
+typedef struct {
+	u_int TVarData_len;
+	char *TVarData_val;
+} TVarData;
+#ifdef __cplusplus
+extern "C" {
+bool_t xdr_pppcontroller_TVarData(...);
+}
+#else
+bool_t xdr_pppcontroller_TVarData();
+#endif
+
+
+#define PPPCONTROLLER ((u_long)0x34630204)
+#define PPPCONTROLLER_VERSION ((u_long)4)
+#define SS_STARTUPRPCSERVICE ((u_long)1)
+#ifdef __cplusplus
+extern "C" {
+extern int *ss_startuprpcservice_4( TStartupInfo * arg, CLIENT *cl );
+}
+#else
+extern int *ss_startuprpcservice_4();
+#endif /* __cplusplus */
+#define SC_SHUTDOWNRPCSERVICE ((u_long)2)
+#ifdef __cplusplus
+extern "C" {
+extern int *sc_shutdownrpcservice_4( int * arg, CLIENT *cl );
+}
+#else
+extern int *sc_shutdownrpcservice_4();
+#endif /* __cplusplus */
+#define LIST_DEVICES ((u_long)30)
+#ifdef __cplusplus
+extern "C" {
+extern TComponentList *list_devices_4( void * arg, CLIENT *cl );
+}
+#else
+extern TComponentList *list_devices_4();
+#endif /* __cplusplus */
+#define CSTR_STARTPPPSESSION ((u_long)31)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *cstr_startpppsession_4( TPppSessionConfig * arg, CLIENT *cl );
+}
+#else
+extern TResult *cstr_startpppsession_4();
+#endif /* __cplusplus */
+#define DSTR_REMOVEPPPSESSION ((u_long)32)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *dstr_removepppsession_4( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *dstr_removepppsession_4();
+#endif /* __cplusplus */
+#define KILLSESSION ((u_long)5)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *killsession_4( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *killsession_4();
+#endif /* __cplusplus */
+#define STOPSESSION ((u_long)6)
+#ifdef __cplusplus
+extern "C" {
+extern TResult *stopsession_4( int * arg, CLIENT *cl );
+}
+#else
+extern TResult *stopsession_4();
+#endif /* __cplusplus */
+#define GETSESSIONINFO ((u_long)7)
+#ifdef __cplusplus
+extern "C" {
+extern TPppSessionDesc *getsessioninfo_4( int * arg, CLIENT *cl );
+}
+#else
+extern TPppSessionDesc *getsessioninfo_4();
+#endif /* __cplusplus */
+#define GETPPPLOG ((u_long)8)
+#ifdef __cplusplus
+extern "C" {
+extern TVarData *getppplog_4( int * arg, CLIENT *cl );
+}
+#else
+extern TVarData *getppplog_4();
+#endif /* __cplusplus */
+
+#endif /* __PPPCONTROLLER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/pppcontroller.x	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* Standard Interface Values
+*
+*/
+
+
+#include "../include/penstd.x"
+
+
+/*******************************************************************************
+ *
+ * Constants
+ *
+ ******************************************************************************/
+const MAXADDRLEN				= 64;
+const MAXPORTLEN				= 16;
+const MAXCONFIGURATIONLENGTH	= 1024;
+const MAXSESSIONNAMELEN			= 16;
+const INVALID_SESSION_ID		= 0xFFFFFFFF;
+
+
+/*******************************************************************************
+ *
+ * Error codes
+ *
+ ******************************************************************************/
+const ERR_WAIT_PROCESS_ERROR					= -103;
+const ERR_START_PROCESS_ERROR					= -105;
+const ERR_STOP_PROCESS_ERROR					= -106;
+const ERR_PROCESS_TERMINATED_OUTSIDE_SCOPE		= -111;
+const ERR_SET_SIGNAL_ERROR						= -120;
+const ERR_LOG_FILE_ERROR						= -121;
+const ERR_MULTIPLE_MATCHES_IN_LOG_FILE			= -122;
+
+
+/*******************************************************************************
+ *
+ * Types
+ *
+ ******************************************************************************/
+enum TPppSessionStatus {
+	SS_NOT_STARTED,
+	SS_CONNECTING,
+	SS_CONNECTED,
+	SS_DISCONNECTING,
+	SS_DISCONNECTED
+};
+
+struct TStartupInfo {
+	int iEmpty;
+};
+
+struct TPppSessionConfig {
+	char	iMobsterAddress[MAXADDRLEN];
+	char	iMobsterPort[MAXPORTLEN];
+	char	iSessionConfiguration[MAXCONFIGURATIONLENGTH];
+	int		iMTID;
+};
+
+struct TPppSessionDesc {
+	int iErrorCode;
+	int iErrorDetail;
+	TPppSessionConfig iConfig;
+	TPppSessionStatus iSessionStatus;
+	char iInterfaceName[MAXSESSIONNAMELEN];
+	int iLocalIPAddress;
+	int iRemoteIPAddress;
+	int iProcessStatus;
+	int	iProcessExitReason;
+	int	iProcessExitCode;
+};
+
+struct TResult {
+	int iStandardResult;
+	int iExtendedCode;
+	int iSystemError;
+};
+
+typedef opaque TVarData<>;
+
+
+/*******************************************************************************
+ *
+ * PPPCONTROLLER Interface
+ *
+ ******************************************************************************/
+program PPPCONTROLLER {
+	version PPPCONTROLLER_VERSION {
+
+		/* Initialise the service */
+		int SS_STARTUPRPCSERVICE( TStartupInfo )		= 1;
+		int SC_SHUTDOWNRPCSERVICE( int )				= 2;
+		TComponentList LIST_DEVICES( void )				= 30;
+
+		/* Create Instances */
+		TResult CSTR_STARTPPPSESSION( TPppSessionConfig )	= 31;
+		TResult DSTR_REMOVEPPPSESSION( int )				= 32;
+
+		/* Operate on the instance */
+		TResult KILLSESSION( int )						= 5;
+		TResult STOPSESSION( int )						= 6;
+		TPppSessionDesc GETSESSIONINFO( int )			= 7;
+		TVarData GETPPPLOG( int )						= 8;
+	} = 4;
+} = 0x34630204;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/pppcontroller_svc.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <stdio.h>
+#include <rpc/rpc.h>
+#ifdef WIN32
+#include <rpc/PMAP_CLN.H>
+#else
+#include <rpc/pmap_clnt.h>
+#endif
+#include "pppcontroller.h"
+
+static void pppcontroller_4();
+
+int main( void )
+{
+	SVCXPRT *transp;
+
+	(void)pmap_unset(PPPCONTROLLER, PPPCONTROLLER_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create udp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, PPPCONTROLLER, PPPCONTROLLER_VERSION, pppcontroller_4, IPPROTO_UDP)) {
+		(void)fprintf(stderr, "unable to register (PPPCONTROLLER, PPPCONTROLLER_VERSION, udp).\n");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		(void)fprintf(stderr, "cannot create tcp service.\n");
+		exit(1);
+	}
+	if (!svc_register(transp, PPPCONTROLLER, PPPCONTROLLER_VERSION, pppcontroller_4, IPPROTO_TCP)) {
+		(void)fprintf(stderr, "unable to register (PPPCONTROLLER, PPPCONTROLLER_VERSION, tcp).\n");
+		exit(1);
+	}
+	svc_run();
+	(void)fprintf(stderr, "svc_run returned\n");
+	exit(1);
+}
+
+static void
+pppcontroller_4(rqstp, transp)
+	struct svc_req *rqstp;
+	SVCXPRT *transp;
+{
+	union {
+		TStartupInfo ss_startuprpcservice_4_arg;
+		int sc_shutdownrpcservice_4_arg;
+		TPppSessionConfig cstr_startpppsession_4_arg;
+		int dstr_removepppsession_4_arg;
+		int killsession_4_arg;
+		int stopsession_4_arg;
+		int getsessioninfo_4_arg;
+		int getppplog_4_arg;
+	} argument;
+	char *result;
+	bool_t (*xdr_argument)(), (*xdr_result)();
+	char *(*local)();
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void)svc_sendreply(transp, (void*)xdr_void, (char *)NULL);
+		return;
+
+	case SS_STARTUPRPCSERVICE:
+		xdr_argument = xdr_pppcontroller_TStartupInfo;
+		xdr_result = xdr_int;
+		local = (char *(*)()) ss_startuprpcservice_4;
+		break;
+
+	case SC_SHUTDOWNRPCSERVICE:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_int;
+		local = (char *(*)()) sc_shutdownrpcservice_4;
+		break;
+
+	case LIST_DEVICES:
+		xdr_argument = xdr_void;
+		xdr_result = xdr_pppcontroller_TComponentList;
+		local = (char *(*)()) list_devices_4;
+		break;
+
+	case CSTR_STARTPPPSESSION:
+		xdr_argument = xdr_pppcontroller_TPppSessionConfig;
+		xdr_result = xdr_pppcontroller_TResult;
+		local = (char *(*)()) cstr_startpppsession_4;
+		break;
+
+	case DSTR_REMOVEPPPSESSION:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_pppcontroller_TResult;
+		local = (char *(*)()) dstr_removepppsession_4;
+		break;
+
+	case KILLSESSION:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_pppcontroller_TResult;
+		local = (char *(*)()) killsession_4;
+		break;
+
+	case STOPSESSION:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_pppcontroller_TResult;
+		local = (char *(*)()) stopsession_4;
+		break;
+
+	case GETSESSIONINFO:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_pppcontroller_TPppSessionDesc;
+		local = (char *(*)()) getsessioninfo_4;
+		break;
+
+	case GETPPPLOG:
+		xdr_argument = xdr_int;
+		xdr_result = xdr_pppcontroller_TVarData;
+		local = (char *(*)()) getppplog_4;
+		break;
+
+	default:
+		svcerr_noproc(transp);
+		return;
+	}
+	bzero((char *)&argument, sizeof(argument));
+	if (!svc_getargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		svcerr_decode(transp);
+		return;
+	}
+	result = (*local)(&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (void*)xdr_result, result)) {
+		svcerr_systemerr(transp);
+	}
+	if (!svc_freeargs(transp, (void*)xdr_argument, (void*)&argument)) {
+		(void)fprintf(stderr, "unable to free arguments\n");
+		exit(1);
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/pppcontroller_svc_stub_impl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,449 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+* THIS FILE IS AUTOGENERATED. Do not modify the contents of this file directly
+* as changes will be lost
+* Fri Dec 05 11:06:04 2003
+* System Includes
+*
+*/
+
+
+
+
+#include <assert.h>
+
+
+/****************************************************************************************
+ * 
+ * Local Includes
+ * 
+ ***************************************************************************************/
+#include "CSvcPppcontroller.h"
+#include "CSPppcontroller.h"
+#include "CComponentManager.h"
+
+
+/****************************************************************************************
+ * 
+ * Static Variables
+ * 
+ ***************************************************************************************/
+static CComponentManager<CSPppcontroller> *iComponentManager;
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: ss_startuprpcservice
+ * 
+ ***************************************************************************************/
+int *ss_startuprpcservice_4( TStartupInfo *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+
+	// if the service is already started then return an error
+	if( iComponentManager != NULL ) {
+		rv = ERR_SERVICE_ALREADY_STARTED;
+		return &rv;
+	}
+
+	// create the component manager
+	iComponentManager = new CComponentManager<CSPppcontroller>( INFO_MAXIMUM_OBJECTS );
+	if( iComponentManager == NULL ) {
+		rv = ERR_FAILED_TO_CREATE_COMPONENT_MANAGER;
+		return &rv;
+	}
+
+	// call the custom service manager
+	rv = CSvcPppcontroller::StartRPCService( iComponentManager, aArgs );
+	if( rv != ERR_NONE ) {
+		delete iComponentManager;
+		iComponentManager = NULL;
+		return &rv;
+	}
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: sc_shutdownrpcservice
+ * 
+ ***************************************************************************************/
+int *sc_shutdownrpcservice_4( int *aArgs, CLIENT *aDutout )
+{
+	static int rv;
+	int instance_count;
+	int err;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		rv = ERR_SERVICE_NOT_RUNNING;
+		return &rv;
+	}
+
+	// if there are active sessions and the force flag isn't set then return an error
+	instance_count = iComponentManager->GetInstanceCount();
+	if( (instance_count > 0) && (*aArgs == 0) ) {
+		rv = ERR_ACTIVE_USER_SESSIONS;
+		return &rv;
+	};
+
+	// if the force flag IS set then reset all active connections
+	instance_count = iComponentManager->GetInstanceCount();
+	if( instance_count > 0 ) {
+		err = iComponentManager->DeleteAllInstances();
+		if( err != 0 ) {
+			rv = ERR_FAILED_TO_REMOVE_ACTIVE_SESSIONS;
+			return &rv;
+		}
+	}
+
+	// call the custom service manager
+	rv = CSvcPppcontroller::StopRPCService();
+	if( rv != ERR_NONE ) {
+		return &rv;
+	}
+
+	// delete the component manager
+	delete iComponentManager;
+	iComponentManager = NULL;
+
+	// success
+	rv = ERR_NONE;
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: list_devices
+ * 
+ ***************************************************************************************/
+TComponentList *list_devices_4( void *aArgs, CLIENT *aDutout )
+{
+	static TComponentList rv;
+	int i, valid_count, component_instance_count;
+
+	//free any allocated memory
+	if( rv.TComponentList_val != NULL ) {
+		free( rv.TComponentList_val );
+		rv.TComponentList_val = NULL;
+		rv.TComponentList_len = 0;
+	}
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcPppcontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcPppcontroller::SetError( LIST_DEVICES, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the number of active component instances
+	component_instance_count = iComponentManager->GetInstanceCount();
+
+	// if there are one or more instances then allocate the memory
+	if( component_instance_count > 0 ) {
+		rv.TComponentList_val = (int*)malloc( sizeof(int) * component_instance_count );
+		assert( rv.TComponentList_val != NULL );
+		rv.TComponentList_len = component_instance_count;
+	}
+
+	// store all the currently active IDs in the list
+	for( i = 0, valid_count = 0; i < INFO_MAXIMUM_OBJECTS; i++ ) {
+		if( iComponentManager->IsValidKey(i) != 0 ) {
+			assert( valid_count < component_instance_count );
+			(rv.TComponentList_val)[valid_count++] = i;
+		}
+	}
+
+	// ok return everything
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: cstr_startpppsession
+ * 
+ ***************************************************************************************/
+TResult *cstr_startpppsession_4( TPppSessionConfig *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	CSPppcontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcPppcontroller::SetError( CSTR_STARTPPPSESSION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// create a new component instance
+	instance_key = iComponentManager->CreateInstance();
+	if( instance_key < 0 ) {
+		CSvcPppcontroller::SetError( CSTR_STARTPPPSESSION, (void*)&rv, instance_key );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->cstr_startpppsession( *aArgs );
+	result = CSvcPppcontroller::GetError( CSTR_STARTPPPSESSION, (void*)&rv );
+
+	// if the method fails then we cleanup the instance -- otherwise we set the instance key
+	// as the return value
+	if( result != ERR_NONE ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == 0 );
+	} else { 
+		CSvcPppcontroller::SetError( CSTR_STARTPPPSESSION, (void*)&rv, instance_key );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: dstr_removepppsession
+ * 
+ ***************************************************************************************/
+TResult *dstr_removepppsession_4( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int result;
+	int internal_err;
+	int instance_key;
+	int should_delete = 1;
+	CSPppcontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcPppcontroller::SetError( DSTR_REMOVEPPPSESSION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// get the key for the instance from the args
+	instance_key = CSvcPppcontroller::GetInstanceKeyFromArgs( DSTR_REMOVEPPPSESSION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		CSvcPppcontroller::SetError( DSTR_REMOVEPPPSESSION, (void*)&rv, instance_key );
+		return &rv;
+	}
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcPppcontroller::SetError( DSTR_REMOVEPPPSESSION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->dstr_removepppsession( *aArgs, &should_delete );
+
+	result = CSvcPppcontroller::GetError( DSTR_REMOVEPPPSESSION, (void*)&rv );
+
+	// it is illegal for the method to succeed but not delete the instance
+	assert( (result != ERR_NONE) || (should_delete == 1) );
+
+	// delete the instance if requested
+	if( should_delete != 0 ) {
+		internal_err = iComponentManager->DeleteInstance( instance_key );
+		assert( internal_err == ERR_NONE );
+	}
+
+	// done
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: killsession
+ * 
+ ***************************************************************************************/
+TResult *killsession_4( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSPppcontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcPppcontroller::SetError( KILLSESSION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcPppcontroller::SetError( KILLSESSION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcPppcontroller::GetInstanceKeyFromArgs( KILLSESSION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcPppcontroller::SetError( KILLSESSION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->killsession( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: stopsession
+ * 
+ ***************************************************************************************/
+TResult *stopsession_4( int *aArgs, CLIENT *aDutout )
+{
+	static TResult rv;
+	int instance_key;
+	CSPppcontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcPppcontroller::SetError( STOPSESSION, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcPppcontroller::SetError( STOPSESSION, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcPppcontroller::GetInstanceKeyFromArgs( STOPSESSION, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcPppcontroller::SetError( STOPSESSION, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->stopsession( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getsessioninfo
+ * 
+ ***************************************************************************************/
+TPppSessionDesc *getsessioninfo_4( int *aArgs, CLIENT *aDutout )
+{
+	static TPppSessionDesc rv;
+	int instance_key;
+	CSPppcontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcPppcontroller::SetError( GETSESSIONINFO, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcPppcontroller::SetError( GETSESSIONINFO, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcPppcontroller::GetInstanceKeyFromArgs( GETSESSIONINFO, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcPppcontroller::SetError( GETSESSIONINFO, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getsessioninfo( *aArgs );
+	return &rv;
+}
+
+
+/****************************************************************************************
+ * 
+ * PUBLIC FUNCTION: getppplog
+ * 
+ ***************************************************************************************/
+TVarData *getppplog_4( int *aArgs, CLIENT *aDutout )
+{
+	static TVarData rv;
+	int instance_key;
+	CSPppcontroller *session;
+
+	// check that the service is started
+	if( iComponentManager == NULL ) {
+		CSvcPppcontroller::SetError( GETPPPLOG, (void*)&rv, ERR_SERVICE_NOT_RUNNING );
+		return &rv;
+	}
+
+	// set the return value to generic error
+	CSvcPppcontroller::SetError( GETPPPLOG, (void*)&rv, ERR_FAILED_TO_RETRIEVE_KEY );
+
+	// get the key for the instance from the args
+	instance_key = CSvcPppcontroller::GetInstanceKeyFromArgs( GETPPPLOG, (void*)aArgs );
+	if( instance_key < 0 ) {
+		return &rv;
+	}
+
+	// make sure the key is valid
+	if( iComponentManager->IsValidKey(instance_key) == 0 ) {
+		CSvcPppcontroller::SetError( GETPPPLOG, (void*)&rv, ERR_INSTANCE_DOES_NOT_EXIST );
+		return &rv;
+	}
+
+	// get the instance
+	session = iComponentManager->GetInstance( instance_key );
+	assert( session != NULL );
+
+	// call the corresponding method on the instance
+	rv = session->getppplog( *aArgs );
+	return &rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/pppcontroller/pppcontroller_xdr.c	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include <rpc/rpc.h>
+#include "pppcontroller.h"
+
+
+bool_t
+xdr_pppcontroller_TComponentList(xdrs, objp)
+	XDR *xdrs;
+	TComponentList *objp;
+{
+	if (!xdr_array(xdrs, (char **)&objp->TComponentList_val, (u_int *)&objp->TComponentList_len, ~0, sizeof(int), (void*)xdr_int)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TPppSessionStatus(xdrs, objp)
+	XDR *xdrs;
+	TPppSessionStatus *objp;
+{
+	if (!xdr_enum(xdrs, (enum_t *)objp)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TStartupInfo(xdrs, objp)
+	XDR *xdrs;
+	TStartupInfo *objp;
+{
+	if (!xdr_int(xdrs, &objp->iEmpty)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TPppSessionConfig(xdrs, objp)
+	XDR *xdrs;
+	TPppSessionConfig *objp;
+{
+	if (!xdr_vector(xdrs, (char *)objp->iMobsterAddress, MAXADDRLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iMobsterPort, MAXPORTLEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iSessionConfiguration, MAXCONFIGURATIONLENGTH, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iMTID)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TPppSessionDesc(xdrs, objp)
+	XDR *xdrs;
+	TPppSessionDesc *objp;
+{
+	if (!xdr_int(xdrs, &objp->iErrorCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iErrorDetail)) {
+		return (FALSE);
+	}
+	if (!xdr_pppcontroller_TPppSessionConfig(xdrs, &objp->iConfig)) {
+		return (FALSE);
+	}
+	if (!xdr_pppcontroller_TPppSessionStatus(xdrs, &objp->iSessionStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_vector(xdrs, (char *)objp->iInterfaceName, MAXSESSIONNAMELEN, sizeof(char), (void*)xdr_char)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iLocalIPAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iRemoteIPAddress)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessStatus)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitReason)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iProcessExitCode)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TResult(xdrs, objp)
+	XDR *xdrs;
+	TResult *objp;
+{
+	if (!xdr_int(xdrs, &objp->iStandardResult)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iExtendedCode)) {
+		return (FALSE);
+	}
+	if (!xdr_int(xdrs, &objp->iSystemError)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
+
+
+bool_t
+xdr_pppcontroller_TVarData(xdrs, objp)
+	XDR *xdrs;
+	TVarData *objp;
+{
+	if (!xdr_bytes(xdrs, (char **)&objp->TVarData_val, (u_int *)&objp->TVarData_len, ~0)) {
+		return (FALSE);
+	}
+	return (TRUE);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Source/readme.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1 @@
+Source for deliverable binaries should go here.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+09:53:21:060 <html><body><pre>
+09:53:21:060 *** TestExecute Started 10/06/2005 09:53:21:060 ***
+09:53:21:070 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+09:53:21:070 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+09:53:21:070 c:\ucc\master.script LOAD_SUITE UCCControlTE
+09:53:21:130 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+09:53:21:858 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+09:53:21:873 <font size=2 color=00AF00>c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+09:53:21:873 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+09:53:21:989 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+09:53:22:004 <font size=2 color=00AF00>c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+09:53:22:009 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+09:53:43:435 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+09:53:43:450 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+09:53:43:450 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:53:43:948 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+09:53:43:963 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:53:43:968 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:53:59:628 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+09:53:59:643 <font size=2 color=00AF00>c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:53:59:648 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:54:00:140 INFO -  115 CUCCTest.cpp 405 UCC Call Result = 0
+09:54:00:155 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:54:00:160 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:54:15:798 INFO -  116 CUCCTest.cpp 405 UCC Call Result = 0
+09:54:15:813 <font size=2 color=00AF00>c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:54:15:818 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:54:18:450 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+09:54:18:465 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:54:18:465 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:54:34:095 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+09:54:34:110 <font size=2 color=00AF00>c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:54:34:110 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:54:36:738 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+09:54:36:753 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:54:36:758 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:54:52:390 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+09:54:52:405 <font size=2 color=00AF00>c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:54:52:405 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+09:55:13:658 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+09:55:13:673 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+09:55:13:678 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+09:55:13:783 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+09:55:13:798 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+09:55:13:803 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+09:55:13:913 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+09:55:13:928 <font size=2 color=00AF00>c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+09:55:13:933 <font size=2 color=00AFFF>SUMMARY:</font>
+09:55:13:933 <font size=2 color=00AF00>PASS = 14</font>
+09:55:13:938 <font size=2 color=FF0000>FAIL = 0</font>
+09:55:13:938 <font size=2 color=0000FF>ABORT = 0</font>
+09:55:13:938 <font size=2 color=0000FF>PANIC = 0</font>
+09:55:13:938 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+09:55:13:938 <font size=2 color=0000FF>UNKNOWN = 0</font>
+09:55:13:938 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+09:55:13:938 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:00:39:895 <html><body><pre>
+12:00:39:897 *** TestExecute Started 09/06/2005 12:00:39:897 ***
+12:00:39:911 c:\ucc\slave.script PRINT Synchronised test cases
+12:00:39:913 INFO -  110 Scriptengine.cpp 876  Synchronised test cases
+
+12:00:39:918 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:00:39:949 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:00:39:953 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:00:45:958 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:00:45:959 INFO -  110 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:00:45:967 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:00:45:985 INFO -  118 Samplestep.cpp 102 Test Step Preamble
+12:00:45:986 INFO -  118 Samplestep.cpp 114 doTestStepL
+12:00:50:984 INFO -  118 Samplestep.cpp 127 Test Step Postamble
+12:00:50:989 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:00:50:998 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:00:51:019 INFO -  121 Samplestep.cpp 102 Test Step Preamble
+12:00:51:020 INFO -  121 Samplestep.cpp 114 doTestStepL
+12:00:56:015 INFO -  121 Samplestep.cpp 127 Test Step Postamble
+12:00:56:020 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:00:56:026 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:00:56:034 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:00:56:040 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:00:56:042 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:01:02:036 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:01:02:038 INFO -  110 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:01:02:046 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:01:02:063 INFO -  124 Samplestep.cpp 102 Test Step Preamble
+12:01:02:064 INFO -  124 Samplestep.cpp 114 doTestStepL
+12:01:07:062 INFO -  124 Samplestep.cpp 127 Test Step Postamble
+12:01:07:067 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:01:07:076 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:01:07:093 INFO -  125 Samplestep.cpp 102 Test Step Preamble
+12:01:07:094 INFO -  125 Samplestep.cpp 114 doTestStepL
+12:01:12:093 INFO -  125 Samplestep.cpp 127 Test Step Postamble
+12:01:12:098 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:01:12:105 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:01:12:113 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:01:12:120 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:01:12:122 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:01:20:114 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:01:20:116 INFO -  110 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:01:20:124 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:01:20:141 INFO -  126 Samplestep.cpp 102 Test Step Preamble
+12:01:20:142 INFO -  126 Samplestep.cpp 114 doTestStepL
+12:01:25:140 INFO -  126 Samplestep.cpp 127 Test Step Postamble
+12:01:25:145 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:01:25:167 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:01:25:184 INFO -  127 Samplestep.cpp 102 Test Step Preamble
+12:01:25:185 INFO -  127 Samplestep.cpp 114 doTestStepL
+12:01:30:187 INFO -  127 Samplestep.cpp 127 Test Step Postamble
+12:01:30:192 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:01:30:220 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:01:30:230 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:01:30:256 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:01:30:258 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:01:38:274 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:01:38:276 INFO -  110 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:01:38:303 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:01:38:320 INFO -  128 Samplestep.cpp 102 Test Step Preamble
+12:01:38:321 INFO -  128 Samplestep.cpp 114 doTestStepL
+12:01:43:312 INFO -  128 Samplestep.cpp 127 Test Step Postamble
+12:01:43:317 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:01:43:345 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:01:43:362 INFO -  129 Samplestep.cpp 102 Test Step Preamble
+12:01:43:363 INFO -  129 Samplestep.cpp 114 doTestStepL
+12:01:48:359 INFO -  129 Samplestep.cpp 127 Test Step Postamble
+12:01:48:364 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:01:48:390 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:01:48:401 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:01:54:406 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:01:54:408 <font size=2 color=00AF00>PASS = 8</font>
+12:01:54:409 <font size=2 color=FF0000>FAIL = 0</font>
+12:01:54:411 <font size=2 color=0000FF>ABORT = 0</font>
+12:01:54:412 <font size=2 color=0000FF>PANIC = 0</font>
+12:01:54:414 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:01:54:416 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:01:54:417 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:01:54:419 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:01:54:421 <font size=2 color=00AF00>PASS = 4</font>
+12:01:54:423 <font size=2 color=FF0000>FAIL = 0</font>
+12:01:54:424 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:01:54:426 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-TCP/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+10:52:53:935 <html><body><pre>
+10:52:53:935 *** TestExecute Started 10/06/2005 10:52:53:935 ***
+10:52:53:940 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+10:52:53:940 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+10:52:53:940 c:\ucc\master.script LOAD_SUITE UCCControlTE
+10:52:53:993 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+10:52:54:900 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+10:52:54:915 <font size=2 color=00AF00>c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+10:52:54:915 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+10:52:55:030 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+10:52:55:045 <font size=2 color=00AF00>c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+10:52:55:045 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+10:53:17:180 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+10:53:17:195 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+10:53:17:195 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+10:53:19:200 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+10:53:19:215 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+10:53:19:220 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:53:37:530 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+10:53:37:540 <font size=2 color=00AF00>c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:53:37:545 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+10:53:39:633 INFO -  115 CUCCTest.cpp 405 UCC Call Result = 0
+10:53:39:648 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+10:53:39:653 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:53:54:817 INFO -  118 CUCCTest.cpp 405 UCC Call Result = 0
+10:53:54:832 <font size=2 color=00AF00>c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:53:54:837 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+10:53:59:945 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+10:53:59:960 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+10:53:59:965 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:54:15:115 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+10:54:15:130 <font size=2 color=00AF00>c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:54:15:135 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+10:54:20:275 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+10:54:20:285 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+10:54:20:290 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:54:35:460 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+10:54:35:475 <font size=2 color=00AF00>c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:54:35:475 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+10:54:58:460 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+10:54:58:475 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+10:54:58:475 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+10:54:58:585 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+10:54:58:600 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+10:54:58:605 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+10:54:58:715 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+10:54:58:735 <font size=2 color=00AF00>c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+10:54:58:740 <font size=2 color=00AFFF>SUMMARY:</font>
+10:54:58:745 <font size=2 color=00AF00>PASS = 14</font>
+10:54:58:745 <font size=2 color=FF0000>FAIL = 0</font>
+10:54:58:745 <font size=2 color=0000FF>ABORT = 0</font>
+10:54:58:745 <font size=2 color=0000FF>PANIC = 0</font>
+10:54:58:745 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+10:54:58:745 <font size=2 color=0000FF>UNKNOWN = 0</font>
+10:54:58:745 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+10:54:58:745 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-TCP/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:02:09:456 <html><body><pre>
+12:02:09:458 *** TestExecute Started 10/06/2005 12:02:09:458 ***
+12:02:09:473 c:\ucc\slave.script PRINT Synchronised test cases
+12:02:09:474 INFO -  119 Scriptengine.cpp 876  Synchronised test cases
+
+12:02:09:480 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:02:09:511 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:02:09:515 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:02:15:520 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:02:15:521 INFO -  119 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:02:15:530 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:02:15:548 INFO -  125 Samplestep.cpp 102 Test Step Preamble
+12:02:15:549 INFO -  125 Samplestep.cpp 114 doTestStepL
+12:02:20:546 INFO -  125 Samplestep.cpp 127 Test Step Postamble
+12:02:20:552 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:02:20:561 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:02:20:581 INFO -  126 Samplestep.cpp 102 Test Step Preamble
+12:02:20:582 INFO -  126 Samplestep.cpp 114 doTestStepL
+12:02:25:578 INFO -  126 Samplestep.cpp 127 Test Step Postamble
+12:02:25:584 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:02:25:590 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:02:25:598 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:02:25:604 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:02:25:607 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:02:35:598 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:02:35:600 INFO -  119 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:02:35:608 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:02:35:626 INFO -  127 Samplestep.cpp 102 Test Step Preamble
+12:02:35:627 INFO -  127 Samplestep.cpp 114 doTestStepL
+12:02:40:625 INFO -  127 Samplestep.cpp 127 Test Step Postamble
+12:02:40:631 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:02:40:639 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:02:40:658 INFO -  128 Samplestep.cpp 102 Test Step Preamble
+12:02:40:659 INFO -  128 Samplestep.cpp 114 doTestStepL
+12:02:45:656 INFO -  128 Samplestep.cpp 127 Test Step Postamble
+12:02:45:662 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:02:45:668 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:02:45:677 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:02:45:684 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:02:45:686 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:02:55:692 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:02:55:693 INFO -  119 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:02:55:702 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:02:55:720 INFO -  129 Samplestep.cpp 102 Test Step Preamble
+12:02:55:721 INFO -  129 Samplestep.cpp 114 doTestStepL
+12:03:00:718 INFO -  129 Samplestep.cpp 127 Test Step Postamble
+12:03:00:724 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:03:00:745 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:03:00:764 INFO -  130 Samplestep.cpp 102 Test Step Preamble
+12:03:00:765 INFO -  130 Samplestep.cpp 114 doTestStepL
+12:03:05:765 INFO -  130 Samplestep.cpp 127 Test Step Postamble
+12:03:05:771 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:03:05:798 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:03:05:809 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:03:05:834 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:03:05:837 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:03:15:852 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:03:15:853 INFO -  119 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:03:15:881 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:03:15:899 INFO -  131 Samplestep.cpp 102 Test Step Preamble
+12:03:15:900 INFO -  131 Samplestep.cpp 114 doTestStepL
+12:03:20:890 INFO -  131 Samplestep.cpp 127 Test Step Postamble
+12:03:20:896 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:03:20:923 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:03:20:942 INFO -  132 Samplestep.cpp 102 Test Step Preamble
+12:03:20:943 INFO -  132 Samplestep.cpp 114 doTestStepL
+12:03:25:937 INFO -  132 Samplestep.cpp 127 Test Step Postamble
+12:03:25:943 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:03:25:969 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:03:25:981 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:03:32:031 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:03:32:033 <font size=2 color=00AF00>PASS = 8</font>
+12:03:32:034 <font size=2 color=FF0000>FAIL = 0</font>
+12:03:32:036 <font size=2 color=0000FF>ABORT = 0</font>
+12:03:32:038 <font size=2 color=0000FF>PANIC = 0</font>
+12:03:32:040 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:03:32:041 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:03:32:043 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:03:32:045 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:03:32:046 <font size=2 color=00AF00>PASS = 4</font>
+12:03:32:048 <font size=2 color=FF0000>FAIL = 0</font>
+12:03:32:050 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:03:32:052 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/BasicSync/TCP-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+11:19:49:956 <html><body><pre>
+11:19:49:956 *** TestExecute Started 10/06/2005 11:19:49:956 ***
+11:19:49:961 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - TCP
+11:19:49:961 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - TCP
+
+11:19:49:961 c:\ucc\master.script LOAD_SUITE UCCControlTE
+11:19:50:020 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+11:20:06:623 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+11:20:06:633 <font size=2 color=00AF00>c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+11:20:06:668 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+11:20:06:996 INFO -  102 CUCCTest.cpp 405 UCC Call Result = 0
+11:20:07:000 <font size=2 color=00AF00>c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+11:20:07:035 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+11:20:32:991 INFO -  103 CUCCTest.cpp 405 UCC Call Result = 0
+11:20:32:996 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+11:20:33:030 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:20:33:733 INFO -  104 CUCCTest.cpp 405 UCC Call Result = 0
+11:20:33:738 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:20:33:773 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:20:49:678 INFO -  105 CUCCTest.cpp 405 UCC Call Result = 0
+11:20:49:683 <font size=2 color=00AF00>c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:20:49:683 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:20:52:564 INFO -  106 CUCCTest.cpp 405 UCC Call Result = 0
+11:20:52:564 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:20:52:603 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:21:06:344 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:06:349 <font size=2 color=00AF00>c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:21:06:384 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:21:09:264 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:09:264 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:21:09:304 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:21:23:035 INFO -  109 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:23:035 <font size=2 color=00AF00>c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:21:23:040 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:21:23:818 INFO -  110 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:23:818 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:21:23:858 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:21:39:748 INFO -  111 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:39:753 <font size=2 color=00AF00>c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:21:39:788 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+11:21:58:663 INFO -  112 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:58:663 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+11:21:58:668 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+11:21:59:040 INFO -  113 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:59:045 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+11:21:59:045 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+11:21:59:444 INFO -  114 CUCCTest.cpp 405 UCC Call Result = 0
+11:21:59:444 <font size=2 color=00AF00>c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+11:21:59:489 <font size=2 color=00AFFF>SUMMARY:</font>
+11:21:59:494 <font size=2 color=00AF00>PASS = 14</font>
+11:21:59:494 <font size=2 color=FF0000>FAIL = 0</font>
+11:21:59:494 <font size=2 color=0000FF>ABORT = 0</font>
+11:21:59:494 <font size=2 color=0000FF>PANIC = 0</font>
+11:21:59:494 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+11:21:59:494 <font size=2 color=0000FF>UNKNOWN = 0</font>
+11:21:59:494 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+11:21:59:494 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/BasicSync/TCP-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:04:47:810 <html><body><pre>
+12:04:47:812 *** TestExecute Started 09/06/2005 12:04:47:812 ***
+12:04:47:826 c:\ucc\slave.script PRINT Synchronised test cases
+12:04:47:828 INFO -  116 Scriptengine.cpp 876  Synchronised test cases
+
+12:04:47:833 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:04:47:864 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:04:47:869 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:04:53:864 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:04:53:865 INFO -  116 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:04:53:874 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:53:891 INFO -  122 Samplestep.cpp 102 Test Step Preamble
+12:04:53:892 INFO -  122 Samplestep.cpp 114 doTestStepL
+12:04:58:890 INFO -  122 Samplestep.cpp 127 Test Step Postamble
+12:04:58:895 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:04:58:904 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:58:921 INFO -  123 Samplestep.cpp 102 Test Step Preamble
+12:04:58:922 INFO -  123 Samplestep.cpp 114 doTestStepL
+12:05:03:921 INFO -  123 Samplestep.cpp 127 Test Step Postamble
+12:05:03:926 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:03:932 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:05:03:939 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:05:03:945 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:05:03:948 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:05:11:942 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:05:11:943 INFO -  116 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:05:11:952 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:11:969 INFO -  124 Samplestep.cpp 102 Test Step Preamble
+12:05:11:970 INFO -  124 Samplestep.cpp 114 doTestStepL
+12:05:16:968 INFO -  124 Samplestep.cpp 127 Test Step Postamble
+12:05:16:973 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:16:981 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:16:998 INFO -  125 Samplestep.cpp 102 Test Step Preamble
+12:05:17:002 INFO -  125 Samplestep.cpp 114 doTestStepL
+12:05:22:001 INFO -  125 Samplestep.cpp 127 Test Step Postamble
+12:05:22:006 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:22:012 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:05:22:020 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:05:22:029 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:05:22:031 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:05:28:036 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:05:28:038 INFO -  116 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:05:28:046 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:28:063 INFO -  126 Samplestep.cpp 102 Test Step Preamble
+12:05:28:064 INFO -  126 Samplestep.cpp 114 doTestStepL
+12:05:33:062 INFO -  126 Samplestep.cpp 127 Test Step Postamble
+12:05:33:067 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:33:088 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:33:105 INFO -  127 Samplestep.cpp 102 Test Step Preamble
+12:05:33:107 INFO -  127 Samplestep.cpp 114 doTestStepL
+12:05:38:109 INFO -  127 Samplestep.cpp 127 Test Step Postamble
+12:05:38:114 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:38:141 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:38:151 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:05:38:177 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:38:180 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:05:44:195 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:05:44:197 INFO -  116 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:05:44:224 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:44:241 INFO -  128 Samplestep.cpp 102 Test Step Preamble
+12:05:44:242 INFO -  128 Samplestep.cpp 114 doTestStepL
+12:05:49:234 INFO -  128 Samplestep.cpp 127 Test Step Postamble
+12:05:49:239 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:49:266 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:49:284 INFO -  129 Samplestep.cpp 102 Test Step Preamble
+12:05:49:285 INFO -  129 Samplestep.cpp 114 doTestStepL
+12:05:54:281 INFO -  129 Samplestep.cpp 127 Test Step Postamble
+12:05:54:286 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:54:311 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:05:54:323 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:06:00:328 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:06:00:329 <font size=2 color=00AF00>PASS = 8</font>
+12:06:00:331 <font size=2 color=FF0000>FAIL = 0</font>
+12:06:00:333 <font size=2 color=0000FF>ABORT = 0</font>
+12:06:00:334 <font size=2 color=0000FF>PANIC = 0</font>
+12:06:00:336 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:06:00:338 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:06:00:339 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:06:00:341 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:06:00:342 <font size=2 color=00AF00>PASS = 4</font>
+12:06:00:344 <font size=2 color=FF0000>FAIL = 0</font>
+12:06:00:346 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:06:00:348 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+09:57:41:915 <html><body><pre>
+09:57:41:915 *** TestExecute Started 10/06/2005 09:57:41:915 ***
+09:57:41:925 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+09:57:41:925 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+09:57:41:925 c:\ucc\master.script PRINT
+09:57:41:925 INFO -  53 ScriptEngine.cpp 876 
+
+09:57:41:925 c:\ucc\master.script PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+09:57:41:925 INFO -  53 ScriptEngine.cpp 876  Using SetSharedData to initiate the slave side synchronised test blocks
+
+09:57:41:925 c:\ucc\master.script LOAD_SUITE UCCControlTE
+09:57:42:000 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+09:57:42:770 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+09:57:42:785 <font size=2 color=00AF00>c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+09:57:42:785 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+09:57:42:900 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+09:57:42:915 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+09:57:42:915 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+09:58:04:455 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:04:470 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+09:58:04:475 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:58:04:822 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:04:842 <font size=2 color=00AF00>c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:58:04:842 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:58:18:346 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:18:361 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:58:18:366 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:58:18:707 INFO -  113 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:18:722 <font size=2 color=00AF00>c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:58:18:727 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:58:34:366 INFO -  114 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:34:381 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:58:34:381 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:58:34:722 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:34:737 <font size=2 color=00AF00>c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:58:34:742 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:58:50:371 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:50:386 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:58:50:386 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:58:50:732 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+09:58:50:747 <font size=2 color=00AF00>c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:58:50:747 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:59:06:371 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+09:59:06:386 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:59:06:386 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+09:59:24:366 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+09:59:24:376 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+09:59:24:381 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+09:59:24:491 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+09:59:24:506 <font size=2 color=00AF00>c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+09:59:24:506 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+09:59:24:616 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+09:59:24:631 <font size=2 color=00AF00>c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+09:59:24:641 <font size=2 color=00AFFF>SUMMARY:</font>
+09:59:24:641 <font size=2 color=00AF00>PASS = 14</font>
+09:59:24:641 <font size=2 color=FF0000>FAIL = 0</font>
+09:59:24:641 <font size=2 color=0000FF>ABORT = 0</font>
+09:59:24:641 <font size=2 color=0000FF>PANIC = 0</font>
+09:59:24:641 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+09:59:24:641 <font size=2 color=0000FF>UNKNOWN = 0</font>
+09:59:24:641 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+09:59:24:641 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:05:00:438 <html><body><pre>
+12:05:00:440 *** TestExecute Started 09/06/2005 12:05:00:440 ***
+12:05:00:454 c:\ucc\slave.script PRINT Synchronised test cases
+12:05:00:456 INFO -  143 Scriptengine.cpp 876  Synchronised test cases
+
+12:05:00:461 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:05:00:491 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:05:00:496 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:05:06:489 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:05:06:490 INFO -  143 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:05:06:498 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:06:515 INFO -  149 Samplestep.cpp 102 Test Step Preamble
+12:05:06:516 INFO -  149 Samplestep.cpp 114 doTestStepL
+12:05:11:515 INFO -  149 Samplestep.cpp 127 Test Step Postamble
+12:05:11:520 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:11:529 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:11:546 INFO -  150 Samplestep.cpp 102 Test Step Preamble
+12:05:11:547 INFO -  150 Samplestep.cpp 114 doTestStepL
+12:05:16:546 INFO -  150 Samplestep.cpp 127 Test Step Postamble
+12:05:16:551 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:16:557 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:05:16:564 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:05:16:570 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:05:16:573 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:05:20:567 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:05:20:569 INFO -  143 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:05:20:578 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:20:595 INFO -  151 Samplestep.cpp 102 Test Step Preamble
+12:05:20:596 INFO -  151 Samplestep.cpp 114 doTestStepL
+12:05:25:593 INFO -  151 Samplestep.cpp 127 Test Step Postamble
+12:05:25:598 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:25:606 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:25:624 INFO -  152 Samplestep.cpp 102 Test Step Preamble
+12:05:25:625 INFO -  152 Samplestep.cpp 114 doTestStepL
+12:05:30:625 INFO -  152 Samplestep.cpp 127 Test Step Postamble
+12:05:30:631 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:30:637 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:05:30:646 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:05:30:652 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:05:30:655 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:05:36:661 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:05:36:662 INFO -  143 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:05:36:670 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:36:687 INFO -  153 Samplestep.cpp 102 Test Step Preamble
+12:05:36:689 INFO -  153 Samplestep.cpp 114 doTestStepL
+12:05:41:687 INFO -  153 Samplestep.cpp 127 Test Step Postamble
+12:05:41:692 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:41:713 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:41:730 INFO -  154 Samplestep.cpp 102 Test Step Preamble
+12:05:41:731 INFO -  154 Samplestep.cpp 114 doTestStepL
+12:05:46:734 INFO -  154 Samplestep.cpp 127 Test Step Postamble
+12:05:46:739 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:46:766 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:46:776 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:05:46:802 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:46:804 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:05:52:836 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:05:52:837 INFO -  143 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:05:52:864 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:52:881 INFO -  155 Samplestep.cpp 102 Test Step Preamble
+12:05:52:883 INFO -  155 Samplestep.cpp 114 doTestStepL
+12:05:57:875 INFO -  155 Samplestep.cpp 127 Test Step Postamble
+12:05:57:880 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:57:907 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:57:924 INFO -  156 Samplestep.cpp 102 Test Step Preamble
+12:05:57:926 INFO -  156 Samplestep.cpp 114 doTestStepL
+12:06:02:921 INFO -  156 Samplestep.cpp 127 Test Step Postamble
+12:06:02:926 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:06:02:951 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:06:02:963 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:06:08:968 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:06:08:970 <font size=2 color=00AF00>PASS = 8</font>
+12:06:08:971 <font size=2 color=FF0000>FAIL = 0</font>
+12:06:08:973 <font size=2 color=0000FF>ABORT = 0</font>
+12:06:08:975 <font size=2 color=0000FF>PANIC = 0</font>
+12:06:08:976 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:06:08:978 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:06:08:980 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:06:08:981 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:06:08:983 <font size=2 color=00AF00>PASS = 4</font>
+12:06:08:984 <font size=2 color=FF0000>FAIL = 0</font>
+12:06:08:986 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:06:08:988 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-TCP/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+10:56:52:222 <html><body><pre>
+10:56:52:222 *** TestExecute Started 10/06/2005 10:56:52:222 ***
+10:56:52:227 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+10:56:52:227 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+10:56:52:227 c:\ucc\master.script PRINT
+10:56:52:227 INFO -  53 ScriptEngine.cpp 876 
+
+10:56:52:227 c:\ucc\master.script PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+10:56:52:232 INFO -  53 ScriptEngine.cpp 876  Using SetSharedData to initiate the slave side synchronised test blocks
+
+10:56:52:232 c:\ucc\master.script LOAD_SUITE UCCControlTE
+10:56:52:290 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+10:56:53:208 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+10:56:53:228 <font size=2 color=00AF00>c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+10:56:53:228 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+10:56:53:338 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+10:56:53:353 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+10:56:53:353 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+10:57:14:904 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+10:57:14:934 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+10:57:14:934 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:57:15:943 INFO -  105 CUCCTest.cpp 405 UCC Call Result = 0
+10:57:15:958 <font size=2 color=00AF00>c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:57:15:958 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:57:31:115 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+10:57:31:130 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:57:31:130 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:57:32:144 INFO -  115 CUCCTest.cpp 405 UCC Call Result = 0
+10:57:32:161 <font size=2 color=00AF00>c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:57:32:166 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:57:50:351 INFO -  116 CUCCTest.cpp 405 UCC Call Result = 0
+10:57:50:366 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:57:50:366 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:57:51:381 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+10:57:51:396 <font size=2 color=00AF00>c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:57:51:396 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:58:06:536 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+10:58:06:551 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:58:06:551 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:58:07:566 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+10:58:07:578 <font size=2 color=00AF00>c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:58:07:578 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:58:22:733 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+10:58:22:748 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:58:22:748 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+10:58:46:095 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+10:58:46:109 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+10:58:46:109 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+10:58:46:221 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+10:58:46:236 <font size=2 color=00AF00>c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+10:58:46:241 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+10:58:46:346 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+10:58:46:361 <font size=2 color=00AF00>c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+10:58:46:371 <font size=2 color=00AFFF>SUMMARY:</font>
+10:58:46:371 <font size=2 color=00AF00>PASS = 14</font>
+10:58:46:371 <font size=2 color=FF0000>FAIL = 0</font>
+10:58:46:371 <font size=2 color=0000FF>ABORT = 0</font>
+10:58:46:371 <font size=2 color=0000FF>PANIC = 0</font>
+10:58:46:376 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+10:58:46:376 <font size=2 color=0000FF>UNKNOWN = 0</font>
+10:58:46:376 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+10:58:46:376 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-TCP/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:06:06:382 <html><body><pre>
+12:06:06:384 *** TestExecute Started 10/06/2005 12:06:06:384 ***
+12:06:06:398 c:\ucc\slave.script PRINT Synchronised test cases
+12:06:06:400 INFO -  146 Scriptengine.cpp 876  Synchronised test cases
+
+12:06:06:406 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:06:06:437 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:06:06:442 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:06:10:442 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:06:10:443 INFO -  146 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:06:10:452 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:06:10:470 INFO -  152 Samplestep.cpp 102 Test Step Preamble
+12:06:10:471 INFO -  152 Samplestep.cpp 114 doTestStepL
+12:06:15:470 INFO -  152 Samplestep.cpp 127 Test Step Postamble
+12:06:15:476 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:06:15:485 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:06:15:504 INFO -  153 Samplestep.cpp 102 Test Step Preamble
+12:06:15:505 INFO -  153 Samplestep.cpp 114 doTestStepL
+12:06:20:500 INFO -  153 Samplestep.cpp 127 Test Step Postamble
+12:06:20:506 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:06:20:512 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:06:20:519 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:06:20:526 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:06:20:528 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:06:28:536 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:06:28:538 INFO -  146 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:06:28:546 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:06:28:564 INFO -  154 Samplestep.cpp 102 Test Step Preamble
+12:06:28:565 INFO -  154 Samplestep.cpp 114 doTestStepL
+12:06:33:562 INFO -  154 Samplestep.cpp 127 Test Step Postamble
+12:06:33:568 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:06:33:576 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:06:33:596 INFO -  155 Samplestep.cpp 102 Test Step Preamble
+12:06:33:597 INFO -  155 Samplestep.cpp 114 doTestStepL
+12:06:38:593 INFO -  155 Samplestep.cpp 127 Test Step Postamble
+12:06:38:599 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:06:38:606 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:06:38:616 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:06:38:622 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:06:38:625 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:06:46:630 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:06:46:631 INFO -  146 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:06:46:639 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:06:46:660 INFO -  156 Samplestep.cpp 102 Test Step Preamble
+12:06:46:662 INFO -  156 Samplestep.cpp 114 doTestStepL
+12:06:51:656 INFO -  156 Samplestep.cpp 127 Test Step Postamble
+12:06:51:662 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:06:51:683 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:06:51:702 INFO -  157 Samplestep.cpp 102 Test Step Preamble
+12:06:51:703 INFO -  157 Samplestep.cpp 114 doTestStepL
+12:06:56:703 INFO -  157 Samplestep.cpp 127 Test Step Postamble
+12:06:56:711 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:06:56:739 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:06:56:749 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:06:56:775 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:06:56:778 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:07:02:789 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:07:02:790 INFO -  146 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:07:02:818 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:07:02:836 INFO -  158 Samplestep.cpp 102 Test Step Preamble
+12:07:02:838 INFO -  158 Samplestep.cpp 114 doTestStepL
+12:07:07:828 INFO -  158 Samplestep.cpp 127 Test Step Postamble
+12:07:07:834 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:07:07:861 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:07:07:880 INFO -  159 Samplestep.cpp 102 Test Step Preamble
+12:07:07:881 INFO -  159 Samplestep.cpp 114 doTestStepL
+12:07:12:875 INFO -  159 Samplestep.cpp 127 Test Step Postamble
+12:07:12:881 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:07:12:908 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:07:12:920 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:07:18:937 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:07:18:939 <font size=2 color=00AF00>PASS = 8</font>
+12:07:18:941 <font size=2 color=FF0000>FAIL = 0</font>
+12:07:18:942 <font size=2 color=0000FF>ABORT = 0</font>
+12:07:18:944 <font size=2 color=0000FF>PANIC = 0</font>
+12:07:18:946 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:07:18:947 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:07:18:949 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:07:18:951 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:07:18:954 <font size=2 color=00AF00>PASS = 4</font>
+12:07:18:955 <font size=2 color=FF0000>FAIL = 0</font>
+12:07:18:957 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:07:18:959 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/SetSharedData/TCP-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+11:23:48:612 <html><body><pre>
+11:23:48:617 *** TestExecute Started 10/06/2005 11:23:48:617 ***
+11:23:48:622 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - TCP
+11:23:48:622 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - TCP
+
+11:23:48:622 c:\ucc\master.script PRINT
+11:23:48:622 INFO -  53 ScriptEngine.cpp 876 
+
+11:23:48:622 c:\ucc\master.script PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+11:23:48:622 INFO -  53 ScriptEngine.cpp 876  Using SetSharedData to initiate the slave side synchronised test blocks
+
+11:23:48:622 c:\ucc\master.script LOAD_SUITE UCCControlTE
+11:23:48:686 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+11:24:05:000 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+11:24:05:005 <font size=2 color=00AF00>c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+11:24:05:040 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+11:24:05:393 INFO -  102 CUCCTest.cpp 405 UCC Call Result = 0
+11:24:05:398 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+11:24:05:438 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+11:24:27:440 INFO -  103 CUCCTest.cpp 405 UCC Call Result = 0
+11:24:27:445 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+11:24:27:480 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+11:24:28:066 INFO -  104 CUCCTest.cpp 405 UCC Call Result = 0
+11:24:28:071 <font size=2 color=00AF00>c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+11:24:28:111 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:24:43:961 INFO -  105 CUCCTest.cpp 405 UCC Call Result = 0
+11:24:43:966 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:24:44:000 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+11:24:44:556 INFO -  106 CUCCTest.cpp 405 UCC Call Result = 0
+11:24:44:561 <font size=2 color=00AF00>c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+11:24:44:598 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:25:00:456 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:00:461 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:25:00:501 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+11:25:01:050 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:01:055 <font size=2 color=00AF00>c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+11:25:01:095 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:25:14:801 INFO -  109 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:14:806 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:25:14:806 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+11:25:15:435 INFO -  110 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:15:440 <font size=2 color=00AF00>c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+11:25:15:480 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:25:29:170 INFO -  111 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:29:175 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:25:29:215 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+11:25:48:276 INFO -  112 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:48:281 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+11:25:48:316 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+11:25:48:698 INFO -  113 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:48:698 <font size=2 color=00AF00>c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+11:25:48:703 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+11:25:49:140 INFO -  114 CUCCTest.cpp 405 UCC Call Result = 0
+11:25:49:145 <font size=2 color=00AF00>c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+11:25:49:185 <font size=2 color=00AFFF>SUMMARY:</font>
+11:25:49:190 <font size=2 color=00AF00>PASS = 14</font>
+11:25:49:190 <font size=2 color=FF0000>FAIL = 0</font>
+11:25:49:190 <font size=2 color=0000FF>ABORT = 0</font>
+11:25:49:190 <font size=2 color=0000FF>PANIC = 0</font>
+11:25:49:190 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+11:25:49:190 <font size=2 color=0000FF>UNKNOWN = 0</font>
+11:25:49:190 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+11:25:49:195 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.1/SetSharedData/TCP-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:08:42:564 <html><body><pre>
+12:08:42:566 *** TestExecute Started 09/06/2005 12:08:42:565 ***
+12:08:42:581 c:\ucc\slave.script PRINT Synchronised test cases
+12:08:42:583 INFO -  143 Scriptengine.cpp 876  Synchronised test cases
+
+12:08:42:588 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:08:42:619 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:08:42:623 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:08:48:630 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:08:48:631 INFO -  143 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:08:48:639 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:08:48:657 INFO -  149 Samplestep.cpp 102 Test Step Preamble
+12:08:48:658 INFO -  149 Samplestep.cpp 114 doTestStepL
+12:08:53:656 INFO -  149 Samplestep.cpp 127 Test Step Postamble
+12:08:53:661 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:08:53:670 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:08:53:687 INFO -  150 Samplestep.cpp 102 Test Step Preamble
+12:08:53:688 INFO -  150 Samplestep.cpp 114 doTestStepL
+12:08:58:687 INFO -  150 Samplestep.cpp 127 Test Step Postamble
+12:08:58:692 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:08:58:697 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:08:58:705 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:08:58:711 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:08:58:714 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:09:04:708 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:09:04:710 INFO -  143 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:09:04:718 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:09:04:734 INFO -  151 Samplestep.cpp 102 Test Step Preamble
+12:09:04:736 INFO -  151 Samplestep.cpp 114 doTestStepL
+12:09:09:734 INFO -  151 Samplestep.cpp 127 Test Step Postamble
+12:09:09:739 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:09:09:747 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:09:09:764 INFO -  152 Samplestep.cpp 102 Test Step Preamble
+12:09:09:765 INFO -  152 Samplestep.cpp 114 doTestStepL
+12:09:14:765 INFO -  152 Samplestep.cpp 127 Test Step Postamble
+12:09:14:807 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:09:14:814 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:09:14:822 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:09:14:829 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:09:14:831 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:09:20:833 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:09:20:835 INFO -  143 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:09:20:843 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:09:20:859 INFO -  153 Samplestep.cpp 102 Test Step Preamble
+12:09:20:861 INFO -  153 Samplestep.cpp 114 doTestStepL
+12:09:25:859 INFO -  153 Samplestep.cpp 127 Test Step Postamble
+12:09:25:864 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:09:25:885 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:09:25:902 INFO -  154 Samplestep.cpp 102 Test Step Preamble
+12:09:25:903 INFO -  154 Samplestep.cpp 114 doTestStepL
+12:09:30:906 INFO -  154 Samplestep.cpp 127 Test Step Postamble
+12:09:30:911 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:09:30:938 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:09:30:948 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:09:30:974 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:09:30:976 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:09:34:994 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:09:34:996 INFO -  143 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:09:35:025 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:09:35:042 INFO -  155 Samplestep.cpp 102 Test Step Preamble
+12:09:35:043 INFO -  155 Samplestep.cpp 114 doTestStepL
+12:09:40:031 INFO -  155 Samplestep.cpp 127 Test Step Postamble
+12:09:40:036 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:09:40:063 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:09:40:080 INFO -  156 Samplestep.cpp 102 Test Step Preamble
+12:09:40:081 INFO -  156 Samplestep.cpp 114 doTestStepL
+12:09:45:078 INFO -  156 Samplestep.cpp 127 Test Step Postamble
+12:09:45:083 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:09:45:107 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:09:45:119 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:09:51:125 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:09:51:126 <font size=2 color=00AF00>PASS = 8</font>
+12:09:51:128 <font size=2 color=FF0000>FAIL = 0</font>
+12:09:51:130 <font size=2 color=0000FF>ABORT = 0</font>
+12:09:51:131 <font size=2 color=0000FF>PANIC = 0</font>
+12:09:51:133 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:09:51:135 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:09:51:136 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:09:51:138 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:09:51:140 <font size=2 color=00AF00>PASS = 4</font>
+12:09:51:141 <font size=2 color=FF0000>FAIL = 0</font>
+12:09:51:143 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:09:51:145 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+11:12:21:060 <html><body><pre>
+11:12:21:060 *** TestExecute Started 10/06/2005 11:12:21:060 ***
+11:12:21:070 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+11:12:21:070 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+11:12:21:070 c:\ucc\master.script LOAD_SUITE UCCControlTE
+11:12:21:130 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+11:12:21:858 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+11:12:21:873 <font size=2 color=00AF00>c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+11:12:21:873 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+11:12:21:989 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+11:12:22:004 <font size=2 color=00AF00>c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+11:12:22:009 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+11:12:43:435 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+11:12:43:450 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+11:12:43:450 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:12:43:948 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+11:12:43:963 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:12:43:968 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:12:59:628 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+11:12:59:643 <font size=2 color=00AF00>c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:12:59:648 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:13:00:140 INFO -  115 CUCCTest.cpp 405 UCC Call Result = 0
+11:13:00:155 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:13:00:160 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:13:15:798 INFO -  116 CUCCTest.cpp 405 UCC Call Result = 0
+11:13:15:813 <font size=2 color=00AF00>c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:13:15:818 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:13:18:450 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+11:13:18:465 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:13:18:465 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:13:34:095 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+11:13:34:110 <font size=2 color=00AF00>c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:13:34:110 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:13:36:738 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+11:13:36:753 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:13:36:758 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:13:52:390 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+11:13:52:405 <font size=2 color=00AF00>c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:13:52:405 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+11:14:13:658 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+11:14:13:673 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+11:14:13:678 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+11:14:13:783 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+11:14:13:798 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+11:14:13:803 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+11:14:13:913 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+11:14:13:928 <font size=2 color=00AF00>c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+11:14:13:933 <font size=2 color=00AFFF>SUMMARY:</font>
+11:14:13:933 <font size=2 color=00AF00>PASS = 14</font>
+11:14:13:938 <font size=2 color=FF0000>FAIL = 0</font>
+11:14:13:938 <font size=2 color=0000FF>ABORT = 0</font>
+11:14:13:938 <font size=2 color=0000FF>PANIC = 0</font>
+11:14:13:938 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+11:14:13:938 <font size=2 color=0000FF>UNKNOWN = 0</font>
+11:14:13:938 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+11:14:13:938 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:04:40:895 <html><body><pre>
+12:04:40:897 *** TestExecute Started 09/06/2005 12:04:40:897 ***
+12:04:40:911 c:\ucc\slave.script PRINT Synchronised test cases
+12:04:40:913 INFO -  110 Scriptengine.cpp 876  Synchronised test cases
+
+12:04:40:918 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:04:40:949 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:04:40:953 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:04:46:958 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:04:46:959 INFO -  110 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:04:46:967 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:46:985 INFO -  118 Samplestep.cpp 102 Test Step Preamble
+12:04:46:986 INFO -  118 Samplestep.cpp 114 doTestStepL
+12:04:51:984 INFO -  118 Samplestep.cpp 127 Test Step Postamble
+12:04:51:989 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:04:51:998 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:52:019 INFO -  121 Samplestep.cpp 102 Test Step Preamble
+12:04:52:020 INFO -  121 Samplestep.cpp 114 doTestStepL
+12:04:57:015 INFO -  121 Samplestep.cpp 127 Test Step Postamble
+12:04:57:020 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:04:57:026 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:04:57:034 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:04:57:040 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:04:57:042 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:05:03:036 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:05:03:038 INFO -  110 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:05:03:046 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:03:063 INFO -  124 Samplestep.cpp 102 Test Step Preamble
+12:05:03:064 INFO -  124 Samplestep.cpp 114 doTestStepL
+12:05:08:062 INFO -  124 Samplestep.cpp 127 Test Step Postamble
+12:05:08:067 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:08:076 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:08:093 INFO -  125 Samplestep.cpp 102 Test Step Preamble
+12:05:09:094 INFO -  125 Samplestep.cpp 114 doTestStepL
+12:05:13:093 INFO -  125 Samplestep.cpp 127 Test Step Postamble
+12:05:13:098 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:13:105 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:05:13:113 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:05:13:120 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:05:13:122 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:05:21:114 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:05:21:116 INFO -  110 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:05:21:124 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:21:141 INFO -  126 Samplestep.cpp 102 Test Step Preamble
+12:05:21:142 INFO -  126 Samplestep.cpp 114 doTestStepL
+12:05:26:140 INFO -  126 Samplestep.cpp 127 Test Step Postamble
+12:05:26:145 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:26:167 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:26:184 INFO -  127 Samplestep.cpp 102 Test Step Preamble
+12:05:26:185 INFO -  127 Samplestep.cpp 114 doTestStepL
+12:05:31:187 INFO -  127 Samplestep.cpp 127 Test Step Postamble
+12:05:31:192 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:31:220 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:31:230 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:05:31:256 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:31:258 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:05:39:274 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:05:39:276 INFO -  110 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:05:39:303 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:39:320 INFO -  128 Samplestep.cpp 102 Test Step Preamble
+12:05:39:321 INFO -  128 Samplestep.cpp 114 doTestStepL
+12:05:44:312 INFO -  128 Samplestep.cpp 127 Test Step Postamble
+12:05:44:317 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:44:345 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:44:362 INFO -  129 Samplestep.cpp 102 Test Step Preamble
+12:05:44:363 INFO -  129 Samplestep.cpp 114 doTestStepL
+12:05:49:359 INFO -  129 Samplestep.cpp 127 Test Step Postamble
+12:05:49:364 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:49:390 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:05:49:401 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:05:55:406 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:05:55:408 <font size=2 color=00AF00>PASS = 8</font>
+12:05:55:409 <font size=2 color=FF0000>FAIL = 0</font>
+12:05:55:411 <font size=2 color=0000FF>ABORT = 0</font>
+12:05:55:412 <font size=2 color=0000FF>PANIC = 0</font>
+12:05:55:414 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:05:55:416 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:05:55:417 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:05:55:419 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:05:55:421 <font size=2 color=00AF00>PASS = 4</font>
+12:05:55:423 <font size=2 color=FF0000>FAIL = 0</font>
+12:05:55:424 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:05:55:426 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-TCP/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+11:35:36:935 <html><body><pre>
+11:35:36:935 *** TestExecute Started 10/06/2005 11:35:36:935 ***
+11:35:36:940 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+11:35:36:940 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+11:35:36:940 c:\ucc\master.script LOAD_SUITE UCCControlTE
+11:35:36:993 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+11:35:37:900 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+11:35:37:915 <font size=2 color=00AF00>c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+11:35:37:915 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+11:35:55:030 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+11:35:55:045 <font size=2 color=00AF00>c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+11:35:55:045 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+11:36:17:180 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+11:36:17:195 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+11:36:17:195 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:36:19:200 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+11:36:19:215 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:36:19:220 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:36:37:530 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+11:36:37:540 <font size=2 color=00AF00>c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:36:37:545 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:36:39:633 INFO -  115 CUCCTest.cpp 405 UCC Call Result = 0
+11:36:39:648 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:36:39:653 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:36:37:817 INFO -  118 CUCCTest.cpp 405 UCC Call Result = 0
+11:36:37:832 <font size=2 color=00AF00>c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:36:37:837 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:36:59:945 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+11:36:59:960 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:36:59:965 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:37:15:115 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+11:37:15:130 <font size=2 color=00AF00>c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:37:15:135 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+11:37:20:275 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+11:37:20:285 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+11:37:20:290 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+11:37:35:460 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+11:37:35:475 <font size=2 color=00AF00>c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+11:37:35:475 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+11:37:58:460 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+11:37:58:475 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+11:37:58:475 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+11:37:58:585 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+11:37:58:600 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+11:37:58:605 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+11:37:58:715 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+11:37:58:735 <font size=2 color=00AF00>c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+11:37:58:740 <font size=2 color=00AFFF>SUMMARY:</font>
+11:37:58:745 <font size=2 color=00AF00>PASS = 14</font>
+11:37:58:745 <font size=2 color=FF0000>FAIL = 0</font>
+11:37:58:745 <font size=2 color=0000FF>ABORT = 0</font>
+11:37:58:745 <font size=2 color=0000FF>PANIC = 0</font>
+11:37:58:745 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+11:37:58:745 <font size=2 color=0000FF>UNKNOWN = 0</font>
+11:37:58:745 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+11:37:58:745 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-TCP/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:04:09:456 <html><body><pre>
+12:04:09:458 *** TestExecute Started 10/06/2005 12:04:09:458 ***
+12:04:09:473 c:\ucc\slave.script PRINT Synchronised test cases
+12:04:09:474 INFO -  119 Scriptengine.cpp 876  Synchronised test cases
+
+12:04:09:480 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:04:09:511 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:04:09:515 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:04:15:520 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:04:15:521 INFO -  119 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:04:15:530 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:15:548 INFO -  125 Samplestep.cpp 102 Test Step Preamble
+12:04:15:549 INFO -  125 Samplestep.cpp 114 doTestStepL
+12:04:20:546 INFO -  125 Samplestep.cpp 127 Test Step Postamble
+12:04:20:552 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:04:20:561 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:20:581 INFO -  126 Samplestep.cpp 102 Test Step Preamble
+12:04:20:582 INFO -  126 Samplestep.cpp 114 doTestStepL
+12:04:25:578 INFO -  126 Samplestep.cpp 127 Test Step Postamble
+12:04:25:584 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:04:25:590 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:04:25:598 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:04:25:604 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:04:25:607 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:04:35:598 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:04:35:600 INFO -  119 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:04:35:608 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:35:626 INFO -  127 Samplestep.cpp 102 Test Step Preamble
+12:04:35:627 INFO -  127 Samplestep.cpp 114 doTestStepL
+12:04:40:625 INFO -  127 Samplestep.cpp 127 Test Step Postamble
+12:04:40:631 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:04:40:639 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:40:658 INFO -  128 Samplestep.cpp 102 Test Step Preamble
+12:04:40:659 INFO -  128 Samplestep.cpp 114 doTestStepL
+12:04:45:656 INFO -  128 Samplestep.cpp 127 Test Step Postamble
+12:04:45:662 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:04:45:668 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:04:45:677 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:04:45:684 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:04:45:686 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:04:55:692 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:04:55:693 INFO -  119 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:04:55:702 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:04:55:720 INFO -  129 Samplestep.cpp 102 Test Step Preamble
+12:04:55:721 INFO -  129 Samplestep.cpp 114 doTestStepL
+12:05:00:718 INFO -  129 Samplestep.cpp 127 Test Step Postamble
+12:05:00:724 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:00:745 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:00:764 INFO -  130 Samplestep.cpp 102 Test Step Preamble
+12:05:00:765 INFO -  130 Samplestep.cpp 114 doTestStepL
+12:05:05:765 INFO -  130 Samplestep.cpp 127 Test Step Postamble
+12:05:05:771 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:05:798 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:05:809 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:05:05:834 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:05:837 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:05:15:852 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:05:15:853 INFO -  119 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:05:15:881 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:15:899 INFO -  131 Samplestep.cpp 102 Test Step Preamble
+12:05:15:900 INFO -  131 Samplestep.cpp 114 doTestStepL
+12:05:20:890 INFO -  131 Samplestep.cpp 127 Test Step Postamble
+12:05:20:896 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:20:923 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:05:20:942 INFO -  132 Samplestep.cpp 102 Test Step Preamble
+12:05:20:943 INFO -  132 Samplestep.cpp 114 doTestStepL
+12:05:25:937 INFO -  132 Samplestep.cpp 127 Test Step Postamble
+12:05:25:943 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:05:25:969 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:05:25:981 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:05:32:031 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:05:32:033 <font size=2 color=00AF00>PASS = 8</font>
+12:05:32:034 <font size=2 color=FF0000>FAIL = 0</font>
+12:05:32:036 <font size=2 color=0000FF>ABORT = 0</font>
+12:05:32:038 <font size=2 color=0000FF>PANIC = 0</font>
+12:05:32:040 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:05:32:041 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:05:32:043 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:05:32:045 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:05:32:046 <font size=2 color=00AF00>PASS = 4</font>
+12:05:32:048 <font size=2 color=FF0000>FAIL = 0</font>
+12:05:32:050 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:05:32:052 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/BasicSync/TCP-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,57 @@
+09:26:49:956 <html><body><pre>
+09:26:49:956 *** TestExecute Started 10/06/2005 09:26:49:956 ***
+09:26:49:961 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - TCP
+09:26:49:961 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - TCP
+
+09:26:49:961 c:\ucc\master.script LOAD_SUITE UCCControlTE
+09:26:50:020 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+09:27:06:623 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+09:27:06:633 <font size=2 color=00AF00>c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+09:27:06:668 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+09:27:06:996 INFO -  102 CUCCTest.cpp 405 UCC Call Result = 0
+09:27:07:000 <font size=2 color=00AF00>c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+09:27:07:035 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+09:27:32:991 INFO -  103 CUCCTest.cpp 405 UCC Call Result = 0
+09:27:32:996 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+09:27:33:030 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:27:33:733 INFO -  104 CUCCTest.cpp 405 UCC Call Result = 0
+09:27:33:738 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:27:33:773 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:27:49:678 INFO -  105 CUCCTest.cpp 405 UCC Call Result = 0
+09:27:49:683 <font size=2 color=00AF00>c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:27:49:683 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:27:52:564 INFO -  106 CUCCTest.cpp 405 UCC Call Result = 0
+09:27:52:564 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:27:52:603 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:28:06:344 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:06:349 <font size=2 color=00AF00>c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:28:06:384 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:28:09:264 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:09:264 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:28:09:304 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:28:23:035 INFO -  109 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:23:035 <font size=2 color=00AF00>c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:28:23:040 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+09:28:23:818 INFO -  110 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:23:818 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+09:28:23:858 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:28:39:748 INFO -  111 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:39:753 <font size=2 color=00AF00>c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:28:39:788 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+09:28:58:663 INFO -  112 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:58:663 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+09:28:58:668 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+09:28:59:040 INFO -  113 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:59:045 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+09:28:59:045 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+09:28:59:444 INFO -  114 CUCCTest.cpp 405 UCC Call Result = 0
+09:28:59:444 <font size=2 color=00AF00>c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+09:28:59:489 <font size=2 color=00AFFF>SUMMARY:</font>
+09:28:59:494 <font size=2 color=00AF00>PASS = 14</font>
+09:28:59:494 <font size=2 color=FF0000>FAIL = 0</font>
+09:28:59:494 <font size=2 color=0000FF>ABORT = 0</font>
+09:28:59:494 <font size=2 color=0000FF>PANIC = 0</font>
+09:28:59:494 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+09:28:59:494 <font size=2 color=0000FF>UNKNOWN = 0</font>
+09:28:59:494 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+09:28:59:494 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/BasicSync/TCP-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:11:47:810 <html><body><pre>
+12:11:47:812 *** TestExecute Started 09/06/2005 12:11:47:812 ***
+12:11:47:826 c:\ucc\slave.script PRINT Synchronised test cases
+12:11:47:828 INFO -  116 Scriptengine.cpp 876  Synchronised test cases
+
+12:11:47:833 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:11:47:864 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:11:47:869 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:11:53:864 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:11:53:865 INFO -  116 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:11:53:874 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:11:53:891 INFO -  122 Samplestep.cpp 102 Test Step Preamble
+12:11:53:892 INFO -  122 Samplestep.cpp 114 doTestStepL
+12:11:58:890 INFO -  122 Samplestep.cpp 127 Test Step Postamble
+12:11:58:895 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:11:58:904 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:11:58:921 INFO -  123 Samplestep.cpp 102 Test Step Preamble
+12:11:58:922 INFO -  123 Samplestep.cpp 114 doTestStepL
+12:12:03:921 INFO -  123 Samplestep.cpp 127 Test Step Postamble
+12:12:03:926 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:03:932 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:12:03:939 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:12:03:945 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:12:03:948 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:12:11:942 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:12:11:943 INFO -  116 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:12:11:952 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:11:969 INFO -  124 Samplestep.cpp 102 Test Step Preamble
+12:12:11:970 INFO -  124 Samplestep.cpp 114 doTestStepL
+12:12:16:968 INFO -  124 Samplestep.cpp 127 Test Step Postamble
+12:12:16:973 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:16:981 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:16:998 INFO -  125 Samplestep.cpp 102 Test Step Preamble
+12:12:17:002 INFO -  125 Samplestep.cpp 114 doTestStepL
+12:12:22:001 INFO -  125 Samplestep.cpp 127 Test Step Postamble
+12:12:22:006 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:22:012 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:12:22:020 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:12:22:029 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:12:22:031 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:12:28:036 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:12:28:038 INFO -  116 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:12:28:046 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:28:063 INFO -  126 Samplestep.cpp 102 Test Step Preamble
+12:12:28:064 INFO -  126 Samplestep.cpp 114 doTestStepL
+12:12:33:062 INFO -  126 Samplestep.cpp 127 Test Step Postamble
+12:12:33:067 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:33:088 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:33:105 INFO -  127 Samplestep.cpp 102 Test Step Preamble
+12:12:33:107 INFO -  127 Samplestep.cpp 114 doTestStepL
+12:12:38:109 INFO -  127 Samplestep.cpp 127 Test Step Postamble
+12:12:38:114 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:38:141 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:12:38:151 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:12:38:177 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:12:38:180 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:12:44:195 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:12:44:197 INFO -  116 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:12:44:224 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:44:241 INFO -  128 Samplestep.cpp 102 Test Step Preamble
+12:12:44:242 INFO -  128 Samplestep.cpp 114 doTestStepL
+12:12:49:234 INFO -  128 Samplestep.cpp 127 Test Step Postamble
+12:12:49:239 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:49:266 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:49:284 INFO -  129 Samplestep.cpp 102 Test Step Preamble
+12:12:49:285 INFO -  129 Samplestep.cpp 114 doTestStepL
+12:12:54:281 INFO -  129 Samplestep.cpp 127 Test Step Postamble
+12:12:54:286 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:54:311 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:12:54:323 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:13:00:328 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:13:00:329 <font size=2 color=00AF00>PASS = 8</font>
+12:13:00:331 <font size=2 color=FF0000>FAIL = 0</font>
+12:13:00:333 <font size=2 color=0000FF>ABORT = 0</font>
+12:13:00:334 <font size=2 color=0000FF>PANIC = 0</font>
+12:13:00:336 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:13:00:338 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:13:00:339 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:13:00:341 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:13:00:342 <font size=2 color=00AF00>PASS = 4</font>
+12:13:00:344 <font size=2 color=FF0000>FAIL = 0</font>
+12:13:00:346 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:13:00:348 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+09:03:41:915 <html><body><pre>
+09:03:41:915 *** TestExecute Started 10/06/2005 09:03:41:915 ***
+09:03:41:925 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+09:03:41:925 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+09:03:41:925 c:\ucc\master.script PRINT
+09:03:41:925 INFO -  53 ScriptEngine.cpp 876 
+
+09:03:41:925 c:\ucc\master.script PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+09:03:41:925 INFO -  53 ScriptEngine.cpp 876  Using SetSharedData to initiate the slave side synchronised test blocks
+
+09:03:41:925 c:\ucc\master.script LOAD_SUITE UCCControlTE
+09:03:42:000 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+09:03:42:770 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+09:03:42:785 <font size=2 color=00AF00>c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+09:03:42:785 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+09:03:42:900 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+09:03:42:915 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+09:03:42:915 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+09:04:04:455 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:04:470 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+09:04:04:475 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:04:04:822 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:04:842 <font size=2 color=00AF00>c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:04:04:842 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:04:18:346 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:18:361 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:04:18:366 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:04:18:707 INFO -  113 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:18:722 <font size=2 color=00AF00>c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:04:18:727 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:04:34:366 INFO -  114 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:34:381 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:04:34:381 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:04:34:722 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:34:737 <font size=2 color=00AF00>c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:04:34:742 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:04:50:371 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:50:386 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:04:50:386 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+09:04:50:732 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+09:04:50:747 <font size=2 color=00AF00>c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+09:04:50:747 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+09:05:06:371 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+09:05:06:386 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+09:05:06:386 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+09:05:24:366 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+09:05:24:376 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+09:05:24:381 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+09:05:24:491 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+09:05:24:506 <font size=2 color=00AF00>c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+09:05:24:506 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+09:05:24:616 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+09:05:24:631 <font size=2 color=00AF00>c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+09:05:24:641 <font size=2 color=00AFFF>SUMMARY:</font>
+09:05:24:641 <font size=2 color=00AF00>PASS = 14</font>
+09:05:24:641 <font size=2 color=FF0000>FAIL = 0</font>
+09:05:24:641 <font size=2 color=0000FF>ABORT = 0</font>
+09:05:24:641 <font size=2 color=0000FF>PANIC = 0</font>
+09:05:24:641 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+09:05:24:641 <font size=2 color=0000FF>UNKNOWN = 0</font>
+09:05:24:641 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+09:05:24:641 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:13:00:438 <html><body><pre>
+12:13:00:440 *** TestExecute Started 09/06/2005 12:13:00:440 ***
+12:13:00:454 c:\ucc\slave.script PRINT Synchronised test cases
+12:13:00:456 INFO -  143 Scriptengine.cpp 876  Synchronised test cases
+
+12:13:00:461 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:13:00:491 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:13:00:496 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:13:06:489 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:13:06:490 INFO -  143 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:13:06:498 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:06:515 INFO -  149 Samplestep.cpp 102 Test Step Preamble
+12:13:06:516 INFO -  149 Samplestep.cpp 114 doTestStepL
+12:13:11:515 INFO -  149 Samplestep.cpp 127 Test Step Postamble
+12:13:11:520 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:13:11:529 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:11:546 INFO -  150 Samplestep.cpp 102 Test Step Preamble
+12:13:11:547 INFO -  150 Samplestep.cpp 114 doTestStepL
+12:13:16:546 INFO -  150 Samplestep.cpp 127 Test Step Postamble
+12:13:16:551 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:13:16:557 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:13:16:564 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:13:16:570 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:13:16:573 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:13:20:567 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:13:20:569 INFO -  143 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:13:20:578 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:20:595 INFO -  151 Samplestep.cpp 102 Test Step Preamble
+12:13:20:596 INFO -  151 Samplestep.cpp 114 doTestStepL
+12:13:25:593 INFO -  151 Samplestep.cpp 127 Test Step Postamble
+12:13:25:598 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:13:25:606 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:25:624 INFO -  152 Samplestep.cpp 102 Test Step Preamble
+12:13:25:625 INFO -  152 Samplestep.cpp 114 doTestStepL
+12:13:30:625 INFO -  152 Samplestep.cpp 127 Test Step Postamble
+12:13:30:631 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:13:30:637 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:13:30:646 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:13:30:652 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:13:30:655 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:13:36:661 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:13:36:662 INFO -  143 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:13:36:670 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:36:687 INFO -  153 Samplestep.cpp 102 Test Step Preamble
+12:13:36:689 INFO -  153 Samplestep.cpp 114 doTestStepL
+12:13:41:687 INFO -  153 Samplestep.cpp 127 Test Step Postamble
+12:13:41:692 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:13:41:713 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:41:730 INFO -  154 Samplestep.cpp 102 Test Step Preamble
+12:13:41:731 INFO -  154 Samplestep.cpp 114 doTestStepL
+12:13:46:734 INFO -  154 Samplestep.cpp 127 Test Step Postamble
+12:13:46:739 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:13:46:766 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:13:46:776 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:13:46:802 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:13:46:804 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:13:52:836 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:13:52:837 INFO -  143 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:13:52:864 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:52:881 INFO -  155 Samplestep.cpp 102 Test Step Preamble
+12:13:52:883 INFO -  155 Samplestep.cpp 114 doTestStepL
+12:13:57:875 INFO -  155 Samplestep.cpp 127 Test Step Postamble
+12:13:57:880 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:13:57:907 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:13:57:924 INFO -  156 Samplestep.cpp 102 Test Step Preamble
+12:13:57:926 INFO -  156 Samplestep.cpp 114 doTestStepL
+12:14:02:921 INFO -  156 Samplestep.cpp 127 Test Step Postamble
+12:14:02:926 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:14:02:951 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:14:02:963 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:14:08:968 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:14:08:970 <font size=2 color=00AF00>PASS = 8</font>
+12:14:08:971 <font size=2 color=FF0000>FAIL = 0</font>
+12:14:08:973 <font size=2 color=0000FF>ABORT = 0</font>
+12:14:08:975 <font size=2 color=0000FF>PANIC = 0</font>
+12:14:08:976 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:14:08:978 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:14:08:980 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:14:08:981 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:14:08:983 <font size=2 color=00AF00>PASS = 4</font>
+12:14:08:984 <font size=2 color=FF0000>FAIL = 0</font>
+12:14:08:986 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:14:08:988 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+10:17:52:222 <html><body><pre>
+10:17:52:222 *** TestExecute Started 10/06/2005 10:17:52:222 ***
+10:17:52:227 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - SERIAL
+10:17:52:227 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - SERIAL
+
+10:17:52:227 c:\ucc\master.script PRINT
+10:17:52:227 INFO -  53 ScriptEngine.cpp 876 
+
+10:17:52:227 c:\ucc\master.script PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+10:17:52:232 INFO -  53 ScriptEngine.cpp 876  Using SetSharedData to initiate the slave side synchronised test blocks
+
+10:17:52:232 c:\ucc\master.script LOAD_SUITE UCCControlTE
+10:17:52:290 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+10:17:53:208 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+10:17:53:228 <font size=2 color=00AF00>c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+10:17:53:228 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+10:17:53:338 INFO -  75 CUCCTest.cpp 405 UCC Call Result = 0
+10:17:53:353 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+10:17:53:353 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+10:18:14:904 INFO -  76 CUCCTest.cpp 405 UCC Call Result = 0
+10:18:14:934 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+10:18:14:934 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:18:15:943 INFO -  105 CUCCTest.cpp 405 UCC Call Result = 0
+10:18:15:958 <font size=2 color=00AF00>c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:18:15:958 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:18:31:115 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+10:18:31:130 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:18:31:130 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:18:32:144 INFO -  115 CUCCTest.cpp 405 UCC Call Result = 0
+10:18:32:161 <font size=2 color=00AF00>c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:18:32:166 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:18:50:351 INFO -  116 CUCCTest.cpp 405 UCC Call Result = 0
+10:18:50:366 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:18:50:366 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:18:51:381 INFO -  121 CUCCTest.cpp 405 UCC Call Result = 0
+10:18:51:396 <font size=2 color=00AF00>c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:18:51:396 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:19:06:536 INFO -  122 CUCCTest.cpp 405 UCC Call Result = 0
+10:19:06:551 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:19:06:551 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+10:19:07:566 INFO -  123 CUCCTest.cpp 405 UCC Call Result = 0
+10:19:07:578 <font size=2 color=00AF00>c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+10:19:07:578 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+10:19:22:733 INFO -  124 CUCCTest.cpp 405 UCC Call Result = 0
+10:19:22:748 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+10:19:22:748 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+10:19:46:095 INFO -  125 CUCCTest.cpp 405 UCC Call Result = 0
+10:19:46:109 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+10:19:46:109 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+10:19:46:221 INFO -  126 CUCCTest.cpp 405 UCC Call Result = 0
+10:19:46:236 <font size=2 color=00AF00>c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+10:19:46:241 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+10:19:46:346 INFO -  127 CUCCTest.cpp 405 UCC Call Result = 0
+10:19:46:361 <font size=2 color=00AF00>c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+10:19:46:371 <font size=2 color=00AFFF>SUMMARY:</font>
+10:19:46:371 <font size=2 color=00AF00>PASS = 14</font>
+10:19:46:371 <font size=2 color=FF0000>FAIL = 0</font>
+10:19:46:371 <font size=2 color=0000FF>ABORT = 0</font>
+10:19:46:371 <font size=2 color=0000FF>PANIC = 0</font>
+10:19:46:376 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+10:19:46:376 <font size=2 color=0000FF>UNKNOWN = 0</font>
+10:19:46:376 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+10:19:46:376 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:51:06:382 <html><body><pre>
+12:51:06:384 *** TestExecute Started 10/06/2005 12:51:06:384 ***
+12:51:06:398 c:\ucc\slave.script PRINT Synchronised test cases
+12:51:06:400 INFO -  146 Scriptengine.cpp 876  Synchronised test cases
+
+12:51:06:406 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:51:06:437 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:51:06:442 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:51:10:442 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:51:10:443 INFO -  146 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:51:10:452 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:51:10:470 INFO -  152 Samplestep.cpp 102 Test Step Preamble
+12:51:10:471 INFO -  152 Samplestep.cpp 114 doTestStepL
+12:51:15:470 INFO -  152 Samplestep.cpp 127 Test Step Postamble
+12:51:15:476 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:51:15:485 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:51:15:504 INFO -  153 Samplestep.cpp 102 Test Step Preamble
+12:51:15:505 INFO -  153 Samplestep.cpp 114 doTestStepL
+12:51:20:500 INFO -  153 Samplestep.cpp 127 Test Step Postamble
+12:51:20:506 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:51:20:512 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:51:20:519 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:51:20:526 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:51:20:528 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:51:28:536 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:51:28:538 INFO -  146 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:51:28:546 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:51:28:564 INFO -  154 Samplestep.cpp 102 Test Step Preamble
+12:51:28:565 INFO -  154 Samplestep.cpp 114 doTestStepL
+12:51:33:562 INFO -  154 Samplestep.cpp 127 Test Step Postamble
+12:51:33:568 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:51:33:576 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:51:33:596 INFO -  155 Samplestep.cpp 102 Test Step Preamble
+12:51:33:597 INFO -  155 Samplestep.cpp 114 doTestStepL
+12:51:38:593 INFO -  155 Samplestep.cpp 127 Test Step Postamble
+12:51:38:599 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:51:38:606 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:51:38:616 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:51:38:622 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:51:38:625 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:51:46:630 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:51:46:631 INFO -  146 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:51:46:639 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:51:46:660 INFO -  156 Samplestep.cpp 102 Test Step Preamble
+12:51:46:662 INFO -  156 Samplestep.cpp 114 doTestStepL
+12:51:51:656 INFO -  156 Samplestep.cpp 127 Test Step Postamble
+12:51:51:662 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:51:51:683 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:51:51:702 INFO -  157 Samplestep.cpp 102 Test Step Preamble
+12:51:51:703 INFO -  157 Samplestep.cpp 114 doTestStepL
+12:51:56:703 INFO -  157 Samplestep.cpp 127 Test Step Postamble
+12:51:56:711 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:51:56:739 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:51:56:749 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:51:56:775 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:51:56:778 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:52:02:789 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:52:02:790 INFO -  146 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:52:02:818 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:52:02:836 INFO -  158 Samplestep.cpp 102 Test Step Preamble
+12:52:02:838 INFO -  158 Samplestep.cpp 114 doTestStepL
+12:52:07:828 INFO -  158 Samplestep.cpp 127 Test Step Postamble
+12:52:07:834 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:52:07:861 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:52:07:880 INFO -  159 Samplestep.cpp 102 Test Step Preamble
+12:52:07:881 INFO -  159 Samplestep.cpp 114 doTestStepL
+12:52:12:875 INFO -  159 Samplestep.cpp 127 Test Step Postamble
+12:52:12:881 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:52:12:908 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:52:12:920 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:52:18:937 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:52:18:939 <font size=2 color=00AF00>PASS = 8</font>
+12:52:18:941 <font size=2 color=FF0000>FAIL = 0</font>
+12:52:18:942 <font size=2 color=0000FF>ABORT = 0</font>
+12:52:18:944 <font size=2 color=0000FF>PANIC = 0</font>
+12:52:18:946 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:52:18:947 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:52:18:949 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:52:18:951 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:52:18:954 <font size=2 color=00AF00>PASS = 4</font>
+12:52:18:955 <font size=2 color=FF0000>FAIL = 0</font>
+12:52:18:957 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:52:18:959 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+15:18:48:612 <html><body><pre>
+15:18:48:617 *** TestExecute Started 10/06/2005 15:18:48:617 ***
+15:18:48:622 c:\ucc\master.script PRINT UCC Tests - Synchronised test cases - TCP
+15:18:48:622 INFO -  53 ScriptEngine.cpp 876  UCC Tests - Synchronised test cases - TCP
+
+15:18:48:622 c:\ucc\master.script PRINT
+15:18:48:622 INFO -  53 ScriptEngine.cpp 876 
+
+15:18:48:622 c:\ucc\master.script PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+15:18:48:622 INFO -  53 ScriptEngine.cpp 876  Using SetSharedData to initiate the slave side synchronised test blocks
+
+15:18:48:622 c:\ucc\master.script LOAD_SUITE UCCControlTE
+15:18:48:686 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+15:19:05:000 INFO -  61 CUCCTest.cpp 405 UCC Call Result = 0
+15:19:05:005 <font size=2 color=00AF00>c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS </font>
+15:19:05:040 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+15:19:05:393 INFO -  102 CUCCTest.cpp 405 UCC Call Result = 0
+15:19:05:398 <font size=2 color=00AF00>c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS </font>
+15:19:05:438 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+15:19:27:440 INFO -  103 CUCCTest.cpp 405 UCC Call Result = 0
+15:19:27:445 <font size=2 color=00AF00>c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS </font>
+15:19:27:480 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+15:19:28:066 INFO -  104 CUCCTest.cpp 405 UCC Call Result = 0
+15:19:28:071 <font size=2 color=00AF00>c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+15:19:28:111 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+15:19:43:961 INFO -  105 CUCCTest.cpp 405 UCC Call Result = 0
+15:19:43:966 <font size=2 color=00AF00>c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+15:19:44:000 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+15:19:44:556 INFO -  106 CUCCTest.cpp 405 UCC Call Result = 0
+15:19:44:561 <font size=2 color=00AF00>c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+15:19:44:598 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+15:20:00:456 INFO -  107 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:00:461 <font size=2 color=00AF00>c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+15:20:00:501 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+15:20:01:050 INFO -  108 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:01:055 <font size=2 color=00AF00>c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+15:20:01:095 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+15:20:14:801 INFO -  109 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:14:806 <font size=2 color=00AF00>c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+15:20:14:806 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+15:20:15:435 INFO -  110 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:15:440 <font size=2 color=00AF00>c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS </font>
+15:20:15:480 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+15:20:29:170 INFO -  111 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:29:175 <font size=2 color=00AF00>c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+15:20:29:215 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+15:20:48:276 INFO -  112 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:48:281 <font size=2 color=00AF00>c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS </font>
+15:20:48:316 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+15:20:48:698 INFO -  113 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:48:698 <font size=2 color=00AF00>c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS </font>
+15:20:48:703 c:\ucc\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
+15:20:49:140 INFO -  114 CUCCTest.cpp 405 UCC Call Result = 0
+15:20:49:145 <font size=2 color=00AF00>c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS </font>
+15:20:49:185 <font size=2 color=00AFFF>SUMMARY:</font>
+15:20:49:190 <font size=2 color=00AF00>PASS = 14</font>
+15:20:49:190 <font size=2 color=FF0000>FAIL = 0</font>
+15:20:49:190 <font size=2 color=0000FF>ABORT = 0</font>
+15:20:49:190 <font size=2 color=0000FF>PANIC = 0</font>
+15:20:49:190 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+15:20:49:190 <font size=2 color=0000FF>UNKNOWN = 0</font>
+15:20:49:190 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+15:20:49:195 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+12:11:42:564 <html><body><pre>
+12:11:42:566 *** TestExecute Started 09/06/2005 12:11:42:566 ***
+12:11:42:581 c:\ucc\slave.script PRINT Synchronised test cases
+12:11:42:583 INFO -  143 Scriptengine.cpp 876  Synchronised test cases
+
+12:11:42:588 c:\ucc\slave.script LOAD_SUITE SampleServer
+12:11:42:619 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:11:42:623 <font size=2 color=00AF00>c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:11:48:630 c:\ucc\slave.script PRINT TestOne Sycnhronsised Test block
+12:11:48:631 INFO -  143 Scriptengine.cpp 876  TestOne Sycnhronsised Test block
+
+12:11:48:639 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:11:48:657 INFO -  149 Samplestep.cpp 102 Test Step Preamble
+12:11:48:658 INFO -  149 Samplestep.cpp 114 doTestStepL
+12:11:53:656 INFO -  149 Samplestep.cpp 127 Test Step Postamble
+12:11:53:661 <font size=2 color=00AF00>c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:11:53:670 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:11:53:687 INFO -  150 Samplestep.cpp 102 Test Step Preamble
+12:11:53:688 INFO -  150 Samplestep.cpp 114 doTestStepL
+12:11:58:687 INFO -  150 Samplestep.cpp 127 Test Step Postamble
+12:11:58:692 <font size=2 color=00AF00>c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:11:58:697 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:11:58:705 <font size=2 color=00AF00>c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:11:58:711 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:11:58:714 <font size=2 color=00AF00>c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:12:04:708 c:\ucc\slave.script PRINT TestTwo Sycnhronsised Test block
+12:12:04:710 INFO -  143 Scriptengine.cpp 876  TestTwo Sycnhronsised Test block
+
+12:12:04:718 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:04:734 INFO -  151 Samplestep.cpp 102 Test Step Preamble
+12:12:04:736 INFO -  151 Samplestep.cpp 114 doTestStepL
+12:12:09:734 INFO -  151 Samplestep.cpp 127 Test Step Postamble
+12:12:09:739 <font size=2 color=00AF00>c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:09:747 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:09:764 INFO -  152 Samplestep.cpp 102 Test Step Preamble
+12:12:09:765 INFO -  152 Samplestep.cpp 114 doTestStepL
+12:12:14:765 INFO -  152 Samplestep.cpp 127 Test Step Postamble
+12:12:14:807 <font size=2 color=00AF00>c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:14:814 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:12:14:822 <font size=2 color=00AF00>c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:12:14:829 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:12:14:831 <font size=2 color=00AF00>c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:12:20:833 c:\ucc\slave.script PRINT TestThree Sycnhronsised Test block
+12:12:20:835 INFO -  143 Scriptengine.cpp 876  TestThree Sycnhronsised Test block
+
+12:12:20:843 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:20:859 INFO -  153 Samplestep.cpp 102 Test Step Preamble
+12:12:20:861 INFO -  153 Samplestep.cpp 114 doTestStepL
+12:12:25:859 INFO -  153 Samplestep.cpp 127 Test Step Postamble
+12:12:25:864 <font size=2 color=00AF00>c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:25:885 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:25:902 INFO -  154 Samplestep.cpp 102 Test Step Preamble
+12:12:25:903 INFO -  154 Samplestep.cpp 114 doTestStepL
+12:12:30:906 INFO -  154 Samplestep.cpp 127 Test Step Postamble
+12:12:30:911 <font size=2 color=00AF00>c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:30:938 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:12:30:948 <font size=2 color=00AF00>c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:12:30:974 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:12:30:976 <font size=2 color=00AF00>c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:12:34:994 c:\ucc\slave.script PRINT TestFour Sycnhronsised Test block
+12:12:34:996 INFO -  143 Scriptengine.cpp 876  TestFour Sycnhronsised Test block
+
+12:12:35:025 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:35:042 INFO -  155 Samplestep.cpp 102 Test Step Preamble
+12:12:35:043 INFO -  155 Samplestep.cpp 114 doTestStepL
+12:12:40:031 INFO -  155 Samplestep.cpp 127 Test Step Postamble
+12:12:40:036 <font size=2 color=00AF00>c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:40:063 c:\ucc\slave.script RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+12:12:40:080 INFO -  156 Samplestep.cpp 102 Test Step Preamble
+12:12:40:081 INFO -  156 Samplestep.cpp 114 doTestStepL
+12:12:45:078 INFO -  156 Samplestep.cpp 127 Test Step Postamble
+12:12:45:083 <font size=2 color=00AF00>c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS </font>
+12:12:45:107 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:12:45:119 <font size=2 color=00AF00>c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:12:51:125 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:12:51:126 <font size=2 color=00AF00>PASS = 8</font>
+12:12:51:128 <font size=2 color=FF0000>FAIL = 0</font>
+12:12:51:130 <font size=2 color=0000FF>ABORT = 0</font>
+12:12:51:131 <font size=2 color=0000FF>PANIC = 0</font>
+12:12:51:133 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:12:51:135 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:12:51:136 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:12:51:138 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:12:51:140 <font size=2 color=00AF00>PASS = 4</font>
+12:12:51:141 <font size=2 color=FF0000>FAIL = 0</font>
+12:12:51:143 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:12:51:145 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/9.2/SetSharedData/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Master/TestResults.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,22 @@
+<html><body><pre>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartService ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 9 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 12 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server ConnectBT ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 16 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server TransferBT ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StopService ***Result = PASS </font>
+<font size=2 color=00AFFF>SUMMARY:</font>
+<font size=2 color=00AF00>PASS = 12</font>
+<font size=2 color=FF0000>FAIL = 0</font>
+<font size=2 color=0000FF>ABORT = 0</font>
+<font size=2 color=0000FF>PANIC = 0</font>
+<font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+<font size=2 color=0000FF>UNKNOWN = 0</font>
+<font size=2 color=0000FF>UNEXECUTED = 0</font>
+</pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Master/master.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,56 @@
+12:02:42:412 <html><body><pre>
+12:02:42:414 *** TestExecute Started 04/05/2005 12:02:42:414 ***
+12:02:42:429 z:\sampletest\master.script PRINT UCC SyncService Test (Master)
+12:02:42:431 INFO -  107 Scriptengine.cpp 855  UCC SyncService Test (Master)
+
+12:02:42:436 z:\sampletest\master.script LOAD_SUITE UCCControlTE
+12:02:42:458 z:\sampletest\master.script LOAD_SUITE TEF_Bluetooth_Server -SharedData
+12:02:42:484 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartService
+12:02:55:285 INFO -  115 Cucctest.cpp 405 UCC Call Result = 0
+12:02:55:292 <font size=2 color=00AF00>z:\sampletest\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartService ***Result = PASS </font>
+12:02:55:304 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase
+12:03:00:286 INFO -  119 Cucctest.cpp 405 UCC Call Result = 0
+12:03:00:293 <font size=2 color=00AF00>z:\sampletest\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+12:03:00:306 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult
+12:03:06:700 INFO -  120 Cucctest.cpp 405 UCC Call Result = 0
+12:03:06:707 <font size=2 color=00AF00>z:\sampletest\master.script Line = 9 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+12:03:06:720 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase
+12:03:13:117 INFO -  121 Cucctest.cpp 405 UCC Call Result = 0
+12:03:13:125 <font size=2 color=00AF00>z:\sampletest\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+12:03:13:134 z:\sampletest\master.script RUN_TEST_STEP -1 TEF_Bluetooth_Server ConnectBT
+12:03:16:321 ERR  -  122 Testbluetooth.cpp 133 Connection Established[0]
+12:03:16:325 <font size=2 color=00AF00>z:\sampletest\master.script Line = 12 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server ConnectBT ***Result = PASS </font>
+12:03:16:337 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult
+12:03:22:014 INFO -  127 Cucctest.cpp 405 UCC Call Result = 0
+12:03:22:022 <font size=2 color=00AF00>z:\sampletest\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+12:03:22:034 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase
+12:03:28:450 INFO -  128 Cucctest.cpp 405 UCC Call Result = 0
+12:03:28:458 <font size=2 color=00AF00>z:\sampletest\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+12:03:28:467 z:\sampletest\master.script RUN_TEST_STEP -1 TEF_Bluetooth_Server TransferBT
+12:03:28:481 INFO -  122 Testbluetooth.cpp 225 File Size [891]
+12:03:28:484 INFO -  122 Testbluetooth.cpp 249  [256]
+12:03:28:487 INFO -  122 Testbluetooth.cpp 249  [256]
+12:03:28:490 INFO -  122 Testbluetooth.cpp 249  [256]
+12:03:28:492 INFO -  122 Testbluetooth.cpp 266 File Transfer Completed
+12:03:28:497 <font size=2 color=00AF00>z:\sampletest\master.script Line = 16 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server TransferBT ***Result = PASS </font>
+12:03:28:509 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult
+12:03:35:264 INFO -  129 Cucctest.cpp 405 UCC Call Result = 0
+12:03:35:271 <font size=2 color=00AF00>z:\sampletest\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+12:03:35:284 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase
+12:03:41:361 INFO -  130 Cucctest.cpp 405 UCC Call Result = 0
+12:03:41:369 <font size=2 color=00AF00>z:\sampletest\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS </font>
+12:03:41:402 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult
+12:03:48:136 INFO -  131 Cucctest.cpp 405 UCC Call Result = 0
+12:03:48:143 <font size=2 color=00AF00>z:\sampletest\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS </font>
+12:03:48:178 z:\sampletest\master.script RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StopService
+12:03:48:597 INFO -  132 Cucctest.cpp 405 UCC Call Result = 0
+12:03:48:605 <font size=2 color=00AF00>z:\sampletest\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StopService ***Result = PASS </font>
+12:03:48:627 <font size=2 color=00AFFF>SUMMARY:</font>
+12:03:48:635 <font size=2 color=00AF00>PASS = 12</font>
+12:03:48:701 <font size=2 color=FF0000>FAIL = 0</font>
+12:03:48:703 <font size=2 color=0000FF>ABORT = 0</font>
+12:03:48:705 <font size=2 color=0000FF>PANIC = 0</font>
+12:03:48:707 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:03:48:709 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:03:48:710 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:03:48:713 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Slave/TestResults.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,24 @@
+<html><body><pre>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 6 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 8 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 10 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 12 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server AcceptBT ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 13 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 15 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 17 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server  ReceiveBT ***Result = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 18 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 20 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+<font size=2 color=00AF00>z:\sampletest\slave.script Line = 22 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+<font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+<font size=2 color=00AF00>PASS = 2</font>
+<font size=2 color=FF0000>FAIL = 0</font>
+<font size=2 color=0000FF>ABORT = 0</font>
+<font size=2 color=0000FF>PANIC = 0</font>
+<font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+<font size=2 color=0000FF>UNKNOWN = 0</font>
+<font size=2 color=0000FF>UNEXECUTED = 0</font>
+<font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+<font size=2 color=00AF00>PASS = 4</font>
+<font size=2 color=FF0000>FAIL = 0</font>
+<font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+</pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Slave/slave.htm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,60 @@
+12:07:01:169 <html><body><pre>
+12:07:01:172 *** TestExecute Started 04/05/2005 12:07:01:172 ***
+12:07:01:199 z:\sampletest\slave.script PRINT UCC SyncService Test (Slave)
+12:07:01:202 INFO -  114 Scriptengine.cpp 855  UCC SyncService Test (Slave)
+
+12:07:01:210 z:\sampletest\slave.script LOAD_SUITE SampleServer
+12:07:01:248 z:\sampletest\slave.script LOAD_SUITE TEF_Bluetooth_Server  -SharedData
+12:07:01:288 z:\sampletest\slave.script START_SYNCHRONISED_TESTCASE TestOne
+12:07:01:296 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 6 Command = START_SYNCHRONISED_TESTCASE TestOne  </font>
+12:07:25:336 z:\sampletest\slave.script PRINT TestOne Sycnhronsised Test block
+12:07:25:431 INFO -  114 Scriptengine.cpp 855  TestOne Sycnhronsised Test block
+
+12:07:25:674 z:\sampletest\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:07:25:727 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 8 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS </font>
+12:07:25:828 z:\sampletest\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:07:25:993 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 10 Command = START_SYNCHRONISED_TESTCASE TestTwo  </font>
+12:07:38:178 z:\sampletest\slave.script PRINT TestTwo Sycnhronsised Test block
+12:07:38:181 INFO -  114 Scriptengine.cpp 855  TestTwo Sycnhronsised Test block
+
+12:07:38:191 z:\sampletest\slave.script RUN_TEST_STEP 100 TEF_Bluetooth_Server AcceptBT 
+12:07:38:220 INFO -  124 Testbluetooth.cpp 76 Connecting to Socket Server..
+12:07:38:230 INFO -  124 Testbluetooth.cpp 85 Connected to Socket Server..
+12:07:38:242 INFO -  124 Testbluetooth.cpp 113 Loaded L2CAP protocol..
+12:07:38:659 ERR  -  124 Testbluetooth.cpp 124 Open Socket [0]
+12:07:39:841 INFO -  124 Testbluetooth.cpp 138 Connection Established Successfully [0]
+12:07:39:846 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 12 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server AcceptBT ***Result = PASS </font>
+12:07:39:858 z:\sampletest\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:07:39:875 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 13 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS </font>
+12:07:39:892 z:\sampletest\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:07:39:897 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 15 Command = START_SYNCHRONISED_TESTCASE TestThree  </font>
+12:07:54:054 z:\sampletest\slave.script PRINT TestThree Sycnhronsised Test block
+12:07:54:056 INFO -  114 Scriptengine.cpp 855  TestThree Sycnhronsised Test block
+
+12:07:54:066 z:\sampletest\slave.script RUN_TEST_STEP 100 TEF_Bluetooth_Server  ReceiveBT 
+12:07:54:084 INFO -  124 Testbluetooth.cpp 222 Recieving File...
+12:07:54:095 INFO -  124 Testbluetooth.cpp 228  No Error in File Creation 0
+12:07:54:115 INFO -  124 Testbluetooth.cpp 265 Receiving File Completed Succesfully 0
+12:07:54:539 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 17 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server  ReceiveBT ***Result = PASS </font>
+12:07:54:550 z:\sampletest\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:07:54:566 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 18 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS </font>
+12:07:54:576 z:\sampletest\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:07:54:581 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 20 Command = START_SYNCHRONISED_TESTCASE TestFour  </font>
+12:08:06:912 z:\sampletest\slave.script PRINT TestFour Sycnhronsised Test block
+12:08:06:921 INFO -  114 Scriptengine.cpp 855  TestFour Sycnhronsised Test block
+
+12:08:06:977 z:\sampletest\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:08:06:993 <font size=2 color=00AF00>z:\sampletest\slave.script Line = 22 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS </font>
+12:08:07:021 <font size=2 color=00AFFF>TEST STEP SUMMARY:</font>
+12:08:07:081 <font size=2 color=00AF00>PASS = 2</font>
+12:08:07:308 <font size=2 color=FF0000>FAIL = 0</font>
+12:08:07:546 <font size=2 color=0000FF>ABORT = 0</font>
+12:08:07:551 <font size=2 color=0000FF>PANIC = 0</font>
+12:08:07:554 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:08:07:557 <font size=2 color=0000FF>UNKNOWN = 0</font>
+12:08:07:561 <font size=2 color=0000FF>UNEXECUTED = 0</font>
+12:08:07:564 <font size=2 color=00AFFF>TEST CASE SUMMARY:</font>
+12:08:07:569 <font size=2 color=00AF00>PASS = 4</font>
+12:08:07:574 <font size=2 color=FF0000>FAIL = 0</font>
+12:08:07:579 <font size=2 color=0000FF>INCONCLUSIVE = 0</font>
+12:08:07:585 </pre></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/Legacy/output0001.debug.html	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,478 @@
+<html> 
+<head> 
+<title>output0001.debug.html</title> 
+</head> 
+<body> 
+<pre> 
+<hr>
+<h1>output0001.debug.html</h1> 
+<h4>Thu Jun 09 11:55:31 2005
+</h4>
+<hr><h3>StartUseCase(1)</h3><hr> 
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 0 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=1 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StartServiceResult</b>(13, localhost, success)
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">1<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 1 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=1 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">1<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 2 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=2 STATE=1 VALUE="A" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">2<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">A</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 3 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=3 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">3<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 4 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=4 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">4<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 5 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=5 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">5<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 6 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=6 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">6<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 7 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=7 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">7<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 8 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=8 STATE=1 VALUE="000.0" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">8<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">000.0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 9 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=9 STATE=1 VALUE="000.0" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">9<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">000.0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 10 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=10 STATE=1 VALUE="013.7" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">10<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">013.7</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 11 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=11 STATE=1 VALUE="E" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">11<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">E</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 12 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=12 STATE=2 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">12<tr><td><font size="1">STATE</font></td><td><font size="1">2</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 13 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=13 STATE=1 VALUE="A" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">13<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">A</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 14 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=14 STATE=1 VALUE="3" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">14<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 15 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=15 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">15<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 16 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=16 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">16<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 17 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=17 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">17<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 18 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=18 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">18<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 19 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=19 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">19<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 20 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=20 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">20<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 21 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=21 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">21<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 22 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=22 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">22<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 23 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=23 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">23<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 24 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=24 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">24<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 25 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=25 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">25<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 26 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=26 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">26<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 27 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=27 STATE=1 VALUE="1.0" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">27<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">1.0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 28 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=28 STATE=1 VALUE="1.0" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">28<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">1.0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 29 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=29 STATE=1 VALUE="1.0" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">29<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">1.0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 30 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=30 STATE=1 VALUE="5" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">30<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">5</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 31 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=31 STATE=1 VALUE="66.7" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">31<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">66.7</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 32 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=32 STATE=1 VALUE="30.0" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">32<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">30.0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 33 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=33 STATE=0 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">33<tr><td><font size="1">STATE</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 34 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=34 STATE=0 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">34<tr><td><font size="1">STATE</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 35 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=35 STATE=1 VALUE="1" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">35<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 36 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=36 STATE=1 VALUE="1" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">36<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 37 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=37 STATE=1 VALUE="1" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">37<tr><td><font size="1">STATE</font></td><td><font size="1">1<tr><td><font size="1">VALUE</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 38 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=38 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">38<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 39 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=39 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">39<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 40 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=40 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">40<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 41 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=41 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">41<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 42 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=42 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">42<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 43 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=43 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">43<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 44 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=44 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">44<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 45 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=45 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">45<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 46 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=46 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">46<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 47 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=47 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">47<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 48 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=48 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">48<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 49 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=49 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">49<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 50 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=50 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">50<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 51 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=51 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">51<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 52 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=52 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">52<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 53 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=53 STATE=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr><td><font size="1">FIELD</font></td><td><font size="1">53<tr><td><font size="1">STATE</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">12<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 54 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=1 ELEVATION=1 AZIMUTH=1 SNR=1 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">1<tr><td><font size="1">ELEVATION</font></td><td><font size="1">1<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">1<tr><td><font size="1">SNR</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 55 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=2 ELEVATION=2 AZIMUTH=2 SNR=2 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">2<tr><td><font size="1">ELEVATION</font></td><td><font size="1">2<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">2<tr><td><font size="1">SNR</font></td><td><font size="1">2</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 56 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=3 ELEVATION=3 AZIMUTH=3 SNR=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">3<tr><td><font size="1">ELEVATION</font></td><td><font size="1">3<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">3<tr><td><font size="1">SNR</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 57 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=4 ELEVATION=4 AZIMUTH=4 SNR=4 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">4<tr><td><font size="1">ELEVATION</font></td><td><font size="1">4<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">4<tr><td><font size="1">SNR</font></td><td><font size="1">4</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 58 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=5 ELEVATION=5 AZIMUTH=5 SNR=5 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">5<tr><td><font size="1">ELEVATION</font></td><td><font size="1">5<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">5<tr><td><font size="1">SNR</font></td><td><font size="1">5</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 59 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=6 ELEVATION=6 AZIMUTH=6 SNR=6 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">6<tr><td><font size="1">ELEVATION</font></td><td><font size="1">6<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">6<tr><td><font size="1">SNR</font></td><td><font size="1">6</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 60 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=7 ELEVATION=7 AZIMUTH=7 SNR=7 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">7<tr><td><font size="1">ELEVATION</font></td><td><font size="1">7<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">7<tr><td><font size="1">SNR</font></td><td><font size="1">7</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 61 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=8 ELEVATION=8 AZIMUTH=8 SNR=8 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">8<tr><td><font size="1">ELEVATION</font></td><td><font size="1">8<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">8<tr><td><font size="1">SNR</font></td><td><font size="1">8</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 62 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=9 ELEVATION=9 AZIMUTH=9 SNR=9 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">9<tr><td><font size="1">ELEVATION</font></td><td><font size="1">9<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">9<tr><td><font size="1">SNR</font></td><td><font size="1">9</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 63 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=10 ELEVATION=10 AZIMUTH=10 SNR=10 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">10<tr><td><font size="1">ELEVATION</font></td><td><font size="1">10<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">10<tr><td><font size="1">SNR</font></td><td><font size="1">10</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 64 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=11 ELEVATION=11 AZIMUTH=11 SNR=11 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">11<tr><td><font size="1">ELEVATION</font></td><td><font size="1">11<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">11<tr><td><font size="1">SNR</font></td><td><font size="1">11</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 65 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=12 ELEVATION=12 AZIMUTH=12 SNR=12 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr><td><font size="1">SATID</font></td><td><font size="1">12<tr><td><font size="1">ELEVATION</font></td><td><font size="1">12<tr><td><font size="1">AZIMUTH</font></td><td><font size="1">12<tr><td><font size="1">SNR</font></td><td><font size="1">12</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">17<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 66 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=1 FREQUENCY=1 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr><td><font size="1">SENTENCEID</font></td><td><font size="1">1<tr><td><font size="1">FREQUENCY</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 67 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=2 FREQUENCY=2 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr><td><font size="1">SENTENCEID</font></td><td><font size="1">2<tr><td><font size="1">FREQUENCY</font></td><td><font size="1">2</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 68 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=3 FREQUENCY=1 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr><td><font size="1">SENTENCEID</font></td><td><font size="1">3<tr><td><font size="1">FREQUENCY</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 69 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=4 FREQUENCY=3 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr><td><font size="1">SENTENCEID</font></td><td><font size="1">4<tr><td><font size="1">FREQUENCY</font></td><td><font size="1">3</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 70 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=5 FREQUENCY=1 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr><td><font size="1">SENTENCEID</font></td><td><font size="1">5<tr><td><font size="1">FREQUENCY</font></td><td><font size="1">1</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">18<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 71 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=28 FREQUENCY=1 STRING="TEST STRING - TEST STRING - TEST STRING" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">28<tr><td><font size="1">FREQUENCY</font></td><td><font size="1">1<tr><td><font size="1">STRING</font></td><td><font size="1">TEST STRING - TEST STRING - TEST STRING</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">28<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 72 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=22 COMPORT="COM2" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">22<tr><td><font size="1">COMPORT</font></td><td><font size="1">COM2</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">22<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 73 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=14 LATITUDE=0101.000 NS="N" LONGITUDE=01001.000 EW="E" )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">14<tr><td><font size="1">LATITUDE</font></td><td><font size="1">0101.000<tr><td><font size="1">NS</font></td><td><font size="1">N<tr><td><font size="1">LONGITUDE</font></td><td><font size="1">01001.000<tr><td><font size="1">EW</font></td><td><font size="1">E</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">14<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 74 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=15 SPEED=100 DIRECTION=45 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">15<tr><td><font size="1">SPEED</font></td><td><font size="1">100<tr><td><font size="1">DIRECTION</font></td><td><font size="1">45</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">15<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 75 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=10 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">10</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">10<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 76 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=26 )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>runcmd</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">26</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#0000C0"><tr bgcolor="#b0b0d0"><td colspan=2 align="center"><font size="3"><b>Command Reply</b></font></tr><tr bgcolor="#E0E0E0"><td><font size="1">SVCID</font></td><td><font size="1">13<tr bgcolor="#E0E0E0"><td><font size="1">SVCHOST</font></td><td><font size="1">localhost<tr bgcolor="#E0E0E0"><td><font size="1">METHODID</font></td><td><font size="1">26<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONCODE</font></td><td><font size="1">0<tr bgcolor="#E0E0E0"><td><font size="1">REQUESTCOMPLETIONDESC</font></td><td><font size="1">success<tr><td><font size="1">RESULT</font></td><td><font size="1">0</table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<hr>
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 77 - ExecuteString</b>( rendezvous )
+<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
+<br><table border="2" cellpadding=3 cellspacing="0" bordercolor="#008000"><tr bgcolor="#c0e0c0"><td colspan=2 align="center"><font size="3"><b>rendezvous</b></font></tr></table><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/Legacy/output0001.log.html	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,90 @@
+<html> 
+<head> 
+<meta HTTP-EQUIV="Refresh" CONTENT="5">
+<title>output0001.log.html</title> 
+</head> 
+<body> 
+<pre> 
+<hr>
+<h1>output0001.log.html</h1> 
+<h4>Thu Jun 09 11:55:31 2005
+</h4>
+<hr><h3>StartUseCase(1)</h3><hr> 
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 0 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 1 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=1 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 2 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=2 STATE=1 VALUE="A" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 3 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=3 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 4 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=4 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 5 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=5 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 6 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=6 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 7 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=7 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 8 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=8 STATE=1 VALUE="000.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 9 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=9 STATE=1 VALUE="000.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 10 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=10 STATE=1 VALUE="013.7" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 11 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=11 STATE=1 VALUE="E" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 12 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=12 STATE=2 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 13 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=13 STATE=1 VALUE="A" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 14 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=14 STATE=1 VALUE="3" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 15 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=15 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 16 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=16 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 17 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=17 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 18 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=18 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 19 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=19 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 20 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=20 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 21 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=21 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 22 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=22 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 23 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=23 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 24 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=24 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 25 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=25 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 26 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=26 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 27 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=27 STATE=1 VALUE="1.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 28 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=28 STATE=1 VALUE="1.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 29 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=29 STATE=1 VALUE="1.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 30 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=30 STATE=1 VALUE="5" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 31 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=31 STATE=1 VALUE="66.7" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 32 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=32 STATE=1 VALUE="30.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 33 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=33 STATE=0 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 34 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=34 STATE=0 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 35 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=35 STATE=1 VALUE="1" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 36 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=36 STATE=1 VALUE="1" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 37 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=37 STATE=1 VALUE="1" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 38 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=38 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 39 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=39 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 40 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=40 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 41 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=41 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 42 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=42 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 43 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=43 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 44 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=44 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 45 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=45 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 46 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=46 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 47 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=47 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 48 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=48 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 49 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=49 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 50 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=50 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 51 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=51 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 52 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=52 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 53 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=53 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 54 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=1 ELEVATION=1 AZIMUTH=1 SNR=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 55 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=2 ELEVATION=2 AZIMUTH=2 SNR=2 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 56 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=3 ELEVATION=3 AZIMUTH=3 SNR=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 57 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=4 ELEVATION=4 AZIMUTH=4 SNR=4 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 58 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=5 ELEVATION=5 AZIMUTH=5 SNR=5 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 59 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=6 ELEVATION=6 AZIMUTH=6 SNR=6 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 60 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=7 ELEVATION=7 AZIMUTH=7 SNR=7 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 61 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=8 ELEVATION=8 AZIMUTH=8 SNR=8 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 62 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=9 ELEVATION=9 AZIMUTH=9 SNR=9 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 63 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=10 ELEVATION=10 AZIMUTH=10 SNR=10 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 64 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=11 ELEVATION=11 AZIMUTH=11 SNR=11 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 65 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=12 ELEVATION=12 AZIMUTH=12 SNR=12 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 66 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=1 FREQUENCY=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 67 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=2 FREQUENCY=2 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 68 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=3 FREQUENCY=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 69 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=4 FREQUENCY=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 70 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=5 FREQUENCY=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 71 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=28 FREQUENCY=1 STRING="TEST STRING - TEST STRING - TEST STRING" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 72 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=22 COMPORT="COM2" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 73 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=14 LATITUDE=0101.000 NS="N" LONGITUDE=01001.000 EW="E" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 74 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=15 SPEED=100 DIRECTION=45 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 75 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=10 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 76 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=26 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 77 - ExecuteString</b>( rendezvous )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Results/Legacy/output0001.noref.html	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,89 @@
+<html> 
+<head> 
+<title>output0001.noref.html</title> 
+</head> 
+<body> 
+<pre> 
+<hr>
+<h1>output0001.noref.html</h1> 
+<h4>Thu Jun 09 11:55:31 2005
+</h4>
+<hr><h3>StartUseCase(1)</h3><hr> 
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 0 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 1 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=1 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 2 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=2 STATE=1 VALUE="A" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 3 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=3 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 4 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=4 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 5 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=5 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 6 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=6 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 7 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=7 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 8 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=8 STATE=1 VALUE="000.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 9 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=9 STATE=1 VALUE="000.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 10 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=10 STATE=1 VALUE="013.7" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 11 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=11 STATE=1 VALUE="E" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 12 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=12 STATE=2 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 13 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=13 STATE=1 VALUE="A" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 14 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=14 STATE=1 VALUE="3" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 15 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=15 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 16 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=16 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 17 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=17 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 18 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=18 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 19 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=19 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 20 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=20 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 21 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=21 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 22 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=22 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 23 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=23 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 24 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=24 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 25 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=25 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 26 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=26 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 27 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=27 STATE=1 VALUE="1.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 28 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=28 STATE=1 VALUE="1.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 29 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=29 STATE=1 VALUE="1.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 30 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=30 STATE=1 VALUE="5" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 31 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=31 STATE=1 VALUE="66.7" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 32 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=32 STATE=1 VALUE="30.0" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 33 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=33 STATE=0 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 34 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=34 STATE=0 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 35 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=35 STATE=1 VALUE="1" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 36 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=36 STATE=1 VALUE="1" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 37 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=37 STATE=1 VALUE="1" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 38 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=38 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 39 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=39 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 40 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=40 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 41 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=41 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 42 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=42 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 43 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=43 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 44 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=44 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 45 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=45 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 46 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=46 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 47 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=47 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 48 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=48 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 49 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=49 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 50 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=50 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 51 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=51 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 52 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=52 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 53 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=53 STATE=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 54 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=1 ELEVATION=1 AZIMUTH=1 SNR=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 55 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=2 ELEVATION=2 AZIMUTH=2 SNR=2 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 56 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=3 ELEVATION=3 AZIMUTH=3 SNR=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 57 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=4 ELEVATION=4 AZIMUTH=4 SNR=4 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 58 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=5 ELEVATION=5 AZIMUTH=5 SNR=5 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 59 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=6 ELEVATION=6 AZIMUTH=6 SNR=6 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 60 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=7 ELEVATION=7 AZIMUTH=7 SNR=7 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 61 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=8 ELEVATION=8 AZIMUTH=8 SNR=8 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 62 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=9 ELEVATION=9 AZIMUTH=9 SNR=9 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 63 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=10 ELEVATION=10 AZIMUTH=10 SNR=10 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 64 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=11 ELEVATION=11 AZIMUTH=11 SNR=11 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 65 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=17 SATID=12 ELEVATION=12 AZIMUTH=12 SNR=12 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 66 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=1 FREQUENCY=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 67 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=2 FREQUENCY=2 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 68 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=3 FREQUENCY=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 69 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=4 FREQUENCY=3 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 70 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=5 FREQUENCY=1 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 71 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=28 FREQUENCY=1 STRING="TEST STRING - TEST STRING - TEST STRING" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 72 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=22 COMPORT="COM2" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 73 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=14 LATITUDE=0101.000 NS="N" LONGITUDE=01001.000 EW="E" )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 74 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=15 SPEED=100 DIRECTION=45 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 75 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=10 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 76 - ExecuteString</b>( runcmd svcid=13 svchost="localhost" methodid=26 )
+&nbsp;&nbsp;&nbsp;<img src="bullet.gif" width="8" height="8" ><b>&nbsp; 77 - ExecuteString</b>( rendezvous )
Binary file testexecmgmt/ucc/Test/Results/TestResults.xls has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=TEFStatus
+param_name_2=VALUE
+param_value_2=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=TestDriverService
+methodid=1
+
+[StopService]
+svcname=TestDriverService
+methodid=2
+
+[BuildRun]
+svcname=TestDriverService
+call=BuildRun
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
+[RetrieveExecutionResult]
+svcname=TestDriverService
+call=RetrieveExecutionResult
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/master.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT UCC Tests - Synchronised test cases - SERIAL
+
+LOAD_SUITE UCCControlTE
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=TEFStatus
+param_name_2=VALUE
+param_value_2=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,38 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=TestDriverService
+methodid=1
+
+[StopService]
+svcname=TestDriverService
+methodid=2
+
+[BuildRun]
+svcname=TestDriverService
+call=BuildRun
+num_params=4
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+param_name_4=TRANSPORT
+param_value_4=tcp --ip 169.254.175.240
+
+[RetrieveExecutionResult]
+svcname=TestDriverService
+call=RetrieveExecutionResult
+num_params=4
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+param_name_4=TRANSPORT
+param_value_4=tcp --ip 169.254.175.240
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/master.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT UCC Tests - Synchronised test cases - SERIAL
+
+LOAD_SUITE UCCControlTE
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+RemoteHost=10.16.163.13:3010
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=TEFStatus
+param_name_2=VALUE
+param_value_2=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+[UCCControl]
+RemoteHost=10.16.163.13:3010
+
+[StartService]
+svcname=TestDriverService
+methodid=1
+
+[StopService]
+svcname=TestDriverService
+methodid=2
+
+[BuildRun]
+svcname=TestDriverService
+call=BuildRun
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
+[RetrieveExecutionResult]
+svcname=TestDriverService
+call=RetrieveExecutionResult
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/master.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT UCC Tests - Synchronised test cases - TCP
+
+LOAD_SUITE UCCControlTE
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Slave/sampletest.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,11 @@
+[SectionOne]
+
+TheString =StringOne
+TheInt    =1
+TheBool   =true
+
+[SectionTwo]
+
+TheString =PanicMe
+TheInt    =2
+TheBool   =false
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/BasicSync/Slave/slave.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,44 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT Synchronised test cases
+
+LOAD_SUITE SampleServer
+
+START_SYNCHRONISED_TESTCASE TestOne
+PRINT TestOne Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestOne
+
+START_SYNCHRONISED_TESTCASE TestTwo
+PRINT TestTwo Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestTwo
+
+START_SYNCHRONISED_TESTCASE TestThree
+PRINT TestThree Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestThree
+
+START_SYNCHRONISED_TESTCASE TestFour
+PRINT TestFour Sycnhronsised Test block
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne
+END_SYNCHRONISED_TESTCASE TestFour
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=TEFStatus
+param_name_2=VALUE
+param_value_2=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=TestDriverService
+methodid=1
+
+[StopService]
+svcname=TestDriverService
+methodid=2
+
+[BuildRun]
+svcname=TestDriverService
+call=BuildRun
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
+[RetrieveExecutionResult]
+svcname=TestDriverService
+call=RetrieveExecutionResult
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/master.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,43 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT UCC Tests - Synchronised test cases - SERIAL
+PRINT
+PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+
+LOAD_SUITE UCCControlTE
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+RemoteHost=10.16.163.13:3010
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=TEFStatus
+param_name_2=VALUE
+param_value_2=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+[UCCControl]
+RemoteHost=10.16.163.13:3010
+
+[StartService]
+svcname=TestDriverService
+methodid=1
+
+[StopService]
+svcname=TestDriverService
+methodid=2
+
+[BuildRun]
+svcname=TestDriverService
+call=BuildRun
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
+[RetrieveExecutionResult]
+svcname=TestDriverService
+call=RetrieveExecutionResult
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/master.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,43 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT UCC Tests - Synchronised test cases - TCP
+PRINT
+PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+
+LOAD_SUITE UCCControlTE
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/SyncService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=SyncService
+methodid=1
+
+[StopService]
+svcname=SyncService
+methodid=2
+
+[StartSyncTestCase]
+svcname=SyncService
+call=StartSyncTestCase
+num_params=0
+
+[RetrieveSyncTestCaseResult]
+svcname=SyncService
+call=RetrieveSyncTestCaseResult
+num_params=0
+
+[SetSharedData]
+svcname=SyncService
+call=SetSharedData
+num_params=2
+param_name_1=NAME
+param_value_1=TEFStatus
+param_name_2=VALUE
+param_value_2=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/TestDriverService.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+[UCCControl]
+CommPortIndex=1
+
+[StartService]
+svcname=TestDriverService
+methodid=1
+
+[StopService]
+svcname=TestDriverService
+methodid=2
+
+[BuildRun]
+svcname=TestDriverService
+call=BuildRun
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
+[RetrieveExecutionResult]
+svcname=TestDriverService
+call=RetrieveExecutionResult
+num_params=3
+param_name_1=PLATFORM
+param_value_1=ARMV5
+param_name_2=BUILD
+param_value_2=UREL
+param_name_3=SUITE
+param_value_3=SampleTestServer
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/master.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,43 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT UCC Tests - Synchronised test cases - WinTunnel
+PRINT
+PRINT Using SetSharedData to initiate the slave side synchronised test blocks
+
+LOAD_SUITE UCCControlTE
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult
+
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService
+RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/SharedData.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,3 @@
+[SharedDataTest]
+shared_data_num = 1
+shared_name_1 = SharedDataTest
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/slave.script	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,42 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT Synchronised test cases
+
+LOAD_SUITE SharedDataServer
+
+SHARED_DATA   c:\shareddata.ini  SharedDataTest
+
+START_SYNCHRONISED_TESTCASE TestOne
+PRINT TestOne Sycnhronsised Test block
+RUN_TEST_STEP 100 SharedDataserver SharedDataStep
+END_SYNCHRONISED_TESTCASE TestOne
+
+START_SYNCHRONISED_TESTCASE TestTwo
+PRINT TestTwo Sycnhronsised Test block
+RUN_TEST_STEP 100 SharedDataserver SharedDataStep
+END_SYNCHRONISED_TESTCASE TestTwo
+
+START_SYNCHRONISED_TESTCASE TestThree
+PRINT TestThree Sycnhronsised Test block
+RUN_TEST_STEP 100 SharedDataserver SharedDataStep
+END_SYNCHRONISED_TESTCASE TestThree
+
+START_SYNCHRONISED_TESTCASE TestFour
+PRINT TestFour Sycnhronsised Test block
+RUN_TEST_STEP 100 SharedDataserver SharedDataStep
+END_SYNCHRONISED_TESTCASE TestFour
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/Scripts/SetSharedData/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/CommandLineTest.dtd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,36 @@
+<!ELEMENT CommandLineTest (name,commandLine,logFile?,timeout,dependencies?)>
+<!ELEMENT name (#PCDATA)>
+<!-- Name for your test. -->
+<!ELEMENT commandLine (#PCDATA)>
+<!-- Command to be executed  on the device. [As it appears on the command line]  -->
+
+<!ELEMENT logFile (#PCDATA)>
+<!-- Optional tag, specify a log file to be retrieved after the test has run -->
+<!ELEMENT timeout (#PCDATA)>
+<!--Timeout (seconds) for the test -->
+<!-- Dependencies -->
+<!--  Any test dependencies must go here.  Option of four different types. All are optional. -->
+<!ELEMENT dependencies (data*,build*,delete*,retrieve*)>
+<!-- DATA -->
+<!-- Any data file needed by the test to be copied to the device during run time. -->
+<!ELEMENT data (hostPath,devicePath+)>
+<!ELEMENT data.hostPath (#PCDATA)>
+<!ELEMENT data.devicePath (#PCDATA)>
+<!-- BUILDABLE -->
+<!-- Any binary file needed by the test to be copied to the device during run time. -->
+<!ELEMENT build (hostPath,devicePath+,mmpFile,bldInfPath)>
+<!ATTLIST build type CDATA "test">
+<!ELEMENT build.hostPath (#PCDATA)>
+<!ELEMENT build.devicePath (#PCDATA)>
+<!ELEMENT build.mmpFile (#PCDATA)>
+<!ELEMENT build.bldInfPath (#PCDATA)>
+<!-- DELETABLE -->
+<!-- Any file to be deleted from the device after the test has run. -->
+<!ELEMENT delete (devicePath)>
+<!ELEMENT delete.devicePath (#PCDATA)>
+<!-- RETRIEVABLE -->
+<!-- Any file to be retrieved and deleted from the device after the test has run. -->
+<!ELEMENT retrieve (devicePath,hostPath)>
+<!ATTLIST retrieve timeStamp (yes|no) "no">
+<!ELEMENT retrieve.devicePath (#PCDATA)>
+<!ELEMENT retrieve.hostPath (#PCDATA)>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/RTest.dtd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+<!ELEMENT RTest (name,mmpFile,bldInfPath,devicePath?,resoureItems?,resultFile?,logMemory?,timeout,dependencies?)>
+<!ATTLIST RTest type CDATA "normal">
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT mmpFile (#PCDATA)>
+<!ELEMENT bldInfPath (#PCDATA)>
+<!ELEMENT devicePath (#PCDATA)>
+
+<!-- resource items -->
+<!ELEMENT resourceItems (resource*,aif*)>
+<!ELEMENT resource (hostPath,devicePath+)>
+<!ELEMENT resource.hostPath (#PCDATA)>
+<!ELEMENT resource.devicePath (#PCDATA)>
+<!ELEMENT aif (hostPath,devicePath+)>
+<!ELEMENT aif.hostPath (#PCDATA)>
+<!ELEMENT aif.devicePath (#PCDATA)>
+
+<!ELEMENT resultFile (#PCDATA)>
+<!ELEMENT logMemory (#PCDATA)>
+<!ELEMENT timeout (#PCDATA)>
+
+<!-- Dependencies -->
+<!ELEMENT dependencies (data*,buildable*)>
+<!-- DATA -->
+<!ELEMENT data (hostPath,devicePath+)>
+<!ELEMENT hostPath (#PCDATA)>
+<!ELEMENT data.devicePath (#PCDATA)>
+
+<!-- BUILDABLE -->
+<!ELEMENT buildable (hostPath,devicePath+,mmpFile,bldInfPath,resourceItems?)>
+<!ATTLIST buildable type CDATA "test">
+<!ELEMENT buildable.hostPath (#PCDATA)>
+<!ELEMENT buildable.devicePath (#PCDATA)>
+<!ELEMENT buildable.mmpFile (#PCDATA)>
+<!ELEMENT buildable.bldInfPath (#PCDATA)>
+<!ELEMENT buildable.resourceItems (resource*,aif*)>
+<!ELEMENT buildable.resourceItems.resource (hostPath,devicePath+)>
+<!ELEMENT buildable.resourceItems.resource.hostPath (#PCDATA)>
+<!ELEMENT buildable.resourceItems.resource.devicePath (#PCDATA)>
+<!ELEMENT buildable.resourceItems.aif (hostPath,devicePath+)>
+<!ELEMENT buildable.resourceItems.aif.hostPath (#PCDATA)>
+<!ELEMENT buildable.resourceItems.aif.devicePath (#PCDATA)>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/RTestRom.dtd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,6 @@
+<!ELEMENT RTestRom (name,devicePath,resultFile*,timeout)>
+<!ATTLIST RTestRom type CDATA "normal">
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT devicePath (#PCDATA)>
+<!ELEMENT resultFile (#PCDATA)>
+<!ELEMENT timeout (#PCDATA)>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/SampleTestServer.xml	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE testExecuteTest SYSTEM "file:///c:/program files/common files/symbian/testExecuteTest.dtd" [ ]>
+
+<testSuite>
+	<name>SampleTestServer</name>
+
+	<testItems>
+		<test>UCCSlaveTest</test>
+	</testItems>
+
+	<testExecuteServers>
+		<server>SampleServer</server>
+	</testExecuteServers>
+</testSuite>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/SampleTestServer/UCCSlaveTest.xml	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE testExecuteTest SYSTEM "file:///c:/program files/common files/symbian/testExecuteTest.dtd" [ ]>
+
+<testExecuteTest>
+	<name>
+		UCCSlaveTest
+	</name>
+		
+	<timeout>
+		120
+	</timeout>
+	
+	<testScripts>
+		<script>
+			<hostPath>\UCC_Test\Scripts\BasicSync\Slave\slave.script</hostPath>
+			<devicePath>c:\UCC\slave.script</devicePath>
+		</script>
+	</testScripts>
+
+	<testServers>
+		<server>SampleServer</server>
+	</testServers>
+</testExecuteTest>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/SampleTestServer/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/SampleTestServer/testExecuteServers/SampleServer.xml	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE testExecuteServer SYSTEM "file:///c:/program files/common files/symbian/testExecuteServer.dtd" [ ]>
+
+<testExecuteServer>
+	<name>
+		SampleServer
+	</name>
+	
+	<mmpFile>
+		SampleServer.mmp
+	</mmpFile>
+	
+	<bldInfPath>
+		\EPOC\development\personal\jamesv\ProductisedUCC\TestExecute\Group\bld.inf
+	</bldInfPath>
+
+	<iniItems>
+		<iniFile>
+			<hostPath>\UCC_Test\Scripts\BasicSync\Slave\sampletest.ini</hostPath>
+			<devicePath>c:\UCC\sampletest.ini</devicePath>
+		</iniFile>
+	</iniItems>
+</testExecuteServer>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/SampleTestServer/testExecuteServers/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/UCCSlave.xml	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE testExecuteTest SYSTEM "file:///c:/program files/common files/symbian/testExecuteTest.dtd" [ ]>
+
+<testExecuteTest>
+	<name>UCCSlave</name>
+
+	<testItems>
+		<suite>SampleTestServer</suite>
+	</testItems>
+
+</testExecuteTest>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/root.xml	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE testSuite SYSTEM "file:///c:/program files/common files/symbian/testSuite.dtd" [ ]>
+<testSuite>
+	<name>root</name>
+
+	<testItems>
+		<suite>UCCSlave</suite>
+	</testItems>
+      
+</testSuite>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/testExecuteServer.dtd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,48 @@
+<!ELEMENT testExecuteServer (name,mmpFile,bldInfPath,iniItems?,configFile?,resourceItems?,dependencies?)>
+
+<!-- Server -->
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT mmpFile (#PCDATA)>
+<!ELEMENT bldInfPath (#PCDATA)>
+
+<!-- ini file -->
+<!ELEMENT iniItems (iniFile*)>
+<!ELEMENT iniFile (hostPath,devicePath+)>
+<!ELEMENT hostPath (#PCDATA)>
+<!ELEMENT devicePath (#PCDATA)>
+
+<!-- config file -->
+<!ELEMENT configFile (hostPath,devicePath+)>
+<!ELEMENT configFile.hostPath (#PCDATA)>
+<!ELEMENT configFile.devicePath (#PCDATA)>
+
+<!-- resource items -->
+<!ELEMENT resourceItems (resource*,aif*)>
+<!ELEMENT resource (hostPath,devicePath+)>
+<!ELEMENT resource.hostPath (#PCDATA)>
+<!ELEMENT resource.devicePath (#PCDATA)>
+<!ELEMENT aif (hostPath,devicePath+)>
+<!ELEMENT aif.hostPath (#PCDATA)>
+<!ELEMENT aif.devicePath (#PCDATA)>
+
+<!-- Dependencies -->
+<!ELEMENT dependencies (data*,buildable*)>
+<!-- DATA -->
+<!ELEMENT data (hostPath,devicePath+)>
+<!ELEMENT data.hostPath (#PCDATA)>
+<!ELEMENT data.devicePath (#PCDATA)>
+
+<!-- BUILDABLE -->
+<!ELEMENT buildable (hostPath,devicePath+,mmpFile,bldInfPath,resourceItems?)>
+<!ATTLIST buildable type CDATA "test">
+<!ELEMENT buildable.hostPath (#PCDATA)>
+<!ELEMENT buildable.devicePath (#PCDATA)>
+<!ELEMENT buildable.mmpFile (#PCDATA)>
+<!ELEMENT buildable.bldInfPath (#PCDATA)>
+<!ELEMENT buildable.resourceItems (resource*,aif*)>
+<!ELEMENT buildable.resourceItems.resource (hostPath,devicePath+)>
+<!ELEMENT buildable.resourceItems.resource.hostPath (#PCDATA)>
+<!ELEMENT buildable.resourceItems.resource.devicePath (#PCDATA)>
+<!ELEMENT buildable.resourceItems.resource.aif (hostPath,devicePath+)>
+<!ELEMENT buildable.resourceItems.aif.hostPath (#PCDATA)>
+<!ELEMENT buildable.resourceItems.aif.devicePath (#PCDATA)>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/testExecuteTest.dtd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+<!ELEMENT testExecuteTest (name,timeout,testScripts,stepLogs?,testServers,dependencies?)>
+
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT timeout (#PCDATA)>
+
+<!-- Test Scripts -->
+<!ELEMENT testScripts (script+)>
+<!ELEMENT script (hostPath,devicePath+)>
+<!ELEMENT hostPath (#PCDATA)>
+<!ELEMENT devicePath (#PCDATA)>
+
+<!-- Test Servers found in test scripts -->
+<!ELEMENT testServers (server+)>
+<!ELEMENT server (#PCDATA)>
+
+<!-- Test Servers found in test scripts -->
+<!ELEMENT stepLogs (log+)>
+<!ELEMENT log (#PCDATA)>
+
+<!-- Dependencies -->
+<!ELEMENT dependencies (data*,buildable*)>
+<!-- DATA -->
+<!ELEMENT data (hostPath,devicePath+)>
+<!ELEMENT data.hostPath (#PCDATA)>
+<!ELEMENT data.devicePath (#PCDATA)>
+
+<!-- BUILDABLE -->
+<!ELEMENT buildable (hostPath,devicePath+,mmpFile,bldInfPath,resourceItems?)>
+<!ATTLIST buildable type CDATA "test">
+<!ELEMENT buildable.hostPath (#PCDATA)>
+<!ELEMENT buildable.devicePath (#PCDATA)>
+<!ELEMENT mmpFile (#PCDATA)>
+<!ELEMENT bldInfPath (#PCDATA)>
+<!ELEMENT resourceItems (resource*,aif*)>
+<!ELEMENT resource (hostPath,devicePath+)>
+<!ELEMENT buildable.resource.hostPath (#PCDATA)>
+<!ELEMENT buildable.resource.devicePath (#PCDATA)>
+<!ELEMENT aif (hostPath,devicePath+)>
+<!ELEMENT buildable.aif.hostPath (#PCDATA)>
+<!ELEMENT buildable.aif.devicePath (#PCDATA)>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/Test/xml/testSuite.dtd	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,36 @@
+<!ELEMENT testSuite (name,testItems,testExecuteServers?,dependencies?)>
+
+<!ELEMENT name (#PCDATA)>
+
+<!-- Test Items in Suites: Tests and Suites -->
+<!ELEMENT testItems (suite*,test*,suiteRef*,testRef*)>
+<!ELEMENT suite (#PCDATA)>
+<!ELEMENT test (#PCDATA)>
+<!ELEMENT suiteRef (#PCDATA)>
+<!ELEMENT testRef (#PCDATA)>
+
+<!-- Test Execute Servers -->
+<!ELEMENT testExecuteServers (server*)>
+<!ELEMENT server (#PCDATA)>
+
+<!-- Dependencies -->
+<!ELEMENT dependencies (data*,buildable*)>
+<!-- DATA -->
+<!ELEMENT data (hostPath,devicePath+)>
+<!ELEMENT hostPath (#PCDATA)>
+<!ELEMENT devicePath (#PCDATA)>
+
+<!-- BUILDABLE -->
+<!ELEMENT buildable (hostPath,devicePath+,mmpFile,bldInfPath,resourceItems?)>
+<!ATTLIST buildable type CDATA "test">
+<!ELEMENT buildable.hostPath (#PCDATA)>
+<!ELEMENT buildable.devicePath (#PCDATA)>
+<!ELEMENT mmpFile (#PCDATA)>
+<!ELEMENT bldInfPath (#PCDATA)>
+<!ELEMENT resourceItems (resource+,aif+)>
+<!ELEMENT resource (hostPath,devicePath+)>
+<!ELEMENT buildable.resource.hostPath (#PCDATA)>
+<!ELEMENT buildable.resource.devicePath (#PCDATA)>
+<!ELEMENT aif (hostPath,devicePath+)>
+<!ELEMENT buildable.aif.hostPath (#PCDATA)>
+<!ELEMENT buildable.aif.devicePath (#PCDATA)>
Binary file testexecmgmt/ucc/bin/ucc.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testexecmgmt/ucc/bin/ucc.ini	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,7 @@
+[SyncService]
+ini=D:\epoc32\EngineeringTools\UCC\SyncService\Interface\Host\SyncServiceInterface.ini
+host=localhost
+
+[TestDriverService]
+ini=D:\epoc32\EngineeringTools\UCC\TestDriverService\Interface\Host\TestDriverServiceInterface.ini
+host=localhost
Binary file testtoolsconn/oncrpc/bin/oncrpc.dll has changed
Binary file testtoolsconn/oncrpc/bin/portmap.exe has changed
Binary file testtoolsconn/oncrpc/bin/portmap.srg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/bin/portmapinstall.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+copy *.* %windir%\system32
+%windir%\system32\portmap.exe /registerservice
+
Binary file testtoolsconn/oncrpc/binaries_for_build/oncrpcms.lib has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,24 @@
+//
+// Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRJ_EXPORTS
+
+../bin/portmapinstall.bat /oncrpc/bin/portmapinstall.bat
+../bin/portmap.exe	/oncrpc/bin/portmap.exe
+../bin/oncrpc.dll	/oncrpc/bin/oncrpc.dll
+../bin/portmap.srg	/oncrpc/bin/portmap.srg
+oncrpc.configure.nsh	/oncrpc/oncrpc.configure.nsh
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/group/oncrpc.configure.nsh	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,21 @@
+push $0
+push $1
+
+nsSCM::QueryStatus portmap 
+Pop $0 ; return error/success
+Pop $1 ; return service status
+  
+  ;!define SERVICE_STOPPED                0x00000001
+  ;!define SERVICE_START_PENDING          0x00000002
+  ;!define SERVICE_STOP_PENDING           0x00000003
+  ;!define SERVICE_RUNNING                0x00000004
+  ;!define SERVICE_CONTINUE_PENDING       0x00000005
+  ;!define SERVICE_PAUSE_PENDING          0x00000006
+  ;!define SERVICE_PAUSED                 0x00000007
+  
+${If} $0 == "error"  
+  nsExec::ExecToLog "$WINDIR\system32\portmap.exe /registerservice"
+${EndIf}
+
+pop $1
+pop $0
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/group/oncrpc.mrp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+component	ana_testexec_testtoolsconn_oncrpc
+
+source		/src/tools/ana/testexec/testtoolsconn/oncrpc
+exports     /src/tools/ana/testexec/testtoolsconn/oncrpc/group
+
+notes_source	/src/tools/ana/testexec/testtoolsconn/oncrpc/group/release.txt
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr T 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/group/oncrpc.tdf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,10 @@
+<tool name="ONCRPC" version="1.14.3" description="Basic installation of oncrpc">
+	<templates>
+		<template type="nsis" operation="configure" name="\epoc32\engineeringtools\oncrpc\oncrpc.configure.nsh" />
+	</templates>
+	<files>
+		<file source="\epoc32\engineeringtools\oncrpc\bin\oncrpc.dll" target="$WINDIR\system32" overwrite="false"/>
+		<file source="\epoc32\engineeringtools\oncrpc\bin\portmap.exe" target="$WINDIR\system32" overwrite="false"/>
+		<file source="\epoc32\engineeringtools\oncrpc\bin\portmap.srg" target="$WINDIR\system32" overwrite="false"/>
+	</files>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/group/release.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,5 @@
+NOTESRC_RELEASER
+Symbian Software Ltd. (kits.notify@symbian.com)
+
+NOTESRC_RELEASE_REASON
+ONCRPC release.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/AUTH.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,212 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)auth.h	2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+/*
+ * auth.h, Authentication interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ *
+ * The data structures are completely opaque to the client.  The client
+ * is required to pass a AUTH * to routines that create rpc
+ * "sessions".
+ */
+
+#ifndef __AUTH_HEADER__
+#define __AUTH_HEADER__
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+#define MAX_AUTH_BYTES	400
+#define MAXNETNAMELEN	255	/* maximum length of network user's name */
+
+/*
+ * Status returned from authentication check
+ */
+enum auth_stat {
+	AUTH_OK=0,
+	/*
+	 * failed at remote end
+	 */
+	AUTH_BADCRED=1,			/* bogus credentials (seal broken) */
+	AUTH_REJECTEDCRED=2,		/* client should begin new session */
+	AUTH_BADVERF=3,			/* bogus verifier (seal broken) */
+	AUTH_REJECTEDVERF=4,		/* verifier expired or was replayed */
+	AUTH_TOOWEAK=5,			/* rejected due to security reasons */
+	/*
+	 * failed locally
+	*/
+	AUTH_INVALIDRESP=6,		/* bogus response verifier */
+	AUTH_FAILED=7			/* some unknown reason */
+};
+
+#if (mc68000 || sparc || vax || i386)
+typedef u_long u_int32;	/* 32-bit unsigned integers */
+
+union des_block {
+	struct {
+		u_int32 high;
+		u_int32 low;
+	} key;
+	char c[8];
+};
+#else
+union des_block {
+        struct {
+                u_long high;
+                u_long low;
+        } key;
+        char c[8];
+};
+#endif
+typedef union des_block des_block;
+extern bool_t xdr_des_block(DOTS);
+
+/*
+ * Authentication info.  Opaque to client.
+ */
+struct opaque_auth {
+	enum_t	oa_flavor;		/* flavor of auth */
+	caddr_t	oa_base;		/* address of more auth stuff */
+	u_int	oa_length;		/* not to exceed MAX_AUTH_BYTES */
+};
+
+
+/*
+ * Auth handle, interface to client side authenticators.
+ */
+typedef struct {
+	struct	opaque_auth	ah_cred;
+	struct	opaque_auth	ah_verf;
+	union	des_block	ah_key;
+	struct auth_ops {
+		void	(*ah_nextverf)(DOTS);
+		int	(*ah_marshal)(DOTS);	/* nextverf & serialize */
+		int	(*ah_validate)(DOTS);	/* validate varifier */
+		int	(*ah_refresh)(DOTS);	/* refresh credentials */
+		void	(*ah_destroy)(DOTS);	/* destroy this structure */
+	} *ah_ops;
+	caddr_t ah_private;
+} AUTH;
+
+
+/*
+ * Authentication ops.
+ * The ops and the auth handle provide the interface to the authenticators.
+ *
+ * AUTH	*auth;
+ * XDR	*xdrs;
+ * struct opaque_auth verf;
+ */
+#define AUTH_NEXTVERF(auth)		\
+		((*((auth)->ah_ops->ah_nextverf))(auth))
+#define auth_nextverf(auth)		\
+		((*((auth)->ah_ops->ah_nextverf))(auth))
+
+#define AUTH_MARSHALL(auth, xdrs)	\
+		((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+#define auth_marshall(auth, xdrs)	\
+		((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+
+#define AUTH_VALIDATE(auth, verfp)	\
+		((*((auth)->ah_ops->ah_validate))((auth), verfp))
+#define auth_validate(auth, verfp)	\
+		((*((auth)->ah_ops->ah_validate))((auth), verfp))
+
+#define AUTH_REFRESH(auth)		\
+		((*((auth)->ah_ops->ah_refresh))(auth))
+#define auth_refresh(auth)		\
+		((*((auth)->ah_ops->ah_refresh))(auth))
+
+#define AUTH_DESTROY(auth)		\
+		((*((auth)->ah_ops->ah_destroy))(auth))
+#define auth_destroy(auth)		\
+		((*((auth)->ah_ops->ah_destroy))(auth))
+
+#ifdef WIN32
+#ifdef ONCRPCDLL
+extern struct opaque_auth _null_auth;
+#else
+#ifdef __BORLANDC__
+extern __declspec(dllimport) struct opaque_auth _null_auth;
+#else
+_declspec(dllimport) struct opaque_auth _null_auth;
+#endif
+#endif
+#else
+extern struct opaque_auth _null_auth;
+#endif
+
+
+/*
+ * These are the various implementations of client side authenticators.
+ */
+
+/*
+ * Unix style authentication
+ * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
+ *	char *machname;
+ *	int uid;
+ *	int gid;
+ *	int len;
+ *	int *aup_gids;
+ */
+extern AUTH *authunix_create(DOTS);
+extern AUTH *authunix_create_default(DOTS);	/* takes no parameters */
+extern AUTH *authnone_create(DOTS);		/* takes no parameters */
+extern AUTH *authdes_create(DOTS);
+
+#define AUTH_NONE	0		/* no authentication */
+#define	AUTH_NULL	0		/* backward compatibility */
+#define	AUTH_UNIX	1		/* unix style (uid, gids) */
+#define	AUTH_SHORT	2		/* short hand unix style */
+#define AUTH_DES	3		/* des style (encrypted timestamps) */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif	/* __AUTH_HEADER__ */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/AUTH_UNI.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,101 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)auth_unix.h	2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/*      @(#)auth_unix.h 1.5 86/07/16 SMI      */
+
+/*
+ * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+/*
+ * The system is very weak.  The client uses no encryption for  it
+ * credentials and only sends null verifiers.  The server sends backs
+ * null verifiers or optionally a verifier that suggests a new short hand
+ * for the credentials.
+ */
+
+#ifndef __AUTH_UNIX_HEADER__
+#define __AUTH_UNIX_HEADER__
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+/* The machine name is part of a credential; it may not exceed 255 bytes */
+#define MAX_MACHINE_NAME 255
+
+/* gids compose part of a credential; there may not be more than 16 of them */
+#define NGRPS 16
+
+/*
+ * Unix style credentials.
+ */
+struct authunix_parms {
+	u_long	 aup_time;
+	char	*aup_machname;
+	int	 aup_uid;
+	int	 aup_gid;
+	u_int	 aup_len;
+	int	*aup_gids;
+};
+
+extern bool_t xdr_authunix_parms(DOTS);
+
+/* 
+ * If a response verifier has flavor AUTH_SHORT, 
+ * then the body of the response verifier encapsulates the following structure;
+ * again it is serialized in the obvious fashion.
+ */
+struct short_hand_verf {
+	struct opaque_auth new_cred;
+};
+
+#ifdef __cplusplus
+};
+#endif
+
+
+#endif	/* __AUTH_UNIX_HEADER__ */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/BCOPY.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,27 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+/*********************************************************************
+ *
+ * Copyright (c) 1993 Martin F. Gergeleit
+ * 
+ *********************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void bcopy(char *,char*,int);
+void bcopy_nf(char *,char *,int);
+void bcopy_fn(char *,char *,int);
+void bcopy_ff(char *,char *,int);
+void bzero(char*,int);
+#ifdef __cplusplus
+};
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/CLNT.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,364 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)clnt.h	2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+/*
+ * clnt.h - Client side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _CLNT_
+#define _CLNT_
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+/*
+ * Rpc calls return an enum clnt_stat.  This should be looked at more,
+ * since each implementation is required to live with this (implementation
+ * independent) list of errors.
+ */
+enum clnt_stat {
+	RPC_SUCCESS=0,			/* call succeeded */
+	/*
+	 * local errors
+	 */
+	RPC_CANTENCODEARGS=1,		/* can't encode arguments */
+	RPC_CANTDECODERES=2,		/* can't decode results */
+	RPC_CANTSEND=3,			/* failure in sending call */
+	RPC_CANTRECV=4,			/* failure in receiving result */
+	RPC_TIMEDOUT=5,			/* call timed out */
+	/*
+	 * remote errors
+	 */
+	RPC_VERSMISMATCH=6,		/* rpc versions not compatible */
+	RPC_AUTHERROR=7,		/* authentication error */
+	RPC_PROGUNAVAIL=8,		/* program not available */
+	RPC_PROGVERSMISMATCH=9,		/* program version mismatched */
+	RPC_PROCUNAVAIL=10,		/* procedure unavailable */
+	RPC_CANTDECODEARGS=11,		/* decode arguments error */
+	RPC_SYSTEMERROR=12,		/* generic "other problem" */
+
+	/*
+	 * callrpc & clnt_create errors
+	 */
+	RPC_UNKNOWNHOST=13,		/* unknown host name */
+	RPC_UNKNOWNPROTO=17,		/* unkown protocol */
+
+	/*
+	 * _ create errors
+	 */
+	RPC_PMAPFAILURE=14,		/* the pmapper failed in its call */
+	RPC_PROGNOTREGISTERED=15,	/* remote program is not registered */
+	/*
+	 * unspecified error
+	 */
+	RPC_FAILED=16
+};
+
+
+/*
+ * Error info.
+ */
+struct rpc_err {
+	enum clnt_stat re_status;
+	union {
+		int RE_errno;		/* realated system error */
+		enum auth_stat RE_why;	/* why the auth error occurred */
+		struct {
+			u_long low;	/* lowest verion supported */
+			u_long high;	/* highest verion supported */
+		} RE_vers;
+		struct {		/* maybe meaningful if RPC_FAILED */
+			long s1;
+			long s2;
+		} RE_lb;		/* life boot & debugging only */
+	} ru;
+#define	re_errno	ru.RE_errno
+#define	re_why		ru.RE_why
+#define	re_vers		ru.RE_vers
+#define	re_lb		ru.RE_lb
+};
+
+
+/*
+ * Client rpc handle.
+ * Created by individual implementations, see e.g. rpc_udp.c.
+ * Client is responsible for initializing auth, see e.g. auth_none.c.
+ */
+typedef struct {
+	AUTH	*cl_auth;			/* authenticator */
+	struct clnt_ops {
+		enum clnt_stat	(*cl_call)(DOTS);	/* call remote procedure */
+		void		(*cl_abort)(DOTS);	/* abort a call */
+		void		(*cl_geterr)(DOTS);	/* get specific error code */
+		bool_t		(*cl_freeres)(DOTS); /* frees results */
+		void		(*cl_destroy)(DOTS);/* destroy this structure */
+		bool_t          (*cl_control)(DOTS);/* the ioctl() of rpc */
+	} *cl_ops;
+	caddr_t			cl_private;	/* private stuff */
+} CLIENT;
+
+
+/*
+ * client side rpc interface ops
+ *
+ * Parameter types are:
+ *
+ */
+
+/*
+ * enum clnt_stat
+ * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
+ * 	CLIENT *rh;
+ *	u_long proc;
+ *	xdrproc_t xargs;
+ *	caddr_t argsp;
+ *	xdrproc_t xres;
+ *	caddr_t resp;
+ *	struct timeval timeout;
+ */
+#define	CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)	\
+	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+#define	clnt_call(rh, proc, xargs, argsp, xres, resp, secs)	\
+	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+
+/*
+ * void
+ * CLNT_ABORT(rh);
+ * 	CLIENT *rh;
+ */
+#define	CLNT_ABORT(rh)	((*(rh)->cl_ops->cl_abort)(rh))
+#define	clnt_abort(rh)	((*(rh)->cl_ops->cl_abort)(rh))
+
+/*
+ * struct rpc_err
+ * CLNT_GETERR(rh);
+ * 	CLIENT *rh;
+ */
+#define	CLNT_GETERR(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
+#define	clnt_geterr(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
+
+
+/*
+ * bool_t
+ * CLNT_FREERES(rh, xres, resp);
+ * 	CLIENT *rh;
+ *	xdrproc_t xres;
+ *	caddr_t resp;
+ */
+#define	CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+#define	clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+
+/*
+ * bool_t
+ * CLNT_CONTROL(cl, request, info)
+ *      CLIENT *cl;
+ *      u_int request;
+ *      char *info;
+ */
+#define	CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+#define	clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+
+/*
+ * control operations that apply to both udp and tcp transports
+ */
+#define CLSET_TIMEOUT       1   /* set timeout (timeval) */
+#define CLGET_TIMEOUT       2   /* get timeout (timeval) */
+#define CLGET_SERVER_ADDR   3   /* get server's address (sockaddr) */
+/*
+ * udp only control operations
+ */
+#define CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
+#define CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
+
+/*
+ * void
+ * CLNT_DESTROY(rh);
+ * 	CLIENT *rh;
+ */
+#define	CLNT_DESTROY(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
+#define	clnt_destroy(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
+
+
+/*
+ * RPCTEST is a test program which is accessable on every rpc
+ * transport/port.  It is used for testing, performance evaluation,
+ * and network administration.
+ */
+
+#define RPCTEST_PROGRAM		((u_long)1)
+#define RPCTEST_VERSION		((u_long)1)
+#define RPCTEST_NULL_PROC	((u_long)2)
+#define RPCTEST_NULL_BATCH_PROC	((u_long)3)
+
+/*
+ * By convention, procedure 0 takes null arguments and returns them
+ */
+
+#define NULLPROC ((u_long)0)
+
+/*
+ * Below are the client handle creation routines for the various
+ * implementations of client side rpc.  They can return NULL if a 
+ * creation failure occurs.
+ */
+
+/*
+ * Memory based rpc (for speed check and testing)
+ * CLIENT *
+ * clntraw_create(prog, vers)
+ *	u_long prog;
+ *	u_long vers;
+ */
+extern CLIENT *clntraw_create(DOTS);
+
+
+/*
+ * Generic client creation routine. Supported protocols are "udp" and "tcp"
+ */
+extern CLIENT *
+clnt_create(/*host, prog, vers, prot*/DOTS); /*
+	char *host; 	-- hostname
+	u_long prog;	-- program number
+	u_long vers;	-- version number
+	char *prot;	-- protocol
+*/
+
+
+
+
+/*
+ * TCP based rpc
+ * CLIENT *
+ * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
+ *	struct sockaddr_in *raddr;
+ *	u_long prog;
+ *	u_long version;
+ *	register int *sockp;
+ *	u_int sendsz;
+ *	u_int recvsz;
+ */
+extern CLIENT *clnttcp_create(DOTS);
+
+/*
+ * UDP based rpc.
+ * CLIENT *
+ * clntudp_create(raddr, program, version, wait, sockp)
+ *	struct sockaddr_in *raddr;
+ *	u_long program;
+ *	u_long version;
+ *	struct timeval wait;
+ *	int *sockp;
+ *
+ * Same as above, but you specify max packet sizes.
+ * CLIENT *
+ * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
+ *	struct sockaddr_in *raddr;
+ *	u_long program;
+ *	u_long version;
+ *	struct timeval wait;
+ *	int *sockp;
+ *	u_int sendsz;
+ *	u_int recvsz;
+ */
+extern CLIENT *clntudp_create(DOTS);
+extern CLIENT *clntudp_bufcreate(DOTS);
+
+/*
+ * Print why creation failed
+ */
+void clnt_pcreateerror(/* char *msg */DOTS);	/* stderr */
+char *clnt_spcreateerror(/* char *msg */DOTS);	/* string */
+
+/*
+ * Like clnt_perror(), but is more verbose in its output
+ */ 
+void clnt_perrno(/* enum clnt_stat num */DOTS);	/* stderr */
+
+/*
+ * Print an English error message, given the client error code
+ */
+void clnt_perror(/* CLIENT *clnt, char *msg */DOTS); 	/* stderr */
+char *clnt_sperror(/* CLIENT *clnt, char *msg */DOTS);	/* string */
+
+/* 
+ * If a creation fails, the following allows the user to figure out why.
+ */
+struct rpc_createerr {
+	enum clnt_stat cf_stat;
+	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+};
+
+#ifdef WIN32
+#ifdef ONCRPCDLL
+extern struct rpc_createerr rpc_createerr;
+#else
+#ifdef __BORLANDC__
+extern __declspec(dllimport) struct rpc_createerr rpc_createerr;
+#else
+_declspec(dllimport) struct rpc_createerr rpc_createerr;
+#endif
+#endif
+#else
+extern struct rpc_createerr rpc_createerr;
+#endif
+
+
+/*
+ * Copy error message to buffer.
+ */
+char *clnt_sperrno(/* enum clnt_stat num */DOTS);	/* string */
+
+
+
+#define UDPMSGSIZE	8800	/* rpc imposed limit on udp msg size */
+#define RPCSMALLMSGSIZE	400	/* a more reasonable packet size */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /*!_CLNT_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/NETDB.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,51 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)netdb.h	2.1 88/07/29 3.9 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/*	@(#)rpc.h 1.8 87/07/24 SMI	*/
+
+/* Really belongs in <netdb.h> */
+
+struct rpcent {
+      char    *r_name;        /* name of server for this rpc program */
+      char    **r_aliases;    /* alias list */
+      int     r_number;       /* rpc program number */
+};
+
+struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/PMAP_CLN.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,88 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)pmap_clnt.h	2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+/*
+ * pmap_clnt.h
+ * Supplies C routines to get to portmap services.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+/*
+ * Usage:
+ *	success = pmap_set(program, version, protocol, port);
+ *	success = pmap_unset(program, version);
+ *	port = pmap_getport(address, program, version, protocol);
+ *	head = pmap_getmaps(address);
+ *	clnt_stat = pmap_rmtcall(address, program, version, procedure,
+ *		xdrargs, argsp, xdrres, resp, tout, port_ptr)
+ *		(works for udp only.) 
+ * 	clnt_stat = clnt_broadcast(program, version, procedure,
+ *		xdrargs, argsp,	xdrres, resp, eachresult)
+ *		(like pmap_rmtcall, except the call is broadcasted to all
+ *		locally connected nets.  For each valid response received,
+ *		the procedure eachresult is called.  Its form is:
+ *	done = eachresult(resp, raddr)
+ *		bool_t done;
+ *		caddr_t resp;
+ *		struct sockaddr_in raddr;
+ *		where resp points to the results of the call and raddr is the
+ *		address if the responder to the broadcast.
+ */
+
+extern bool_t		pmap_set(DOTS);
+extern bool_t		pmap_unset(DOTS);
+extern struct pmaplist	*pmap_getmaps(DOTS);
+enum clnt_stat		pmap_rmtcall(DOTS);
+enum clnt_stat		clnt_broadcast(DOTS);
+extern u_short		pmap_getport(DOTS);
+
+#ifdef __cplusplus
+};
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/PMAP_PRO.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,117 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)pmap_prot.h	2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+/*
+ * pmap_prot.h
+ * Protocol for the local binder service, or pmap.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ *
+ * The following procedures are supported by the protocol:
+ *
+ * PMAPPROC_NULL() returns ()
+ * 	takes nothing, returns nothing
+ *
+ * PMAPPROC_SET(struct pmap) returns (bool_t)
+ * 	TRUE is success, FALSE is failure.  Registers the tuple
+ *	[prog, vers, prot, port].
+ *
+ * PMAPPROC_UNSET(struct pmap) returns (bool_t)
+ *	TRUE is success, FALSE is failure.  Un-registers pair
+ *	[prog, vers].  prot and port are ignored.
+ *
+ * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
+ *	0 is failure.  Otherwise returns the port number where the pair
+ *	[prog, vers] is registered.  It may lie!
+ *
+ * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
+ *
+ * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
+ * 	RETURNS (port, string<>);
+ * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
+ * 	Calls the procedure on the local machine.  If it is not registered,
+ *	this procedure is quite; ie it does not return error information!!!
+ *	This procedure only is supported on rpc/udp and calls via
+ *	rpc/udp.  This routine only passes null authentication parameters.
+ *	This file has no interface to xdr routines for PMAPPROC_CALLIT.
+ *
+ * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
+ */
+
+#define PMAPPORT		((u_short)111)
+#define PMAPPROG		((u_long)100000)
+#define PMAPVERS		((u_long)2)
+#define PMAPVERS_PROTO		((u_long)2)
+#define PMAPVERS_ORIG		((u_long)1)
+#define PMAPPROC_NULL		((u_long)0)
+#define PMAPPROC_SET		((u_long)1)
+#define PMAPPROC_UNSET		((u_long)2)
+#define PMAPPROC_GETPORT	((u_long)3)
+#define PMAPPROC_DUMP		((u_long)4)
+#define PMAPPROC_CALLIT		((u_long)5)
+
+struct pmap {
+	long unsigned pm_prog;
+	long unsigned pm_vers;
+	long unsigned pm_prot;
+	long unsigned pm_port;
+};
+
+extern bool_t xdr_pmap(DOTS);
+
+struct pmaplist {
+	struct pmap	pml_map;
+	struct pmaplist *pml_next;
+};
+
+extern bool_t xdr_pmaplist(DOTS);
+
+#ifdef __cplusplus
+};
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/PMAP_RMT.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,75 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)pmap_rmt.h	2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+/*
+ * Structures and XDR routines for parameters to and replies from
+ * the portmapper remote-call-service.
+ *
+ * Copyright (C) 1986, Sun Microsystems, Inc.
+ */
+
+struct rmtcallargs {
+	u_long prog, vers, proc, arglen;
+	caddr_t args_ptr;
+	xdrproc_t xdr_args;
+};
+
+bool_t xdr_rmtcall_args(DOTS);
+
+struct rmtcallres {
+	u_long *port_ptr;
+	u_long resultslen;
+	caddr_t results_ptr;
+	xdrproc_t xdr_results;
+};
+
+bool_t xdr_rmtcallres(DOTS);
+#ifdef __cplusplus
+};
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/RPC.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,119 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc.h	2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+/*
+ * rpc.h, Just includes the billions of rpc header files necessary to
+ * do remote procedure calling.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+#ifndef __RPC_HEADER__
+#define __RPC_HEADER__
+
+#ifdef WIN32
+//#define FD_SETSIZE	128
+
+#include <stdlib.h>
+#include <winsock2.h>
+#include <rpc/types.h>		/* some typedefs */
+#include <process.h>
+
+#define WSAerrno (WSAGetLastError())
+#define gettimeofday(tv,tz) ((tv)->tv_sec = time(0), (tv)->tv_usec = 0)
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+extern int rpc_nt_init(void);
+extern int rpc_nt_exit(void);
+extern void nt_rpc_report(DOTS);
+
+#include <rpc/bcopy.h>
+extern int xdr_opaque_auth(DOTS);
+
+#ifdef __cplusplus
+};
+#endif
+
+#else
+#include <rpc/types.h>		/* some typedefs */
+#include <netinet/in.h>
+#endif
+
+/* external data representation interfaces */
+#include <rpc/xdr.h>		/* generic (de)serializer */
+
+/* Client side only authentication */
+#include <rpc/auth.h>		/* generic authenticator (client side) */
+
+/* Client side (mostly) remote procedure call */
+#include <rpc/clnt.h>		/* generic rpc stuff */
+
+/* semi-private protocol headers */
+#include <rpc/rpc_msg.h>	/* protocol for rpc messages */
+#ifdef WIN32
+#include <rpc/auth_uni.h>	/* protocol for unix style cred */
+#else
+#include <rpc/auth_unix.h>	/* protocol for unix style cred */
+#endif
+/*
+ *  Uncomment-out the next line if you are building the rpc library with
+ *  DES Authentication (see the README file in the secure_rpc/ directory).
+ */
+/*#include <rpc/auth_des.h>	/* protocol for des style cred */
+
+/* Server side only remote procedure callee */
+#include <rpc/svc.h>		/* service manager and multiplexer */
+#include <rpc/svc_auth.h>	/* service side authenticator */
+
+/*
+ * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION
+ * OF UNIX BASED ON NFSSRC.  These systems will already have the structures
+ * defined by <rpc/netdb.h> included in <netdb.h>.
+ */
+/* routines for parsing /etc/rpc */
+#include <rpc/netdb.h>		/* structures and routines to parse /etc/rpc */
+
+#endif /* ndef __RPC_HEADER__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/RPC_MSG.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,215 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)rpc_msg.h	2.1 88/07/29 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/*      @(#)rpc_msg.h 1.7 86/07/16 SMI      */
+
+/*
+ * rpc_msg.h
+ * rpc message definition
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef __RPC_MSG_HEADER__
+#define __RPC_MSG_HEADER__
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+#define RPC_MSG_VERSION		((u_long) 2)
+#define RPC_SERVICE_PORT	((u_short) 2048)
+
+/*
+ * Bottom up definition of an rpc message.
+ * NOTE: call and reply use the same overall stuct but
+ * different parts of unions within it.
+ */
+
+enum msg_type {
+	CALL=0,
+	REPLY=1
+};
+
+enum reply_stat {
+	MSG_ACCEPTED=0,
+	MSG_DENIED=1
+};
+
+enum accept_stat {
+	SUCCESS=0,
+	PROG_UNAVAIL=1,
+	PROG_MISMATCH=2,
+	PROC_UNAVAIL=3,
+	GARBAGE_ARGS=4,
+	SYSTEM_ERR=5
+};
+
+enum reject_stat {
+	RPC_MISMATCH=0,
+	AUTH_ERROR=1
+};
+
+/*
+ * Reply part of an rpc exchange
+ */
+
+/*
+ * Reply to an rpc request that was accepted by the server.
+ * Note: there could be an error even though the request was
+ * accepted.
+ */
+struct accepted_reply {
+	struct opaque_auth	ar_verf;
+	enum accept_stat	ar_stat;
+	union {
+		struct {
+			u_long	low;
+			u_long	high;
+		} AR_versions;
+		struct {
+			caddr_t	where;
+			xdrproc_t proc;
+		} AR_results;
+		/* and many other null cases */
+	} ru;
+#define	ar_results	ru.AR_results
+#define	ar_vers		ru.AR_versions
+};
+
+/*
+ * Reply to an rpc request that was rejected by the server.
+ */
+struct rejected_reply {
+	enum reject_stat rj_stat;
+	union {
+		struct {
+			u_long low;
+			u_long high;
+		} RJ_versions;
+		enum auth_stat RJ_why;  /* why authentication did not work */
+	} ru;
+#define	rj_vers	ru.RJ_versions
+#define	rj_why	ru.RJ_why
+};
+
+/*
+ * Body of a reply to an rpc request.
+ */
+struct reply_body {
+	enum reply_stat rp_stat;
+	union {
+		struct accepted_reply RP_ar;
+		struct rejected_reply RP_dr;
+	} ru;
+#define	rp_acpt	ru.RP_ar
+#define	rp_rjct	ru.RP_dr
+};
+
+/*
+ * Body of an rpc request call.
+ */
+struct call_body {
+	u_long cb_rpcvers;	/* must be equal to two */
+	u_long cb_prog;
+	u_long cb_vers;
+	u_long cb_proc;
+	struct opaque_auth cb_cred;
+	struct opaque_auth cb_verf; /* protocol specific - provided by client */
+};
+
+/*
+ * The rpc message
+ */
+struct rpc_msg {
+	u_long			rm_xid;
+	enum msg_type		rm_direction;
+	union {
+		struct call_body RM_cmb;
+		struct reply_body RM_rmb;
+	} ru;
+#define	rm_call		ru.RM_cmb
+#define	rm_reply	ru.RM_rmb
+};
+#define	acpted_rply	ru.RM_rmb.ru.RP_ar
+#define	rjcted_rply	ru.RM_rmb.ru.RP_dr
+
+
+/*
+ * XDR routine to handle a rpc message.
+ * xdr_callmsg(xdrs, cmsg)
+ * 	XDR *xdrs;
+ * 	struct rpc_msg *cmsg;
+ */
+extern bool_t	xdr_callmsg(DOTS);
+
+/*
+ * XDR routine to pre-serialize the static part of a rpc message.
+ * xdr_callhdr(xdrs, cmsg)
+ * 	XDR *xdrs;
+ * 	struct rpc_msg *cmsg;
+ */
+extern bool_t	xdr_callhdr(DOTS);
+
+/*
+ * XDR routine to handle a rpc reply.
+ * xdr_replymsg(xdrs, rmsg)
+ * 	XDR *xdrs;
+ * 	struct rpc_msg *rmsg;
+ */
+extern bool_t	xdr_replymsg(DOTS);
+
+/*
+ * Fills in the error part of a reply message.
+ * _seterr_reply(msg, error)
+ * 	struct rpc_msg *msg;
+ * 	struct rpc_err *error;
+ */
+extern void	_seterr_reply(DOTS);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif	/*  __RPC_MSG_HEADER__ */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/SVC.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,313 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)svc.h	2.2 88/07/29 4.0 RPCSRC; from 1.20 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+/*
+ * svc.h, Server-side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef __SVC_HEADER__
+#define __SVC_HEADER__
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+
+/*
+ * This interface must manage two items concerning remote procedure calling:
+ *
+ * 1) An arbitrary number of transport connections upon which rpc requests
+ * are received.  The two most notable transports are TCP and UDP;  they are
+ * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
+ * they in turn call xprt_register and xprt_unregister.
+ *
+ * 2) An arbitrary number of locally registered services.  Services are
+ * described by the following four data: program number, version number,
+ * "service dispatch" function, a transport handle, and a boolean that
+ * indicates whether or not the exported program should be registered with a
+ * local binder service;  if true the program's number and version and the
+ * port number from the transport handle are registered with the binder.
+ * These data are registered with the rpc svc system via svc_register.
+ *
+ * A service's dispatch function is called whenever an rpc request comes in
+ * on a transport.  The request's program and version numbers must match
+ * those of the registered service.  The dispatch function is passed two
+ * parameters, struct svc_req * and SVCXPRT *, defined below.
+ */
+
+enum xprt_stat {
+	XPRT_DIED,
+	XPRT_MOREREQS,
+	XPRT_IDLE
+};
+
+/*
+ * Server side transport handle
+ */
+typedef struct {
+	int		xp_sock;
+	u_short		xp_port;	 /* associated port number */
+	struct xp_ops {
+	    bool_t	(*xp_recv)(DOTS);	 /* receive incomming requests */
+	    enum xprt_stat (*xp_stat)(DOTS); /* get transport status */
+	    bool_t	(*xp_getargs)(DOTS); /* get arguments */
+	    bool_t	(*xp_reply)(DOTS);	 /* send reply */
+	    bool_t	(*xp_freeargs)(DOTS);/* free mem allocated for args */
+	    void	(*xp_destroy)(DOTS); /* destroy this struct */
+	} *xp_ops;
+	int		xp_addrlen;	 /* length of remote address */
+	struct sockaddr_in xp_raddr;	 /* remote address */
+	struct opaque_auth xp_verf;	 /* raw response verifier */
+	caddr_t		xp_p1;		 /* private */
+	caddr_t		xp_p2;		 /* private */
+} SVCXPRT;
+
+/*
+ *  Approved way of getting address of caller
+ */
+#define svc_getcaller(x) (&(x)->xp_raddr)
+
+/*
+ * Operations defined on an SVCXPRT handle
+ *
+ * SVCXPRT		*xprt;
+ * struct rpc_msg	*msg;
+ * xdrproc_t		 xargs;
+ * caddr_t		 argsp;
+ */
+#define SVC_RECV(xprt, msg)				\
+	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+#define svc_recv(xprt, msg)				\
+	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+
+#define SVC_STAT(xprt)					\
+	(*(xprt)->xp_ops->xp_stat)(xprt)
+#define svc_stat(xprt)					\
+	(*(xprt)->xp_ops->xp_stat)(xprt)
+
+#define SVC_GETARGS(xprt, xargs, argsp)			\
+	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+#define svc_getargs(xprt, xargs, argsp)			\
+	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+
+#define SVC_REPLY(xprt, msg)				\
+	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+#define svc_reply(xprt, msg)				\
+	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+
+#define SVC_FREEARGS(xprt, xargs, argsp)		\
+	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+#define svc_freeargs(xprt, xargs, argsp)		\
+	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+
+#define SVC_DESTROY(xprt)				\
+	(*(xprt)->xp_ops->xp_destroy)(xprt)
+#define svc_destroy(xprt)				\
+	(*(xprt)->xp_ops->xp_destroy)(xprt)
+
+
+/*
+ * Service request
+ */
+struct svc_req {
+	u_long		rq_prog;	/* service program number */
+	u_long		rq_vers;	/* service protocol version */
+	u_long		rq_proc;	/* the desired procedure */
+	struct opaque_auth rq_cred;	/* raw creds from the wire */
+	caddr_t		rq_clntcred;	/* read only cooked cred */
+	SVCXPRT	*rq_xprt;		/* associated transport */
+};
+
+
+/*
+ * Service registration
+ *
+ * svc_register(xprt, prog, vers, dispatch, protocol)
+ *	SVCXPRT *xprt;
+ *	u_long prog;
+ *	u_long vers;
+ *	void (*dispatch)(DOTS);
+ *	int protocol;  /* like TCP or UDP, zero means do not register 
+ */
+extern bool_t	svc_register(DOTS);
+
+/*
+ * Service un-registration
+ *
+ * svc_unregister(prog, vers)
+ *	u_long prog;
+ *	u_long vers;
+ */
+extern void	svc_unregister(DOTS);
+
+/*
+ * Transport registration.
+ *
+ * xprt_register(xprt)
+ *	SVCXPRT *xprt;
+ */
+extern void	xprt_register(DOTS);
+
+/*
+ * Transport un-register
+ *
+ * xprt_unregister(xprt)
+ *	SVCXPRT *xprt;
+ */
+extern void	xprt_unregister(DOTS);
+
+
+
+
+/*
+ * When the service routine is called, it must first check to see if it
+ * knows about the procedure;  if not, it should call svcerr_noproc
+ * and return.  If so, it should deserialize its arguments via 
+ * SVC_GETARGS (defined above).  If the deserialization does not work,
+ * svcerr_decode should be called followed by a return.  Successful
+ * decoding of the arguments should be followed the execution of the
+ * procedure's code and a call to svc_sendreply.
+ *
+ * Also, if the service refuses to execute the procedure due to too-
+ * weak authentication parameters, svcerr_weakauth should be called.
+ * Note: do not confuse access-control failure with weak authentication!
+ *
+ * NB: In pure implementations of rpc, the caller always waits for a reply
+ * msg.  This message is sent when svc_sendreply is called.  
+ * Therefore pure service implementations should always call
+ * svc_sendreply even if the function logically returns void;  use
+ * xdr.h - xdr_void for the xdr routine.  HOWEVER, tcp based rpc allows
+ * for the abuse of pure rpc via batched calling or pipelining.  In the
+ * case of a batched call, svc_sendreply should NOT be called since
+ * this would send a return message, which is what batching tries to avoid.
+ * It is the service/protocol writer's responsibility to know which calls are
+ * batched and which are not.  Warning: responding to batch calls may
+ * deadlock the caller and server processes!
+ */
+
+extern bool_t	svc_sendreply(DOTS);
+extern void	svcerr_decode(DOTS);
+extern void	svcerr_weakauth(DOTS);
+extern void	svcerr_noproc(DOTS);
+extern void	svcerr_progvers(DOTS);
+extern void	svcerr_auth(DOTS);
+extern void	svcerr_noprog(DOTS);
+extern void	svcerr_systemerr(DOTS);
+    
+/*
+ * Lowest level dispatching -OR- who owns this process anyway.
+ * Somebody has to wait for incoming requests and then call the correct
+ * service routine.  The routine svc_run does infinite waiting; i.e.,
+ * svc_run never returns.
+ * Since another (co-existant) package may wish to selectively wait for
+ * incoming calls or other events outside of the rpc architecture, the
+ * routine svc_getreq is provided.  It must be passed readfds, the
+ * "in-place" results of a select system call (see select, section 2).
+ */
+
+/*
+ * Global keeper of rpc service descriptors in use
+ * dynamic; must be inspected before each call to select 
+ */
+#ifdef FD_SETSIZE
+#ifdef WIN32
+#ifdef ONCRPCDLL
+extern fd_set svc_fdset;
+#else
+#ifdef __BORLANDC__
+extern __import fd_set svc_fdset;
+#else
+_declspec(dllimport) fd_set svc_fdset;
+#endif
+#endif
+#else
+extern fd_set svc_fdset;
+#endif
+#define svc_fds svc_fdset.fds_bits[0]	/* compatibility */
+#else
+extern int svc_fds;
+#endif /* def FD_SETSIZE */
+
+/*
+ * a small program implemented by the svc_rpc implementation itself;
+ * also see clnt.h for protocol numbers.
+ */
+extern void rpctest_service(DOTS);
+
+extern void	svc_getreq(DOTS);
+extern void	svc_getreqset(DOTS);	/* takes fdset instead of int */
+extern void	svc_run(DOTS); 	 /* never returns */
+
+/*
+ * Socket to use on svcxxx_create call to get default socket
+ */
+#define	RPC_ANYSOCK	-1
+
+/*
+ * These are the existing service side transport implementations
+ */
+
+/*
+ * Memory based rpc for testing and timing.
+ */
+extern SVCXPRT *svcraw_create(DOTS);
+
+/*
+ * Udp based rpc.
+ */
+extern SVCXPRT *svcudp_create(DOTS);
+extern SVCXPRT *svcudp_bufcreate(DOTS);
+
+/*
+ * Tcp based rpc.
+ */
+extern SVCXPRT *svctcp_create(DOTS);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __SVC_HEADER__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/SVC_AUTH.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,59 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)svc_auth.h	2.1 88/07/29 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/*      @(#)svc_auth.h 1.6 86/07/16 SMI      */
+
+/*
+ * svc_auth.h, Service side of rpc authentication.
+ * 
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+
+/*
+ * Server side authenticator
+ */
+#ifdef __cplusplus
+extern "C" auth_stat _authenticate(...);
+#else
+//AE:??? extern struct auth_stat _authenticate();
+extern enum auth_stat _authenticate();
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/TYPES.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,91 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)types.h	2.3 88/08/15 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/*      @(#)types.h 1.18 87/07/24 SMI      */
+
+/*
+ * Rpc additions to <sys/types.h>
+ */
+#ifndef __TYPES_RPC_HEADER__
+#define __TYPES_RPC_HEADER__
+
+#define	bool_t	int
+#define	enum_t	int
+#ifndef FALSE
+#define	FALSE	(0)
+#endif
+#ifndef TRUE
+#define	TRUE	(1)
+#endif
+#define __dontcare__	-1
+#ifndef NULL
+#	define NULL 0
+#endif
+
+#ifndef WIN32
+extern char *malloc();
+#endif
+#define mem_alloc	malloc
+#define mem_free(ptr, bsize)	free(ptr)
+
+#ifndef makedev /* ie, we haven't already included it */
+#include <sys/types.h>
+#endif
+#ifndef WIN32
+#include <sys/time.h>
+#endif
+
+#ifndef INADDR_LOOPBACK
+//#define       INADDR_LOOPBACK         (u_long)0x7F000001
+#endif
+#ifndef MAXHOSTNAMELEN
+#define        MAXHOSTNAMELEN  64
+#endif
+
+typedef char *caddr_t;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+typedef unsigned short u_short;
+
+//AE -- Additional to types to make compilation simpler
+#define opaque void
+#include "pmap_cln.h"
+
+#endif /* ndef __TYPES_RPC_HEADER__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/oncrpc/source_for_build/oncrpc/rpc/XDR.H	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,292 @@
+/*********************************************************************
+ * RPC for the Windows NT Operating System
+ * 1993 by Martin F. Gergeleit
+ * Users may use, copy or modify Sun RPC for the Windows NT Operating 
+ * System according to the Sun copyright below.
+ *
+ * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 
+ * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 
+ * USE OF. USE ENTIRELY AT YOUR OWN RISK!!!
+ *********************************************************************/
+
+/* @(#)xdr.h	2.2 88/07/29 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ * 
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ * 
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ * 
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ * 
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ * 
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+/*      @(#)xdr.h 1.19 87/04/22 SMI      */
+
+/*
+ * xdr.h, External Data Representation Serialization Routines.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef __XDR_HEADER__
+#define __XDR_HEADER__
+
+#ifdef __cplusplus
+extern "C" {
+#define DOTS ...
+#else
+#define DOTS
+#endif
+
+/*
+ * XDR provides a conventional way for converting between C data
+ * types and an external bit-string representation.  Library supplied
+ * routines provide for the conversion on built-in C data types.  These
+ * routines and utility routines defined here are used to help implement
+ * a type encode/decode routine for each user-defined type.
+ *
+ * Each data type provides a single procedure which takes two arguments:
+ *
+ *	bool_t
+ *	xdrproc(xdrs, argresp)
+ *		XDR *xdrs;
+ *		<type> *argresp;
+ *
+ * xdrs is an instance of a XDR handle, to which or from which the data
+ * type is to be converted.  argresp is a pointer to the structure to be
+ * converted.  The XDR handle contains an operation field which indicates
+ * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
+ *
+ * XDR_DECODE may allocate space if the pointer argresp is null.  This
+ * data can be freed with the XDR_FREE operation.
+ *
+ * We write only one procedure per data type to make it easy
+ * to keep the encode and decode procedures for a data type consistent.
+ * In many cases the same code performs all operations on a user defined type,
+ * because all the hard work is done in the component type routines.
+ * decode as a series of calls on the nested data types.
+ */
+
+/*
+ * Xdr operations.  XDR_ENCODE causes the type to be encoded into the
+ * stream.  XDR_DECODE causes the type to be extracted from the stream.
+ * XDR_FREE can be used to release the space allocated by an XDR_DECODE
+ * request.
+ */
+enum xdr_op {
+	XDR_ENCODE=0,
+	XDR_DECODE=1,
+	XDR_FREE=2
+};
+
+/*
+ * This is the number of bytes per unit of external data.
+ */
+#define BYTES_PER_XDR_UNIT	(4)
+#define RNDUP(x)  ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
+		    * BYTES_PER_XDR_UNIT)
+
+/*
+ * A xdrproc_t exists for each data type which is to be encoded or decoded.
+ *
+ * The second argument to the xdrproc_t is a pointer to an opaque pointer.
+ * The opaque pointer generally points to a structure of the data type
+ * to be decoded.  If this pointer is 0, then the type routines should
+ * allocate dynamic storage of the appropriate size and return it.
+ * bool_t	(*xdrproc_t)(XDR *, caddr_t *);
+ */
+typedef	bool_t (*xdrproc_t)(DOTS);
+
+/*
+ * The XDR handle.
+ * Contains operation which is being applied to the stream,
+ * an operations vector for the paticular implementation (e.g. see xdr_mem.c),
+ * and two private fields for the use of the particular impelementation.
+ */
+typedef struct {
+	enum xdr_op	x_op;		/* operation; fast additional param */
+	struct xdr_ops {
+		bool_t	(*x_getlong)(DOTS);	/* get a long from underlying stream */
+		bool_t	(*x_putlong)(DOTS);	/* put a long to " */
+		bool_t	(*x_getbytes)(DOTS);/* get some bytes from " */
+		bool_t	(*x_putbytes)(DOTS);/* put some bytes to " */
+		u_int	(*x_getpostn)(DOTS);/* returns bytes off from beginning */
+		bool_t  (*x_setpostn)(DOTS);/* lets you reposition the stream */
+		long *	(*x_inline)(DOTS);	/* buf quick ptr to buffered data */
+		void	(*x_destroy)(DOTS);	/* free privates of this xdr_stream */
+	} *x_ops;
+	caddr_t 	x_public;	/* users' data */
+	caddr_t		x_private;	/* pointer to private data */
+	caddr_t 	x_base;		/* private used for position info */
+	int		x_handy;	/* extra private word */
+} XDR;
+
+/*
+ * Operations defined on a XDR handle
+ *
+ * XDR		*xdrs;
+ * long		*longp;
+ * caddr_t	 addr;
+ * u_int	 len;
+ * u_int	 pos;
+ */
+#define XDR_GETLONG(xdrs, longp)			\
+	(*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+#define xdr_getlong(xdrs, longp)			\
+	(*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+
+#define XDR_PUTLONG(xdrs, longp)			\
+	(*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+#define xdr_putlong(xdrs, longp)			\
+	(*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+
+#define XDR_GETBYTES(xdrs, addr, len)			\
+	(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+#define xdr_getbytes(xdrs, addr, len)			\
+	(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+
+#define XDR_PUTBYTES(xdrs, addr, len)			\
+	(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+#define xdr_putbytes(xdrs, addr, len)			\
+	(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+
+#define XDR_GETPOS(xdrs)				\
+	(*(xdrs)->x_ops->x_getpostn)(xdrs)
+#define xdr_getpos(xdrs)				\
+	(*(xdrs)->x_ops->x_getpostn)(xdrs)
+
+#define XDR_SETPOS(xdrs, pos)				\
+	(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+#define xdr_setpos(xdrs, pos)				\
+	(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+
+#define	XDR_INLINE(xdrs, len)				\
+	(*(xdrs)->x_ops->x_inline)(xdrs, len)
+#define	xdr_inline(xdrs, len)				\
+	(*(xdrs)->x_ops->x_inline)(xdrs, len)
+
+#define	XDR_DESTROY(xdrs)				\
+	if ((xdrs)->x_ops->x_destroy) 			\
+		(*(xdrs)->x_ops->x_destroy)(xdrs)
+#define	xdr_destroy(xdrs)				\
+	if ((xdrs)->x_ops->x_destroy) 			\
+		(*(xdrs)->x_ops->x_destroy)(xdrs)
+
+/*
+ * Support struct for discriminated unions.
+ * You create an array of xdrdiscrim structures, terminated with
+ * a entry with a null procedure pointer.  The xdr_union routine gets
+ * the discriminant value and then searches the array of structures
+ * for a matching value.  If a match is found the associated xdr routine
+ * is called to handle that part of the union.  If there is
+ * no match, then a default routine may be called.
+ * If there is no match and no default routine it is an error.
+ */
+#define NULL_xdrproc_t ((xdrproc_t)0)
+struct xdr_discrim {
+	int	value;
+	xdrproc_t proc;
+};
+
+/*
+ * In-line routines for fast encode/decode of primitve data types.
+ * Caveat emptor: these use single memory cycles to get the
+ * data from the underlying buffer, and will fail to operate
+ * properly if the data is not aligned.  The standard way to use these
+ * is to say:
+ *	if ((buf = XDR_INLINE(xdrs, count)) == NULL)
+ *		return (FALSE);
+ *	<<< macro calls >>>
+ * where ``count'' is the number of bytes of data occupied
+ * by the primitive data types.
+ *
+ * N.B. and frozen for all time: each data type here uses 4 bytes
+ * of external representation.
+ */
+#define IXDR_GET_LONG(buf)		((long)ntohl((u_long)*(buf)++))
+#define IXDR_PUT_LONG(buf, v)		(*(buf)++ = (long)htonl((u_long)v))
+
+#define IXDR_GET_BOOL(buf)		((bool_t)IXDR_GET_LONG(buf))
+#define IXDR_GET_ENUM(buf, t)		((t)IXDR_GET_LONG(buf))
+#define IXDR_GET_U_LONG(buf)		((u_long)IXDR_GET_LONG(buf))
+#define IXDR_GET_SHORT(buf)		((short)IXDR_GET_LONG(buf))
+#define IXDR_GET_U_SHORT(buf)		((u_short)IXDR_GET_LONG(buf))
+
+#define IXDR_PUT_BOOL(buf, v)		IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_ENUM(buf, v)		IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_U_LONG(buf, v)		IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_SHORT(buf, v)		IXDR_PUT_LONG((buf), ((long)(v)))
+#define IXDR_PUT_U_SHORT(buf, v)	IXDR_PUT_LONG((buf), ((long)(v)))
+
+/*
+ * These are the "generic" xdr routines.
+ */
+extern bool_t	xdr_void(DOTS);
+extern bool_t	xdr_int(DOTS);
+extern bool_t	xdr_u_int(DOTS);
+extern bool_t	xdr_long(DOTS);
+extern bool_t	xdr_u_long(DOTS);
+extern bool_t	xdr_short(DOTS);
+extern bool_t	xdr_u_short(DOTS);
+extern bool_t	xdr_bool(DOTS);
+extern bool_t	xdr_enum(DOTS);
+extern bool_t	xdr_array(DOTS);
+extern bool_t	xdr_bytes(DOTS);
+extern bool_t	xdr_opaque(DOTS);
+extern bool_t	xdr_string(DOTS);
+extern bool_t	xdr_union(DOTS);
+extern bool_t	xdr_char(DOTS);
+extern bool_t	xdr_u_char(DOTS);
+extern bool_t	xdr_vector(DOTS);
+extern bool_t	xdr_float(DOTS);
+extern bool_t	xdr_double(DOTS);
+extern bool_t	xdr_reference(DOTS);
+extern bool_t	xdr_pointer(DOTS);
+extern bool_t	xdr_wrapstring(DOTS);
+
+/*
+ * Common opaque bytes objects used by many rpc protocols;
+ * declared here due to commonality.
+ */
+#define MAX_NETOBJ_SZ 1024 
+struct netobj {
+	u_int	n_len;
+	char	*n_bytes;
+};
+typedef struct netobj netobj;
+extern bool_t   xdr_netobj(DOTS);
+
+/*
+ * These are the public routines for the various implementations of
+ * xdr streams.
+ */
+extern void   xdrmem_create(DOTS);		/* XDR using memory buffers */
+extern void   xdrstdio_create(DOTS);	/* XDR using stdio library */
+extern void   xdrrec_create(DOTS);		/* XDR pseudo records for tcp */
+extern bool_t xdrrec_endofrecord(DOTS);	/* make end of xdr record */
+extern bool_t xdrrec_skiprecord(DOTS);	/* move to beginning of next record */
+extern bool_t xdrrec_eof(DOTS);		/* true if no more input */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __XDR_HEADER__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/common/inc/padpacket.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef PADPACKET_H_2B31B9BD_01D6_4f35_B525_4E07C03D7762
+#define PADPACKET_H_2B31B9BD_01D6_4f35_B525_4E07C03D7762
+
+#if ! defined __E32DEF_H__
+	// Win32 code.
+	typedef signed int TInt;
+	typedef int TBool;
+#endif // ! defined __E32DEF_H__
+
+static const int packetMultiple = 64;
+static const unsigned char packetPad = 'S';
+
+inline TBool PadPacket( TInt packetSize )
+{
+	return ( 0 == ( packetSize % packetMultiple ) );
+}
+
+#endif // defined PADPACKET_H_2B31B9BD_01D6_4f35_B525_4E07C03D7762
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/common/inc/serialpacketsize.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+
+#ifndef SERIALPACKETSIZE_H_D7CC307B_845C_4f9e_8079_C9C2C37A1B4D
+#define SERIALPACKETSIZE_H_D7CC307B_845C_4f9e_8079_C9C2C37A1B4D
+
+// The reference serial connection (with serial cable) has a
+// packet size of 4096 with an 8 bit header so we send 4088
+// bytes at a time.
+#define KMaxPacketSize								4088
+
+// The USB implementation has a packet size of 64k
+#define KMaxUSBPacketSize							0xFFFF
+
+// The Bluetooth implementation is implemented by virtual serial
+// port on the PC side but is socket based on the device side.
+// As far as the device goes there is no packet limit and messages
+// are not broken up in packet chunks.
+// Change the value from 1024 * 16 to 1024 * 4, testing proved 1024 * 16
+// is too large to communicate.
+#define KMaxBluetoothPacketSize					( 1024 * 4 )
+
+// The TCPIP transport is connection oriented and does not
+// need to packeted for transport at the application level.
+// However we do package it anyway so that the data can be 
+// collected in pieces and written to a file rather than a single
+// memory buffer.
+#define KMaxTCPIPPacketSize						( 1024 * 32 )
+
+#endif // defined SERIALPACKETSIZE_H_D7CC307B_845C_4f9e_8079_C9C2C37A1B4D
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/bin/dummy.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1 @@
+For solving the binary issue
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,42 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+
+PRJ_MMPFILES
+
+#include "../source/lib/group/bld.inf"
+#include "../source/dll/group/bld.inf"
+#include "../source/desktop/group/bld.inf"
+#include "../source/stat2perl/group/bld.inf"
+#include "../source/trgtest/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/group/release.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,5 @@
+NOTESRC_RELEASER
+Nokia Ltd. 
+
+NOTESRC_RELEASE_REASON
+STAT release.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/group/stat.mrp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+component  ana_testexec_testtoolsconn_stat
+source /src/tools/ana/testexec/testtoolsconn/stat
+binary /src/tools/ana/testexec/testtoolsconn/stat/desktop/group all
+exports /src/tools/ana/testexec/testtoolsconn/stat/desktop/group
+notes_source /src/tools/ana/testexec/testtoolsconn/stat/desktop/group/release.txt
+#notes_source ./release.txt
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr T 
+
+# == end auto-inserted section ==
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/group/stat_desktop.tdf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tool name="STATDesktop" 
+	description="STAT PC side."  
+	version="1.1.1001" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
+
+	<properties>
+		<property name="toolType" type="toolLogic" value="console"></property>
+		<property name="Path" type="toolLogic" value="$INSTDIR\stat\bin"></property>
+		<property name="dirRemove" type="uninstall" value="$INSTDIR\stat\bin"/>
+	</properties>
+
+	<files>
+		<file source="\epoc32\tools\STAT\stat.dll" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\epoc32\tools\STAT\stat.exp" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\epoc32\tools\STAT\stat.lib" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\epoc32\tools\STAT\STAT2PERL.exe" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\epoc32\tools\STAT\STATDesktop.exe" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\EPOC32\tools\stat\symbianusb.dll" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\EPOC32\tools\stat\symbianusb.inf" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\EPOC32\tools\stat\symbianusb.sys" target="$INSTDIR\stat\bin" overwrite="true" />
+		<file source="\EPOC32\tools\stat\symbianusb98.sys" target="$INSTDIR\stat\bin" overwrite="true" />
+	</files>
+
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/lib/dummy.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1 @@
+For solving the lib issue
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/inc/ini.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#ifndef INI_H
+#define INI_H
+
+#include <afxcoll.h>
+
+class CStatIniFile  
+{
+public:
+	CStatIniFile();
+	~CStatIniFile();
+	void SetIniFileName(const CString& strName);
+	BOOL SectionExists(const CString& strSection) const;
+	BOOL DeleteSection(const CString& strSection) const;
+	BOOL WriteKey(const CString& strValue, const CString& strKey, const CString& strSection) const;
+	CString GetKeyValue(const CString& strKey, const CString& strSection) const;
+private:
+	CString istrIniFileName;
+};
+
+#endif // __INI.H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/src/ini.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include <afxwin.h>
+
+#include "INI.h"
+#include <afxcoll.h>
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char THIS_FILE[]=__FILE__;
+#define new DEBUG_NEW
+#endif
+
+
+CStatIniFile::CStatIniFile()
+	{
+	}
+	
+CStatIniFile::~CStatIniFile()
+	{
+	}
+
+// return an empty string if section or key does not exist
+CString CStatIniFile::GetKeyValue(const CString& strKey,const CString& strSection) const
+{
+	TCHAR result[255];
+	GetPrivateProfileString((LPCTSTR)strSection,(LPCTSTR)strKey,_T(	""),result, 255, (LPCTSTR)istrIniFileName);	
+	CString strResult(result);
+	return strResult;
+}
+
+
+BOOL CStatIniFile::WriteKey(const CString& strValue, const CString& strKey, const CString& strSection) const
+{
+	return WritePrivateProfileString (strSection, strKey, strValue, istrIniFileName);
+
+}
+BOOL CStatIniFile::DeleteSection(const CString& strSection) const
+{
+	return WritePrivateProfileString(strSection,NULL,NULL,istrIniFileName);
+}
+
+BOOL CStatIniFile::SectionExists(const CString& strSection) const
+{
+	TCHAR result[255];	
+	long lRetValue = GetPrivateProfileString((LPCTSTR)strSection,NULL,_T(	""),result, 255, (LPCTSTR)istrIniFileName);
+	return (lRetValue > 0); //true if section exists
+}
+
+void CStatIniFile::SetIniFileName(const CString& strName)
+{
+	istrIniFileName = strName;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/transport/inc/cclientsocket.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATCLIENTSOCKET_H
+#define STATCLIENTSOCKET_H
+
+#include <afxsock.h>
+
+class CSTATSocket;
+
+class CClientSocket : public CSocket
+{
+	DECLARE_DYNAMIC(CClientSocket);
+
+	public:
+		CClientSocket(CSTATSocket* pSoc);
+		CSTATSocket* m_pSoc;
+
+	protected:
+		virtual void OnReceive(int nErrorCode);
+		virtual void OnAccept(int nErrorCode);
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/transport/inc/cstatmessagecom.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef CSTATMessageCOM_H
+#define CSTATMessageCOM_H
+
+#include <mpsdrc.h>
+#include <mpsdrc_i.c>
+#include <ECENG.H>
+#include "CSTATLogFile.h"
+
+class CSTATMessageCOM : public CCmdTarget
+{
+	DECLARE_DYNCREATE(CSTATMessageCOM)
+	
+	public :
+		CSTATMessageCOM();
+		virtual ~CSTATMessageCOM();
+		int Connect(CString& platformtype, CSTATLogFile *theLog);
+		bool Disconnect();
+		HRESULT SendMsg(BYTE id);
+		HRESULT SendMsg(BYTE id, VARIANT data);
+
+		//pointers to interfaces - need to be public so that CommandDecoderCOM can access and send the messages
+		LPECENGINES m_pIECEngineS;
+		LPECMACHINE m_pIECMachine;
+		LPECDRIVE m_pIECDrive;
+		EDFILEREQ From;
+		EDFILEREQ To;
+		EDDRIVEREQ Drive;
+		
+		bool Connected;
+
+	private :	
+		DECLARE_INTERFACE_MAP()
+			BEGIN_INTERFACE_PART(CommonSink, ICommonSink)
+				STDMETHOD(ProcessResponse)(BYTE* Response, DWORD bufsize);
+			END_INTERFACE_PART(CommonSink)
+		DECLARE_MESSAGE_MAP()
+
+		//non-interface part, called from interface
+		STDMETHOD(ProcessResponse)(BYTE* Response, DWORD bufsize);
+
+		void CopyResponseData(BYTE* pResponse, DWORD bufsize);
+
+		//used for processing device response data
+		BYTE* m_pResponseData;
+
+		// COM interfaces for EPOC Connect
+		ISendRequest* m_pISendReq;
+		ICommonSink* m_pICommonSink;		
+
+		CSTATLogFile *pLog;
+		bool bExternalInterface;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/transport/inc/statsocket.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#ifndef STATSOCKET_H
+#define STATSOCKET_H
+
+#include "statcommon.h"
+#include "stattransport.h"
+#include "CClientSocket.h"
+
+class CSTATSocket : public CSTATTransport
+{
+public:
+	CSTATSocket();
+	~CSTATSocket();
+	int Initialise(void);
+	int Connect(const char *pAddress = NULL);
+	int Send(const char cIdentifier, const char *pCommand = NULL, const unsigned long ulLength = 0);
+	int Receive(char *cIdentifier, char **ppData = NULL, unsigned long *pLength = NULL);
+	int Disconnect(void);
+	int Release(void);
+
+	int Listen(const char *pPort);
+	int ReceiveData();
+
+private:
+
+	CClientSocket* m_pSocket;
+	CClientSocket* m_pListen;
+	CSocketFile* m_pFile;
+	CArchive* m_pArchiveIn;
+	CArchive* m_pArchiveOut;
+
+	char ID;
+	char *pData;
+	unsigned long Length;
+	bool IsRecvData;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/transport/src/cclientsocket.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+
+#include "CClientSocket.h"
+#include "statsocket.h"
+
+#include <stddef.h>
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char BASED_CODE THIS_FILE[] = __FILE__;
+#endif
+
+IMPLEMENT_DYNAMIC(CClientSocket, CSocket)
+
+CClientSocket::CClientSocket(CSTATSocket* pSoc)
+{
+	m_pSoc = pSoc;
+}
+
+// callback function when data is waiting
+void CClientSocket::OnReceive(int nErrorCode)
+{
+	CSocket::OnReceive(nErrorCode);
+
+	while (!m_pSoc->ReceiveData())
+		Sleep(100);
+}
+
+// callback function when connection is waiting
+void CClientSocket::OnAccept(int nErrorCode)
+{
+	CSocket::OnAccept(nErrorCode);
+	m_pSoc->Connect(NULL);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/transport/src/cstatmessagecom.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "CSTATMessageCOM.h"
+#include <initguid.h>
+#include "ECGUID.H"
+#include <statcommon.h>
+
+//-------------------------------------------------------------------------------
+//MESSAGE MAP
+
+BEGIN_MESSAGE_MAP(CSTATMessageCOM, CCmdTarget)
+	//{{AFX_MSG_MAP(CSTATMessageCOM)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+//-------------------------------------------------------------------------------
+IMPLEMENT_DYNCREATE(CSTATMessageCOM, CCmdTarget)
+
+
+//constructor
+CSTATMessageCOM::CSTATMessageCOM()
+: 	m_pISendReq(NULL), m_pICommonSink(NULL), m_pResponseData(NULL), m_pIECEngineS(NULL),
+	m_pIECMachine(NULL), m_pIECDrive(NULL), Connected(false), bExternalInterface(false)
+{}
+
+//----------------------------------------------------------------------------
+//destructor
+CSTATMessageCOM::~CSTATMessageCOM()
+{
+	Disconnect();
+}
+
+//-------------------------------------------------------------------------------
+
+BEGIN_INTERFACE_MAP(CSTATMessageCOM, CCmdTarget)
+	INTERFACE_PART(CSTATMessageCOM, IID_ICommonSink, CommonSink)
+END_INTERFACE_MAP()
+
+//-------------------------------------------------------------------------------
+// IUnknown Interface 
+
+//memory management functions
+STDMETHODIMP_(ULONG) CSTATMessageCOM::XCommonSink::AddRef()
+{
+	METHOD_PROLOGUE(CSTATMessageCOM, CommonSink)
+	ASSERT(pThis);
+ 
+	TRACE(_T("Info::AddRef %d\n") ,pThis -> m_dwRef);
+	return pThis -> ExternalAddRef(); 
+}
+
+STDMETHODIMP_(ULONG) CSTATMessageCOM::XCommonSink::Release()
+{
+	METHOD_PROLOGUE(CSTATMessageCOM, CommonSink)
+	ASSERT(pThis);
+
+	TRACE(_T("Info::Release %d\n"),pThis -> m_dwRef);
+	return pThis -> ExternalRelease();
+}
+
+STDMETHODIMP CSTATMessageCOM::XCommonSink::QueryInterface(REFIID riid, void** ppv)
+{
+	METHOD_PROLOGUE(CSTATMessageCOM, CommonSink);
+	TRACE(_T("CSTATMessageCOM::XPWBKInfoQueryInterface\n"));
+
+	return pThis -> ExternalQueryInterface(&riid, ppv);
+}
+//-------------------------------------------------------------------------------
+// ICommonSink Interface
+STDMETHODIMP CSTATMessageCOM::XCommonSink::ProcessResponse(BYTE* Response, DWORD bufsize)
+{
+	METHOD_PROLOGUE(CSTATMessageCOM, CommonSink);
+	ASSERT(pThis);
+
+	pThis -> ProcessResponse(Response, bufsize);
+
+	return S_OK;
+}
+//----------------------------------------------------------------------------
+//Connection
+int CSTATMessageCOM::Connect(CString& platformtype, CSTATLogFile *theLog)
+{
+	pLog = theLog;
+
+	// convert to uppercase
+	platformtype.MakeUpper();
+
+	//select DLL to be initialised
+	CString STATServer;
+	if(platformtype == _T("ARM") || platformtype == _T("ARM4"))
+		STATServer = _T("STATApiARM4.DLL");
+	else if(platformtype == _T("WINS"))
+		STATServer = _T("STATApiWINS.DLL");
+	else if(platformtype == _T("THUMB"))
+		STATServer = _T("STATApiTHUMB.DLL");
+	else if(platformtype == _T("WINSCW"))
+		STATServer = _T("STATApiWINSCW.DLL");
+	else
+		return E_BADPLATFORM;
+
+	// disconnect if already connected
+	Disconnect();
+
+	// create an instance of the EPOC Connect Engine
+	if (FAILED(CoCreateInstance(CLSID_ECEngineS, NULL, CLSCTX_INPROC_SERVER, IID_IECEngineS, (void **)&m_pIECEngineS))) 
+	{
+		Disconnect();
+		return E_ENGINEOBJECTFAILURE;
+	}
+		
+	// get ISendReq interface
+	if (FAILED(ExternalQueryInterface(&IID_ICommonSink, (void**)&m_pICommonSink)))
+	{
+		Disconnect();
+		return E_BADREQUESTINTERFACE;
+	}
+	
+	IFileSystemInfoS *pFSInfo;
+	LPVOID *ppFSInfo = (LPVOID *)&pFSInfo;
+
+	// get an interface pointer to the FileSystemInfo struct
+	if (!bExternalInterface)
+	{
+		ExternalQueryInterface(&IID_IFileSystemInfoS, ppFSInfo);
+		bExternalInterface = true;
+	}
+
+	// initialise the EPOC Connect engine
+	m_pIECEngineS -> Init(pFSInfo);
+	if (m_pIECEngineS->Connect(15000) != S_OK) // connect, giving 15 seconds as maximum wait
+	{
+		Disconnect();
+		return E_ENGINECONNECTFAILURE;
+	}
+
+	// create an instance of the EPOC send request
+	if (FAILED(CoCreateInstance(CLSID_SendRequest, NULL, CLSCTX_INPROC_SERVER, IID_ISendRequest, (void**) &m_pISendReq)))
+	{
+		Disconnect();
+		return E_REQUESTOBJECTFAILURE;
+	}
+
+	BSTR bSTATstrServer = STATServer.AllocSysString();	//converts from CString to BSTR
+
+	//The 'Initialise' function starts up the generic custom server, copying it to the remote 
+	//EPOC machine if it is not there. It then checks that the application-specific server DLL 
+	//is loaded and up to date and, if not, copies it over to C:/system/libs. Finally, it 
+	//checks that the generic custom server found the interface.
+	if (FAILED(m_pISendReq -> Initialise(bSTATstrServer)))
+	{
+		Disconnect();
+		SysFreeString(bSTATstrServer);
+		return E_REQUESTINITFAILURE;
+	}
+
+	SysFreeString(bSTATstrServer);
+	Connected = true;	//flagged
+	return ITS_OK;
+}
+
+//-------------------------------------------------------------------------------
+//Disconnection
+bool CSTATMessageCOM::Disconnect()
+{
+	Connected = false;	//flagged as disconnected
+
+	if (m_pIECEngineS)
+	{
+		m_pIECEngineS->Release();
+		m_pIECEngineS = NULL;
+	}
+
+	// make sure tell EPOC side to close
+	if (m_pISendReq)
+	{
+		m_pISendReq->Release();
+		m_pISendReq = NULL;
+	}
+
+	if (bExternalInterface)
+	{
+		ExternalRelease();
+		bExternalInterface = false;
+	}
+
+	if(m_pResponseData)
+	{
+		delete[] m_pResponseData;
+		m_pResponseData = NULL;
+	}
+	
+	return true;
+}
+
+//-------------------------------------------------------------------------------
+//Send Message to device - no data
+HRESULT CSTATMessageCOM::SendMsg(BYTE id)
+{
+	HRESULT hr = S_OK;
+
+	for (int i=0;i<STAT_MAXRETRIES;i++)
+	{
+		if (SUCCEEDED(hr = m_pISendReq -> BuildNewRequest(1, id)))	//BuildNewRequest needed for creating header of message
+			if (SUCCEEDED(hr = m_pISendReq -> SendRequest(m_pICommonSink)))
+				return hr;
+
+		pLog->Set(E_COMMANDRETRY);
+		Sleep(STAT_RETRYDELAY);
+	}
+
+	pLog->Set(E_COMMANDFAILED);
+	return hr;
+}
+
+//-------------------------------------------------------------------------------
+//send message with data
+HRESULT CSTATMessageCOM::SendMsg(BYTE id, VARIANT data)
+{
+	HRESULT hr = S_OK;
+	
+	for (int i=0;i<STAT_MAXRETRIES;i++)
+	{
+		//will send data that has already been created in calling function
+		if (SUCCEEDED(hr = m_pISendReq -> BuildNewRequest(1, id)))
+			if (SUCCEEDED(hr = m_pISendReq -> AddBody(data)))		//adds body to the header (newly converted data)
+		{
+			if (SUCCEEDED(hr = m_pISendReq -> SendRequest(m_pICommonSink)))
+				return hr;
+		}
+
+		pLog->Set(E_COMMANDRETRY);
+		Sleep(STAT_RETRYDELAY);
+	}
+
+	pLog->Set(E_COMMANDFAILED);
+	return hr;
+}
+
+//-------------------------------------------------------------------------------
+// Retrieves a response from EPOC device
+STDMETHODIMP CSTATMessageCOM::ProcessResponse(BYTE* pResponse, DWORD bufsize)
+{
+	CopyResponseData(pResponse + 11, bufsize - 11);	//function called, removing the first 11 bytes (header info)
+	return S_OK;
+}
+
+//-------------------------------------------------------------------------------
+//function used to store newly formatted data into new variable
+void CSTATMessageCOM::CopyResponseData(BYTE* pResponse, DWORD bufsize)
+{
+	if(m_pResponseData)
+	{
+		delete[] m_pResponseData;
+		m_pResponseData = NULL;
+	}
+	
+	if(bufsize)
+	{
+		m_pResponseData = new BYTE[bufsize];
+		memcpy(m_pResponseData, pResponse, bufsize);
+	}
+}
+
+//-----------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/common/transport/src/statsocket.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,280 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "statsocket.h"
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+CSTATSocket::CSTATSocket()
+: m_pSocket((CClientSocket*)NULL),
+  m_pFile((CSocketFile*)NULL),
+  m_pArchiveIn((CArchive*)NULL),
+  m_pArchiveOut((CArchive*)NULL),
+  m_pListen((CClientSocket*)NULL),
+  IsRecvData(false),
+  ID(0), Length(0), pData(NULL)
+{
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+CSTATSocket::~CSTATSocket()
+{
+	Disconnect();
+	Release();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int CSTATSocket::Initialise(void)
+{
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int CSTATSocket::Connect(const char *pAddress)
+{
+	m_pSocket = new CClientSocket(this);
+
+	if (m_pSocket)
+	{
+		// if address supplied then we are attempting a connection
+		// else we are listening for a connection
+		if (pAddress && (*pAddress))
+		{
+			if (!m_pSocket->Create())
+			{
+				Disconnect();
+				return GENERAL_FAILURE;
+			}
+
+			char *p = strrchr(pAddress, ':');
+			int iPort = 700;
+			if (p)
+			{
+				(*p) = (char)0;
+
+				p++;
+				if (p && *p)
+					iPort = atoi(p);
+			}
+			int iRetry = 0;
+			while (!m_pSocket->Connect(pAddress, iPort))
+			{
+				iRetry++;
+				if (iRetry > 5)
+				{
+					Disconnect();
+					return E_TOOMANYERRORS;
+				}
+
+				Sleep(250);
+			}
+		}
+		else
+		{
+			if (!m_pListen->Accept(*m_pSocket))
+			{
+				Disconnect();
+				return E_CONNECTIONFAILED;
+			}
+
+			// don't need this object anymore
+			BYTE Buffer[50];
+			m_pListen->ShutDown();
+
+			while(m_pListen->Receive(Buffer,50) > 0);
+
+			delete m_pListen;
+			m_pListen = NULL;
+		}
+
+		m_pFile = new CSocketFile(m_pSocket);
+		m_pArchiveIn = new CArchive(m_pFile,CArchive::load);
+		m_pArchiveOut = new CArchive(m_pFile,CArchive::store);
+
+		// send acknowledgement message
+		Send('A', "Connected", 9);
+	}
+	else
+		return E_OUTOFMEM;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int CSTATSocket::Listen(const char *pPort)
+{
+	m_pListen = new CClientSocket(this);
+
+	if (m_pListen)
+	{
+		if (!m_pListen->Create(atoi(pPort)))
+			return E_CONNECTIONFAILED;
+
+		if (!m_pListen->Listen())
+			return E_CONNECTIONFAILED;
+	}
+	else
+		return E_OUTOFMEM;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int CSTATSocket::Send(const char cIdentifier, const char *pData, const unsigned long ulLength)
+{
+	if (m_pArchiveOut != NULL)
+	{
+		TRY
+		{
+			(*m_pArchiveOut) << cIdentifier;
+			(*m_pArchiveOut) << ulLength;
+
+			if (ulLength)
+				m_pArchiveOut->Write(pData, ulLength);
+
+			m_pArchiveOut->Flush();
+		}
+		CATCH(CFileException, e)
+		{
+			Disconnect();
+			return E_WRITEFAILED;
+		}
+		END_CATCH
+	}
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// External: passed received data back to calling function
+int CSTATSocket::Receive(char *cIdentifier, char **ppData, unsigned long *pLength)
+{
+	int ret = NO_DATA_AT_PORT;
+
+	if (IsRecvData)
+	{
+		(*cIdentifier) = ID;
+		(*pLength) = Length;
+		(*ppData) = pData;
+
+		IsRecvData = false;
+		ret = ITS_OK;
+	}
+
+	return ret;
+}
+	
+	
+////////////////////////////////////////////////////////////////////////////////////////
+// Internal: Receives data from the socket
+int CSTATSocket::ReceiveData()
+{
+	if (!IsRecvData)
+	{
+		unsigned long ActualRead = 0;
+
+		(*m_pArchiveIn) >> ID;
+		(*m_pArchiveIn) >> Length;
+
+		if(pData)
+		{
+			delete [] pData;
+		}
+
+		if (Length)
+		{
+			pData = new char [Length + 1];
+			if (pData)
+			{
+				ActualRead = m_pArchiveIn->Read(pData, Length);
+				*(pData + Length) = (char)0;
+			}
+			else
+				Length = 0;
+		}
+
+		IsRecvData = true;
+		return true;
+	}
+
+	return false;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int CSTATSocket::Disconnect(void)
+{
+	if (m_pArchiveOut)
+	{
+		delete m_pArchiveOut;
+		m_pArchiveOut = NULL;
+	}
+
+	if (m_pArchiveIn)
+	{
+		delete m_pArchiveIn;
+		m_pArchiveIn = NULL;
+	}
+
+	if (m_pFile)
+	{
+		delete m_pFile;
+		m_pFile = NULL;
+	}
+
+	if (m_pSocket)
+	{
+		BYTE Buffer[50];
+		m_pSocket->ShutDown();
+
+		while(m_pSocket->Receive(Buffer,50) > 0);
+
+		delete m_pSocket;
+		m_pSocket = NULL;
+	}
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int CSTATSocket::Release(void)
+{
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+//	PRIVATE FUNCTIONS
+////////////////////////////////////////////////////////////////////////////////////////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+
+TOOLS
+
+PRJ_MMPFILES
+// Extension Makefile
+makefile statdesktop.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/group/statdesktop.mk	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+# which accompanies this distribution, and is available
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# Typically C:\apps\MSVC6\VC98\Bin
+COMPILER=nmake
+
+# Called with
+#
+# $(PLATFORM) = TOOLS
+# $(CFG)      = DEB, REL
+
+BLD	:  
+	@echo BLD called with $(PLATFORM)$(CFG)
+	
+# release version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-mkdir "$(EPOCROOT)epoc32\tools\STAT"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (Desktop)
+	"$(COMPILER)" /A /NOLOGO /f "STATDesktop.mak" CFG="STATDesktop - Win32 Release"
+	
+	echo ** STAT Desktop (RELEASE) compiled successfully
+
+!endif
+
+# debug version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (Desktop)
+	"$(COMPILER)" /A /NOLOGO /f "STATDesktop.mak" CFG="STATDesktop - Win32 Debug"
+	
+	echo ** STAT Desktop (DEBUG) compiled successfully
+
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-rmdir "..\Release" /q /s
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+	-rmdir "..\Debug" /q /s
+!endif
+
+RELEASABLES :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	@echo $(EPOCROOT)epoc32\tools\STAT\STATDesktop.exe
+!endif
+
+SAVESPACE : BLD
+
+MAKMAKE LIB CLEANLIB RESOURCE FREEZE FINAL : 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/logmessage.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if ! defined (LOGMESSAGE_H_F2E497DD_F98B_43c1_826E_AF7D49D40161)
+#define LOGMESSAGE_H_F2E497DD_F98B_43c1_826E_AF7D49D40161
+
+/////////////////////////////////////////////////////////////////////////////
+// LogMessage
+// Passed from the logging object to a window through the use of a window
+// message.  This will be the lParam data object.  The message will be 
+// passed asynchronously and the structure will be allocated on the heap
+// by the sender (probably the log file object).  The receiving window must
+// delete this object when it processes the message.
+/////////////////////////////////////////////////////////////////////////////
+
+class LogMessage
+{
+public:
+	LogMessage( void );
+	~LogMessage();
+
+public:
+
+	const LogMessage& operator = ( const LogMessage& logMessage );
+
+	bool iMessageBox;
+	bool iScreenShot;
+
+	CString iMessage;
+	CString iText;
+};
+
+inline LogMessage::LogMessage( void ) :
+	iMessageBox( false ),
+	iScreenShot( false )
+{
+	;
+}
+
+inline LogMessage::~LogMessage()
+{
+	iMessage.Empty( );
+	iText.Empty( );
+}
+
+inline const LogMessage& LogMessage::operator = ( const LogMessage& logMessage )
+{
+	iMessage =	logMessage.iMessage.operator LPCTSTR( );
+	iText =	logMessage.iText.operator LPCTSTR( );
+
+	iMessageBox =	logMessage.iMessageBox;
+	iScreenShot =	logMessage.iScreenShot;
+
+	return (*this);
+}
+
+#endif // ! defined (LOGMESSAGE_H_F2E497DD_F98B_43c1_826E_AF7D49D40161)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/messagereporterimp.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if ! defined (MESSAGEREPORTER_H_118AA138_CDA6_46e1_9805_F9367915D3F7)
+#define MESSAGEREPORTER_H_118AA138_CDA6_46e1_9805_F9367915D3F7
+
+#pragma warning ( disable : 4100 4245 )
+
+#include <Statexp.h>
+#include "LogMessage.h"
+#include "WindowMessages.h"
+#include <list>
+
+/////////////////////////////////////////////////////////////////////////////
+// MessageReporterImp
+// Concrete implementation of the class MessageReporter.
+// This class knows about the dialog window and uses Windows messages
+// to call the dialog call-back update methods.
+// Even though this class knows of the dialog class it is not wise to
+// call methods in the MFC Window class directly as we may (probably are)
+// in a different thread and calling MFC methods across treads is a bad
+// thing to do.
+/////////////////////////////////////////////////////////////////////////////
+
+class MessageReporterImp : public MessageReporter
+{
+public:
+	MessageReporterImp(HWND hWnd);
+	~MessageReporterImp();
+
+protected:
+	HWND m_hWnd;
+
+	std::list<LogMessage*>	logMessages;
+
+public:
+	virtual void OnMessage( const char* message, const char* newtext,
+										bool bMsgBox, bool bScrshot );
+};
+
+// These will not be implemented in-line as we are using virtual
+// meothds but putting them here saves the use of a seperate
+// source file.
+
+inline MessageReporterImp::MessageReporterImp( HWND hWnd )
+	: m_hWnd(hWnd)
+{
+	;
+}
+
+inline MessageReporterImp::~MessageReporterImp()
+{
+	std::list<LogMessage*>::iterator	it;
+	LogMessage	*logMessage =	NULL;
+	for( it = logMessages.begin(); it != logMessages.end(); it++ )
+	{
+		logMessage = *it;
+		logMessage->iMessage.Empty();
+		logMessage->iText.Empty();
+		delete logMessage;
+	}
+	logMessages.clear();
+}
+
+inline void MessageReporterImp::OnMessage( const char* message, const char* text,
+										bool bMsgBox, bool bScrshot )
+{
+	LogMessage *logMessage = new LogMessage;
+
+	logMessage->iMessageBox = bMsgBox;
+	logMessage->iScreenShot = bScrshot;
+	logMessage->iMessage = message;
+	logMessage->iText = text;
+
+	::PostMessage(	m_hWnd,
+					WM_SHOW_LOG_MESSAGE,
+					0,
+					reinterpret_cast<LPARAM>(logMessage)
+					);
+
+	logMessages.push_back(logMessage);
+}
+
+#pragma warning ( default : 4100 4245 )
+
+#endif // ! defined (MESSAGEREPORTER_H_118AA138_CDA6_46e1_9805_F9367915D3F7)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/resource.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by M:\D\P4work\DP\development\project\2008\preq2582\sf\ana\testexec\testtoolsconn\stat\Desktop\source\desktop\src\STATDesktop.rc
+//
+#define IDM_ABOUTBOX                    0x0010
+#define IDD_ABOUTBOX                    100
+#define IDS_ABOUTBOX                    101
+#define IDD_STATDESKTOP_DIALOG          102
+#define IDS_USBPORTPROMPT               102
+#define IDS_PORTPROMPT                  102
+#define IDS_SYMBIAN                     103
+#define IDS_APPNAME                     104
+#define IDR_MAINFRAME                   128
+#define IDR_SYMBIANICON                 128
+#define IDD_SOURCESELECT                130
+#define IDD_MANAGECONNECTION            132
+#define IDC_SCRIPT                      1001
+#define IDC_BROWSE                      1002
+#define IDC_OUTPUT                      1003
+#define IDC_SCONNECT                    1004
+#define IDC_TCPIP                       1005
+#define IDC_CONNECTBORDER               1006
+#define IDC_ARM                         1007
+#define IDC_WINS                        1008
+#define IDC_THUMB                       1009
+#define IDC_PLATBORDER                  1010
+#define IDC_SPEEDBORDER                 1014
+#define IDEXIT                          1016
+#define IDRUN                           1017
+#define IDEDITSCRIPT                    1018
+#define IDC_IMAGEBOX                    1019
+#define IDC_SCREENSHOT                  1020
+#define IDC_IMAGEVERIFY                 1021
+#define IDC_IMAGEVERIFYBORDER           1022
+#define IDSTOP                          1023
+#define IDC_COPYRIGHT                   1024
+#define IDC_SPEEDSLIDER                 1025
+#define IDC_MAXSPEEDTXT                 1026
+#define IDC_MINSPEEDTXT                 1027
+#define IDC_LOCATIONEDITBOX             1027
+#define IDC_RANGEOFERROR                1028
+#define IDC_LOCATIONBROWSEBUTTON        1029
+#define IDC_RADIOLEV1                   1033
+#define IDC_RADIOLEV2                   1034
+#define IDC_RADIOLEV3                   1035
+#define IDC_EDITLOGNAME                 1036
+#define IDC_WINSCW                      1037
+#define IDC_STATICLOGLEVEL              1038
+#define IDC_STATICLOGNAME               1039
+#define IDC_DIFFLOGNAME                 1040
+#define IDC_TIMEDELAY                   1041
+#define IDC_RADIO1                      1044
+#define IDC_HEADER                      1045
+#define IDC_INFO                        1046
+#define IDC_ABOUTHEADING                1047
+#define IDC_CONNECTION                  1048
+#define IDC_PLATFORM                    1049
+#define IDC_LOCATION                    1050
+#define IDC_BROWSEIMAGE                 1051
+#define IDC_PERCENTAGE                  1052
+#define IDC_ADDRESS                     1053
+#define IDC_APPEND                      1054
+#define IDC_BROWSELOG                   1055
+#define IDC_PERCENTAGEDIFF              1059
+#define IDC_PROGRESS                    1060
+#define IDC_VIEW                        1061
+#define IDC_MANAGE                      1062
+#define IDC_REMOVE                      1063
+#define IDC_ADD                         1065
+#define IDC_LISTCONNECTIONS             1066
+#define IDC_TRANSPORT                   1067
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        134
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1071
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/scriptprogressmonitorimp.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if ! defined (SCRIPTPROGRESSMONITORIMP_H_045CF869_6A0F_4447_B5CF_393C4C419BDE)
+#define SCRIPTPROGRESSMONITORIMP_H_045CF869_6A0F_4447_B5CF_393C4C419BDE
+
+#include <Statexp.h>
+
+/////////////////////////////////////////////////////////////////////////////
+// ScriptProgressMonitorImp
+// Concrete implementation of the class ScriptProgressMonitor.
+// This class knows about the dialog window and uses Windows messages
+// to call the dialog call-back update methods.
+// Even though this class knows of the dialog class it is not wise to
+// call methods in the MFC Window class directly as we may (probably are)
+// in a different thread and calling MFC methods across treads is a bad
+// thing to do.
+/////////////////////////////////////////////////////////////////////////////
+
+class ScriptProgressMonitorImp : public ScriptProgressMonitor
+{
+public:
+	ScriptProgressMonitorImp(HWND hWnd);
+	~ScriptProgressMonitorImp();
+
+protected:
+	HWND m_hWnd;
+
+public:
+	// Override in a derived class to call-back when a single
+	// command of the current script is processed.
+	virtual void OnCompleteCommand( int command );
+
+	// Override in a derived class to call-back when the
+	// whole of current script is processed.
+	virtual void OnCompleteScript( int scriptExitCode );
+};
+
+// These will not be implemented in-line as we are using virtual
+// meothds but putting them here saves the use of a seperate
+// source file.
+
+inline ScriptProgressMonitorImp::ScriptProgressMonitorImp( HWND hWnd )
+	: m_hWnd(hWnd)
+{
+	;
+}
+
+inline ScriptProgressMonitorImp::~ScriptProgressMonitorImp()
+{
+	;
+}
+
+inline void ScriptProgressMonitorImp::OnCompleteCommand( int command )
+{
+	::PostMessage( m_hWnd, WM_DONE_COMMAND, command, 0 );
+}
+
+inline void ScriptProgressMonitorImp::OnCompleteScript( int scriptExitCode )
+{
+	::PostMessage( m_hWnd, WM_DONE_SCRIPT, scriptExitCode, 0 );
+}
+
+#endif // ! defined (SCRIPTPROGRESSMONITORIMP_H_045CF869_6A0F_4447_B5CF_393C4C419BDE)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/statdesktop.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if !defined(AFX_STATDESKTOP_H__3BAC3E07_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_)
+#define AFX_STATDESKTOP_H__3BAC3E07_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+	#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h"			// main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CSTATDesktopApp:
+// See STATDesktop.cpp for the implementation of this class
+//
+
+class CSTATDesktopApp : public CWinApp
+{
+public:
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CSTATDesktopApp)
+	public:
+	virtual BOOL InitInstance();
+	//}}AFX_VIRTUAL
+
+// Implementation
+
+	//{{AFX_MSG(CSTATDesktopApp)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STATDESKTOP_H__3BAC3E07_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/statdesktopdlg.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if !defined(AFX_STATDESKTOPDLG_H__3BAC3E09_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_)
+#define AFX_STATDESKTOPDLG_H__3BAC3E09_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <STATExp.h>
+
+#include "ini.h"
+
+#include "MessageReporterImp.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CSTATDesktopDlg dialog
+
+class CSTATDesktopDlg : public CDialog
+{
+// Construction
+public:
+	CSTATDesktopDlg(CWnd* pParent = NULL);	// standard constructor
+
+// Dialog Data
+	//{{AFX_DATA(CSTATDesktopDlg)
+	enum { IDD = IDD_STATDESKTOP_DIALOG };
+	CEdit	m_Connection;
+	CButton	m_ViewLog;
+	CProgressCtrl	m_Progress;
+	CButton	m_BrowseLog;
+	CButton	m_Append;
+	CButton	m_BrowseImage;
+	CEdit	m_Delay;
+	CListBox	m_Output;
+	CButton	m_VerifyImage;
+	CEdit	m_LogFileName;
+	CButton	m_LogToFile;
+	CEdit	m_ImageBox;
+	CEdit	m_Script;
+	CEdit	m_ImageLocation;
+	CSliderCtrl	m_SliderPos;
+	CSliderCtrl	m_PercentageDiff;
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CSTATDesktopDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	HICON m_hIcon;
+
+	// Generated message map functions
+	//{{AFX_MSG(CSTATDesktopDlg)
+	virtual BOOL OnInitDialog();
+	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
+	afx_msg void OnPaint();
+	afx_msg HCURSOR OnQueryDragIcon();
+	afx_msg void OnBrowse();
+	afx_msg void OnEditscript();
+	afx_msg void OnExit();
+	afx_msg void OnRun();
+	afx_msg void OnLogToFile();
+	afx_msg void OnReleasedcaptureSpeedslider(NMHDR* pNMHDR, LRESULT* pResult);
+	afx_msg void OnChangeTimedelay();
+	afx_msg void OnBrowseimage();
+	virtual void OnCancel();
+	afx_msg void OnImageverify();
+	afx_msg void OnBrowseLog();
+	afx_msg void OnView();
+	afx_msg void OnManage();
+	afx_msg void OnDestroy();
+	afx_msg LRESULT OnDoneCommand(WPARAM command, LPARAM );
+	afx_msg LRESULT OnDoneScript(WPARAM iScriptExitCode, LPARAM );
+	afx_msg LRESULT OnLogMesage(WPARAM, LPARAM pLogMessage );
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	void ReadSettings();
+	void SaveSettings();
+	bool CallProcess(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory);
+	int SetImageVerification();
+	void Message(const char* message);
+	void MessageFormat(const char *message, ...);
+	void EnableFields(bool bEnable);
+	int ConnectToEngine();
+	bool ShowScreenshot(const CString& filename);				//displays last screenshot in window
+	void CleanUp(const CString& message, bool bEnableFields = true);
+	void CleanUp(LPCTSTR message, bool bEnableFields = true);
+	void OpenFile(LPTSTR file);
+	void RunIt();
+
+	//variables
+	HMODULE	ihLib;
+	int iHandle;
+	PROC_VERSION	iptrVersion;
+	PROC_GETERROR	iptrGetError;
+	PROC_GETERRORTEXT	iptrGetErrorText;
+	PROC_SETCONNECTIONLOGGING	iptrSetConnectionLogging;
+	PROC_CLOSECONNECTIONLOGGING	iptrCloseConnectionLogging;
+	PROC_CONNECT	iptrConnect;
+	PROC_DISCONNECT	iptrDisconnect;
+	PROC_SETCOMMANDDELAY	iptrSetCommandDelay;
+	PROC_SETCOMMANDLOGGING	iptrSetCommandLogging;
+	PROC_SETIMAGEVERIFICATION	iptrSetImageVerification;
+	PROC_OPENSCRIPTFILE	iptrOpenScriptFile;
+	PROC_RUNSCRIPT	iptrRunScript;
+	PROC_SENDRAWCOMMAND	iptrSendRawCommand;
+	PROC_SENDCOMMANDFILE	iptrSendCommandFile;
+	PROC_GETCOMMANDCOUNT	iptrGetCommandCount;
+	PROC_GETCURRENTCOMMANDNUMBER	iptrGetCurrentCommandNumber;
+	PROC_STOPPROCESSING	iptrStopProcessing;
+	PROC_GETSNAPSHOT	iptrGetSnapShot;
+
+	MessageReporterImp	*iMessageReporter;
+
+	CStatIniFile statIniFile;
+	TCHAR szBuffer[2048];		// global buffer for strings
+	HANDLE hThreadHandle;
+	int iLastVerify;			// stores the state of verify checkbox
+	int iLastLog;				// stores the state of log checkbox
+	bool bRunning;				// flag whether processing or not
+
+	/****BITMAP STUFF****/
+	CPalette m_Palette;
+	unsigned char *m_pDib, *m_pDibBits;
+	DWORD m_dwDibSize;
+	BITMAPINFOHEADER *m_pBIH;
+	RGBQUAD *m_pPalette;
+	int m_nPaletteEntries;
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STATDESKTOPDLG_H__3BAC3E09_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/statmanageconnection.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#if !defined(AFX_STATMANAGECONNECTION_H__49661E91_DF72_11D6_BC83_00B0D065107F__INCLUDED_)
+#define AFX_STATMANAGECONNECTION_H__49661E91_DF72_11D6_BC83_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// STATManageConnection.h : header file
+//
+
+#include <STATExp.h>
+
+#include "ini.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// STATManageConnection dialog
+
+class STATManageConnection : public CDialog
+{
+// Construction
+public:
+	STATManageConnection(CWnd* pParent = NULL);   // standard constructor
+
+// Dialog Data
+	//{{AFX_DATA(STATManageConnection)
+	enum { IDD = IDD_MANAGECONNECTION };
+	CEdit	m_Address;
+	CComboBox	m_Transport;
+	CListBox	m_ListConnections;
+	//}}AFX_DATA
+
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(STATManageConnection)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+	// Generated message map functions
+	//{{AFX_MSG(STATManageConnection)
+	afx_msg void OnRemove();
+	virtual BOOL OnInitDialog();
+	virtual void OnOK();
+	afx_msg void OnAdd();
+	virtual void OnCancel();
+	afx_msg void OnSelchangeListconnections();
+	afx_msg void OnSelchangeTransport();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	bool InList(CString & Entry);
+	static LPTSTR ToUnicode(const char *string);					// convert ANSI to Unicode
+	static char * ToAnsi(LPCTSTR string);							// convert Unicode to ANSI
+
+	CStatIniFile statIniFile;
+	long lCount;
+};
+
+extern CString cConnectionInfo;
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STATMANAGECONNECTION_H__49661E91_DF72_11D6_BC83_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if !defined(AFX_STDAFX_H__3BAC3E0B_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_)
+#define AFX_STDAFX_H__3BAC3E0B_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
+#include <assert.h>
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>			// MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__3BAC3E0B_6B00_11D5_B4C5_00C04F437BB4__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/inc/windowmessages.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if ! defined (WINDOW_MESSAGES_H_0731AB35_7D26_459d_9A0E_1AFB32883064)
+#define WINDOW_MESSAGES_H_0731AB35_7D26_459d_9A0E_1AFB32883064
+
+/////////////////////////////////////////////////////////////////////////////
+// WM_DONE_COMMAND
+// Passed from the script progress monitor to the main UI window (this is
+// the desktop dialog) to indicate that a single command of the current
+// scipt has been processed.
+/////////////////////////////////////////////////////////////////////////////
+#define WM_DONE_COMMAND	(WM_USER + 0x0001)
+
+/////////////////////////////////////////////////////////////////////////////
+// WM_DONE_SCRIPT
+// Passed from the script progress monitor to the main UI window (this is
+// the desktop dialog) to indicate that the current  script has 
+// been processed.
+/////////////////////////////////////////////////////////////////////////////
+#define WM_DONE_SCRIPT	(WM_USER + 0x0002)
+
+/////////////////////////////////////////////////////////////////////////////
+// WM_SHOW_LOG_MESSAGE
+// Passed from the log file to the application main window.
+// There is a data structure passed in this message (as the lParam) and 
+// the receiving window must delete it.
+/////////////////////////////////////////////////////////////////////////////
+#define WM_SHOW_LOG_MESSAGE	(WM_USER + 0x0003)
+
+#endif // ! defined (WINDOW_MESSAGES_H_0731AB35_7D26_459d_9A0E_1AFB32883064)
Binary file testtoolsconn/stat/desktop/source/desktop/res/statdesktop.ico has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/res/statdesktop.rc2	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,13 @@
+//
+// STATDESKTOP.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+	#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/src/statdesktop.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+#include "STATDesktop.h"
+#include "STATDesktopDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CSTATDesktopApp
+
+BEGIN_MESSAGE_MAP(CSTATDesktopApp, CWinApp)
+	//{{AFX_MSG_MAP(CSTATDesktopApp)
+	//}}AFX_MSG
+	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CSTATDesktopApp object
+
+CSTATDesktopApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CSTATDesktopApp initialization
+
+BOOL CSTATDesktopApp::InitInstance()
+{
+	CSTATDesktopDlg dlg;
+	dlg.DoModal();
+	return FALSE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/src/statdesktop.rc	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,374 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "../inc/resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 257, 74
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About STAT Desktop"
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "Copyright (C) 2005-2009 Nokia Corporation",
+                    IDC_COPYRIGHT,86,19,155,8
+    DEFPUSHBUTTON   "OK",IDOK,103,53,50,14,WS_GROUP
+    ICON            IDR_SYMBIANICON,IDC_STATIC,19,7,20,20
+    EDITTEXT        IDC_ABOUTHEADING,85,7,111,12,ES_AUTOHSCROLL | 
+                    ES_READONLY | NOT WS_BORDER
+END
+
+IDD_STATDESKTOP_DIALOG DIALOGEX 0, 0, 402, 327
+STYLE DS_MODALFRAME | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | 
+    WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW
+CAPTION "Nokia Test Automation Tool"
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+    EDITTEXT        IDC_SCRIPT,14,18,236,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "&Edit...",IDEDITSCRIPT,258,18,61,14
+    PUSHBUTTON      "&Browse...",IDC_BROWSE,329,18,56,14
+    CONTROL         "Slider1",IDC_SPEEDSLIDER,"msctls_trackbar32",TBS_VERT | 
+                    TBS_BOTH | TBS_ENABLESELRANGE | WS_TABSTOP,24,104,26,63
+    EDITTEXT        IDC_TIMEDELAY,54,129,40,14,ES_AUTOHSCROLL | NOT 
+                    WS_TABSTOP,WS_EX_DLGMODALFRAME
+    CONTROL         "",IDC_IMAGEVERIFY,"Button",BS_AUTOCHECKBOX | WS_GROUP | 
+                    WS_TABSTOP,14,191,12,8
+    CONTROL         "Slider2",IDC_PERCENTAGEDIFF,"msctls_trackbar32",
+                    TBS_BOTH | TBS_NOTICKS | TBS_ENABLESELRANGE,50,187,71,22
+    PUSHBUTTON      "Brow&se...",IDC_BROWSEIMAGE,186,189,56,14
+    EDITTEXT        IDC_LOCATION,54,209,188,14,ES_AUTOHSCROLL
+    CONTROL         "",IDC_DIFFLOGNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    14,246,11,13
+    CONTROL         "Append",IDC_APPEND,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,54,246,41,13
+    PUSHBUTTON      "&View...",IDC_VIEW,120,246,58,14
+    PUSHBUTTON      "Br&owse...",IDC_BROWSELOG,186,246,56,14
+    EDITTEXT        IDC_EDITLOGNAME,54,265,188,14,ES_AUTOHSCROLL | 
+                    WS_DISABLED
+    DEFPUSHBUTTON   "&Run",IDRUN,258,297,61,14
+    PUSHBUTTON      "&Close",IDEXIT,329,297,56,14
+    GROUPBOX        "Log To File",IDC_STATIC,7,233,243,55
+    GROUPBOX        "",IDC_IMAGEVERIFYBORDER,7,176,243,54,WS_GROUP
+    GROUPBOX        "Speed",IDC_SPEEDBORDER,7,98,135,73,WS_GROUP
+    EDITTEXT        IDC_IMAGEBOX,258,218,127,69,NOT WS_TABSTOP,
+                    WS_EX_DLGMODALFRAME
+    GROUPBOX        "Image Verification",IDC_STATIC,7,176,388,144
+    GROUPBOX        "Script",IDC_STATIC,7,5,388,315
+    LISTBOX         IDC_OUTPUT,150,38,235,133,LBS_NOINTEGRALHEIGHT | 
+                    LBS_DISABLENOSCROLL | LBS_NOSEL | WS_VSCROLL | 
+                    WS_HSCROLL
+    LTEXT           "Fast (100ms)",IDC_MAXSPEEDTXT,54,113,50,10
+    LTEXT           "Slow (30000ms)",IDC_MINSPEEDTXT,54,152,54,10
+    LTEXT           "Location:",IDC_STATIC,14,209,29,8
+    LTEXT           "% Error:",IDC_STATIC,142,191,25,8
+    LTEXT           "File Name:",IDC_STATIC,14,265,36,8
+    LTEXT           "0",IDC_STATIC,42,191,8,8
+    LTEXT           "100",IDC_STATIC,120,191,13,8
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,
+                    14,297,236,14
+    CTEXT           "Last Captured Screenshot",IDC_STATIC,274,195,90,8,
+                    SS_CENTERIMAGE
+    GROUPBOX        "",IDC_STATIC,258,187,127,23
+    PUSHBUTTON      "Select",IDC_MANAGE,50,72,50,14
+    GROUPBOX        "Connection",IDC_STATIC,7,35,135,57
+    EDITTEXT        IDC_CONNECTION,14,49,122,14,ES_AUTOHSCROLL | ES_READONLY
+END
+
+IDD_SOURCESELECT DIALOG DISCARDABLE  0, 0, 230, 111
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Image Verification - Source Select"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,168,64,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,168,87,50,14
+    EDITTEXT        IDC_LOCATIONEDITBOX,11,27,150,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_RANGEOFERROR,12,81,50,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "Browse...",IDC_LOCATIONBROWSEBUTTON,168,27,50,14
+    GROUPBOX        "Permitted Range Of Error (%)",IDC_STATIC,7,61,132,43
+    GROUPBOX        "Location Of Reference Images",IDC_STATIC,7,7,216,50
+END
+
+IDD_MANAGECONNECTION DIALOG DISCARDABLE  0, 0, 264, 135
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Manage Device Connections"
+FONT 8, "MS Sans Serif"
+BEGIN
+    COMBOBOX        IDC_TRANSPORT,15,16,84,86,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    EDITTEXT        IDC_ADDRESS,105,16,85,14,ES_UPPERCASE | ES_AUTOHSCROLL
+    PUSHBUTTON      "Add",IDC_ADD,198,16,50,14
+    LISTBOX         IDC_LISTCONNECTIONS,15,54,233,44,LBS_SORT | 
+                    LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Remove",IDC_REMOVE,15,107,50,14
+    PUSHBUTTON      "Select",IDOK,106,107,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,198,107,50,14
+    GROUPBOX        "",IDC_STATIC,7,39,250,89
+    GROUPBOX        "",IDC_STATIC,7,3,250,35
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,1,0,0
+ PRODUCTVERSION 1,1,0,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "080904b0"
+        BEGIN
+            VALUE "Comments", "Nokia Test Automation Tool\0"
+            VALUE "CompanyName", "Nokia Limited\0"
+            VALUE "FileDescription", "STAT Desktop Version\0"
+            VALUE "FileVersion", "5.0\0"
+            VALUE "InternalName", "STATDesktop\0"
+            VALUE "LegalCopyright", "Copyright (C) 2005-2009 Nokia Corporation\0"
+            VALUE "LegalTrademarks", "STAT\0"
+            VALUE "OriginalFilename", "STATDesktop.exe\0"
+            VALUE "PrivateBuild", "\0"
+            VALUE "ProductName", "Nokia Test Automation Tool Desktop Version\0"
+            VALUE "ProductVersion", "5.0\0"
+            VALUE "SpecialBuild", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x809, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_ABOUTBOX, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 250
+        TOPMARGIN, 7
+        HORZGUIDE, 7
+        HORZGUIDE, 39
+    END
+
+    IDD_STATDESKTOP_DIALOG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 395
+        VERTGUIDE, 14
+        VERTGUIDE, 24
+        VERTGUIDE, 37
+        VERTGUIDE, 50
+        VERTGUIDE, 54
+        VERTGUIDE, 120
+        VERTGUIDE, 136
+        VERTGUIDE, 142
+        VERTGUIDE, 178
+        VERTGUIDE, 186
+        VERTGUIDE, 209
+        VERTGUIDE, 242
+        VERTGUIDE, 250
+        VERTGUIDE, 258
+        VERTGUIDE, 319
+        VERTGUIDE, 329
+        VERTGUIDE, 356
+        VERTGUIDE, 385
+        TOPMARGIN, 5
+        BOTTOMMARGIN, 320
+        HORZGUIDE, 18
+        HORZGUIDE, 20
+        HORZGUIDE, 35
+        HORZGUIDE, 38
+        HORZGUIDE, 49
+        HORZGUIDE, 92
+        HORZGUIDE, 98
+        HORZGUIDE, 104
+        HORZGUIDE, 113
+        HORZGUIDE, 143
+        HORZGUIDE, 162
+        HORZGUIDE, 167
+        HORZGUIDE, 171
+        HORZGUIDE, 176
+        HORZGUIDE, 180
+        HORZGUIDE, 187
+        HORZGUIDE, 191
+        HORZGUIDE, 195
+        HORZGUIDE, 209
+        HORZGUIDE, 230
+        HORZGUIDE, 233
+        HORZGUIDE, 246
+        HORZGUIDE, 260
+        HORZGUIDE, 265
+        HORZGUIDE, 297
+    END
+
+    IDD_SOURCESELECT, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 223
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 104
+    END
+
+    IDD_MANAGECONNECTION, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 257
+        VERTGUIDE, 15
+        VERTGUIDE, 248
+        TOPMARGIN, 3
+        BOTTOMMARGIN, 128
+        HORZGUIDE, 16
+        HORZGUIDE, 121
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_MANAGECONNECTION DLGINIT
+BEGIN
+    IDC_TRANSPORT, 0x403, 14, 0
+0x7953, 0x626d, 0x6169, 0x536e, 0x636f, 0x656b, 0x0074, 
+    IDC_TRANSPORT, 0x403, 14, 0
+0x7953, 0x626d, 0x6169, 0x536e, 0x7265, 0x6169, 0x006c, 
+    IDC_TRANSPORT, 0x403, 16, 0
+0x7953, 0x626d, 0x6169, 0x496e, 0x666e, 0x6172, 0x6572, 0x0064, 
+    IDC_TRANSPORT, 0x403, 17, 0
+0x7953, 0x626d, 0x6169, 0x426e, 0x756c, 0x7465, 0x6f6f, 0x6874, "\000" 
+    0
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "..\\inc\\resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif //_WIN32\r\n"
+    "#include ""res\\STATDesktop.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_SYMBIANICON         ICON    DISCARDABLE     "..\\res\\STATDesktop.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_ABOUTBOX            "&About STATDesktop..."
+    IDS_PORTPROMPT          "%s %s uses virtual serial port for this connection.\n\nPlease enter the port number in the address field."
+    IDS_SYMBIAN             "Nokia"
+    IDS_APPNAME             "Desktop STAT"
+END
+
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "res/STATDesktop.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/src/statdesktopdlg.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1374 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+#include "STATDesktop.h"
+#include "STATDesktopDlg.h"
+#include "STATManageConnection.h"
+#include "ScriptProgressMonitorImp.h"
+
+#include <afxdlgs.h>	//required for CFileDialog
+
+#include <process.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+//////////////////////////////////////////////////////////////////////////
+// our thread-safe mechanism
+CRITICAL_SECTION CriticalSection;
+
+//////////////////////////////////////////////////////////////////////////
+
+typedef struct _THREADPROC_DATA
+{
+	HWND windowHandle;
+	int handle;
+	PROC_RUNSCRIPT ptrRunScript;
+}
+	THREADPROC_DATA;
+
+////////////////////////////////////////////////
+// thread entry point
+
+UINT WINAPI ThreadProc(LPVOID lpParameter)
+{
+	THREADPROC_DATA *data = reinterpret_cast<THREADPROC_DATA*>(lpParameter);
+
+	HWND windowHandle = data->windowHandle;
+	int handle = data->handle;
+	PROC_RUNSCRIPT iptrRunScript = data->ptrRunScript;
+
+	delete data;
+	data = NULL;
+
+	int	err =	GENERAL_FAILURE;
+
+	{
+		// Place this code in scope braces such that the
+		// object is cleaned up before the end of the 
+		// function.  The endthread methods will not call
+		// destructors.
+		ScriptProgressMonitorImp scriptMonitor( windowHandle );
+
+		// We do not use the error but it is useful to get it for debugging
+		// purposes.
+		err =	(iptrRunScript)(handle, &scriptMonitor);
+	}
+
+	::_endthreadex(0);	// Use _endthreadex so as not to close thread handle.
+
+	// Never get here.
+
+	return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+	CAboutDlg(const char* aVersion);
+
+// Dialog Data
+	//{{AFX_DATA(CAboutDlg)
+	enum { IDD = IDD_ABOUTBOX };
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CAboutDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	//{{AFX_MSG(CAboutDlg)
+	virtual BOOL OnInitDialog();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	CString iVersion;
+
+
+};
+
+CAboutDlg::CAboutDlg(const char* aVersion) : CDialog(CAboutDlg::IDD)
+{
+	iVersion = CString(aVersion);
+
+
+	//{{AFX_DATA_INIT(CAboutDlg)
+	//}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CAboutDlg)
+	//}}AFX_DATA_MAP
+}
+
+CAboutDlg::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	// set About Box details
+	TCHAR tHeading[25];
+	_stprintf(tHeading, _T("STAT Version: %s"), iVersion);
+
+	GetDlgItem(IDC_ABOUTHEADING)->SetWindowText(tHeading);
+
+	return TRUE;
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+	//{{AFX_MSG_MAP(CAboutDlg)
+		// No message handlers
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CSTATDesktopDlg dialog
+
+CSTATDesktopDlg::CSTATDesktopDlg(CWnd* pParent /*=NULL*/)
+: CDialog(CSTATDesktopDlg::IDD, pParent),
+	ihLib(NULL), iHandle(0), hThreadHandle((HANDLE)0), bRunning(false),
+	iptrVersion(NULL), iptrGetError(NULL), iptrGetErrorText(NULL), iptrSetConnectionLogging(NULL),
+	iptrCloseConnectionLogging(NULL), iptrConnect(NULL), iptrDisconnect(NULL),
+	iptrSetCommandDelay(NULL), iptrSetCommandLogging(NULL),
+	iptrSetImageVerification(NULL), iptrSendRawCommand(NULL),
+	iptrOpenScriptFile(NULL), iptrRunScript(NULL),
+	iptrSendCommandFile(NULL), iptrGetCommandCount(NULL), iptrGetCurrentCommandNumber(NULL),
+	iptrStopProcessing(NULL),
+	iptrGetSnapShot(NULL), iMessageReporter(NULL)
+{
+	//{{AFX_DATA_INIT(CSTATDesktopDlg)
+	//}}AFX_DATA_INIT
+	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+}
+
+//----------------------------------------------------------------------------
+
+void CSTATDesktopDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CSTATDesktopDlg)
+	DDX_Control(pDX, IDC_CONNECTION, m_Connection);
+	DDX_Control(pDX, IDC_VIEW, m_ViewLog);
+	DDX_Control(pDX, IDC_PROGRESS, m_Progress);
+	DDX_Control(pDX, IDC_BROWSELOG, m_BrowseLog);
+	DDX_Control(pDX, IDC_APPEND, m_Append);
+	DDX_Control(pDX, IDC_BROWSEIMAGE, m_BrowseImage);
+	DDX_Control(pDX, IDC_TIMEDELAY, m_Delay);
+	DDX_Control(pDX, IDC_OUTPUT, m_Output);
+	DDX_Control(pDX, IDC_IMAGEVERIFY, m_VerifyImage);
+	DDX_Control(pDX, IDC_EDITLOGNAME, m_LogFileName);
+	DDX_Control(pDX, IDC_DIFFLOGNAME, m_LogToFile);
+	DDX_Control(pDX, IDC_IMAGEBOX, m_ImageBox);
+	DDX_Control(pDX, IDC_SCRIPT, m_Script);
+	DDX_Control(pDX, IDC_LOCATION, m_ImageLocation);
+	DDX_Control(pDX, IDC_SPEEDSLIDER, m_SliderPos);
+	DDX_Control(pDX, IDC_PERCENTAGEDIFF, m_PercentageDiff);
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CSTATDesktopDlg, CDialog)
+	//{{AFX_MSG_MAP(CSTATDesktopDlg)
+	ON_WM_SYSCOMMAND()
+	ON_WM_PAINT()
+	ON_WM_QUERYDRAGICON()
+	ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
+	ON_BN_CLICKED(IDEDITSCRIPT, OnEditscript)
+	ON_BN_CLICKED(IDEXIT, OnExit)
+	ON_BN_CLICKED(IDRUN, OnRun)
+	ON_BN_CLICKED(IDC_DIFFLOGNAME, OnLogToFile)
+	ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SPEEDSLIDER, OnReleasedcaptureSpeedslider)
+	ON_EN_CHANGE(IDC_TIMEDELAY, OnChangeTimedelay)
+	ON_BN_CLICKED(IDC_BROWSEIMAGE, OnBrowseimage)
+	ON_BN_CLICKED(IDC_IMAGEVERIFY, OnImageverify)
+	ON_BN_CLICKED(IDC_BROWSELOG, OnBrowseLog)
+	ON_BN_CLICKED(IDC_VIEW, OnView)
+	ON_BN_CLICKED(IDC_MANAGE, OnManage)
+	ON_WM_DESTROY()
+	ON_MESSAGE(WM_DONE_COMMAND, OnDoneCommand)
+	ON_MESSAGE(WM_DONE_SCRIPT, OnDoneScript)
+	ON_MESSAGE(WM_SHOW_LOG_MESSAGE, OnLogMesage)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CSTATDesktopDlg message handlers
+
+BOOL CSTATDesktopDlg::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	// IDM_ABOUTBOX must be in the system command range.
+	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+	ASSERT(IDM_ABOUTBOX < 0xF000);
+
+	CMenu* pSysMenu = GetSystemMenu(FALSE);
+	if (pSysMenu != NULL)
+	{
+		CString strAboutMenu;
+		strAboutMenu.LoadString(IDS_ABOUTBOX);
+		if (!strAboutMenu.IsEmpty())
+		{
+			pSysMenu->AppendMenu(MF_SEPARATOR);
+			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
+		}
+	}
+
+	SetIcon(m_hIcon, TRUE);			// Set big icon
+	SetIcon(m_hIcon, FALSE);		// Set small icon
+	
+	// Load the STAT DLL library.
+	static char	DLLPath[MAX_PATH];
+
+#ifdef _DEBUG
+	// Load the debug DLL from our current working folder.
+	sprintf( DLLPath, "statd.dll" );
+#else // _DEBUG
+	// Load the current build of STAT DLL from the default 
+	// STAT folder (probably '\epoc32\tools\STAT').
+	sprintf( DLLPath, "%s\\%s", DLLFolder, DLLName );
+#endif // _DEBUG
+
+	ihLib =	::LoadLibrary( DLLPath );
+
+	if( ihLib  == NULL )
+	{
+		::AfxMessageBox( "Failed to load dynamic library.", MB_ICONERROR );
+		PostMessage( WM_CLOSE, 0, 0 );
+	}
+	else
+	{
+		iptrVersion =	reinterpret_cast<PROC_VERSION>(::GetProcAddress( ihLib, ProcVersion ));
+		iptrGetError =	reinterpret_cast<PROC_GETERROR>(::GetProcAddress( ihLib, ProcGetError ));
+		iptrGetErrorText =	reinterpret_cast<PROC_GETERRORTEXT>(::GetProcAddress( ihLib, ProcGetErrorText ));
+		iptrSetConnectionLogging =	reinterpret_cast<PROC_SETCONNECTIONLOGGING>(::GetProcAddress( ihLib, ProcSetConnectionLogging ));
+		iptrCloseConnectionLogging =	reinterpret_cast<PROC_CLOSECONNECTIONLOGGING>(::GetProcAddress( ihLib, ProcCloseConnectionLogging ));
+		iptrConnect =	reinterpret_cast<PROC_CONNECT>(::GetProcAddress( ihLib, ProcConnect ));
+		iptrDisconnect =	reinterpret_cast<PROC_DISCONNECT>(::GetProcAddress( ihLib, ProcDisconnect ));
+		iptrSetCommandDelay =	reinterpret_cast<PROC_SETCOMMANDDELAY>(::GetProcAddress( ihLib, ProcSetCommandDelay ));
+		iptrSetCommandLogging =	reinterpret_cast<PROC_SETCOMMANDLOGGING>(::GetProcAddress( ihLib, ProcSetCommandLogging ));
+		iptrSetImageVerification =	reinterpret_cast<PROC_SETIMAGEVERIFICATION>(::GetProcAddress( ihLib, ProcSetImageVerification ));
+		iptrOpenScriptFile =	reinterpret_cast<PROC_OPENSCRIPTFILE>(::GetProcAddress( ihLib, ProcOpenScriptFile ));
+		iptrRunScript =	reinterpret_cast<PROC_RUNSCRIPT>(::GetProcAddress( ihLib, ProcRunScript ));
+		iptrSendRawCommand =	reinterpret_cast<PROC_SENDRAWCOMMAND>(::GetProcAddress( ihLib, ProcSendRawCommand ));
+		iptrSendCommandFile =	reinterpret_cast<PROC_SENDCOMMANDFILE>(::GetProcAddress( ihLib, ProcSendCommandFile ));
+		iptrGetCommandCount =	reinterpret_cast<PROC_GETCOMMANDCOUNT>(::GetProcAddress( ihLib, ProcGetCommandCount ));
+		iptrGetCurrentCommandNumber =	reinterpret_cast<PROC_GETCURRENTCOMMANDNUMBER>(::GetProcAddress( ihLib, ProcGetCurrentCommandNumber ));
+		iptrStopProcessing =	reinterpret_cast<PROC_STOPPROCESSING>(::GetProcAddress( ihLib, ProcStopProcessing ));
+		iptrGetSnapShot =	reinterpret_cast<PROC_GETSNAPSHOT>(::GetProcAddress( ihLib, ProcGetSnapShot ));
+
+		if( ( NULL == iptrVersion ) ||
+			( NULL == iptrGetError ) ||
+			( NULL == iptrGetErrorText ) ||
+			( NULL == iptrSetConnectionLogging ) ||
+			( NULL == iptrCloseConnectionLogging ) ||
+			( NULL == iptrConnect ) ||
+			( NULL == iptrDisconnect ) ||
+			( NULL == iptrSetCommandDelay ) ||
+			( NULL == iptrSetCommandLogging ) ||
+			( NULL == iptrSetImageVerification ) ||
+			( NULL == iptrOpenScriptFile ) ||
+			( NULL == iptrRunScript ) ||
+			( NULL == iptrSendRawCommand ) ||
+			( NULL == iptrSendCommandFile ) ||
+			( NULL == iptrGetCommandCount ) ||
+			( NULL == iptrGetCurrentCommandNumber ) ||
+			( NULL == iptrStopProcessing ) )
+		{
+			::AfxMessageBox( "Failed to load a function address.", MB_ICONERROR );
+			PostMessage( WM_CLOSE, 0, 0 );
+		}
+	}
+
+	iMessageReporter =	new MessageReporterImp( GetSafeHwnd() );
+
+	iLastVerify = 0;
+	iLastLog = 0;
+	statIniFile.SetIniFileName(STAT_INI_NAME);
+	// read in previous settings
+	ReadSettings();
+
+	InitializeCriticalSection(&CriticalSection);
+
+	return TRUE;  // return TRUE  unless you set the focus to a control
+}
+
+//----------------------------------------------------------------------------
+void CSTATDesktopDlg::OnSysCommand(UINT nID, LPARAM lParam)
+{
+	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
+	{
+		CAboutDlg dlgAbout(iptrVersion());
+		dlgAbout.DoModal();
+	}
+	else
+		CDialog::OnSysCommand(nID, lParam);
+}
+
+//----------------------------------------------------------------------------
+
+// If you add a minimize button to your dialog, you will need the code below
+//  to draw the icon.  For MFC applications using the document/view model,
+//  this is automatically done for you by the framework.
+
+void CSTATDesktopDlg::OnPaint() 
+{
+	if (IsIconic())
+	{
+		CPaintDC dc(this); // device context for painting
+
+		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+		// Center icon in client rectangle
+		int cxIcon = GetSystemMetrics(SM_CXICON);
+		int cyIcon = GetSystemMetrics(SM_CYICON);
+		CRect rect;
+		GetClientRect(&rect);
+		int x = (rect.Width() - cxIcon + 1) / 2;
+		int y = (rect.Height() - cyIcon + 1) / 2;
+
+		// Draw the icon
+		dc.DrawIcon(x, y, m_hIcon);
+	}
+	else
+		CDialog::OnPaint();
+}
+
+//----------------------------------------------------------------------------
+
+HCURSOR CSTATDesktopDlg::OnQueryDragIcon()
+{
+	return (HCURSOR) m_hIcon;
+}
+
+//----------------------------------------------------------------------------
+
+void CSTATDesktopDlg::OnBrowse() 
+{
+	// use the folder of the current script as a starting point
+	m_Script.GetWindowText(szBuffer, sizeof(szBuffer));
+	CString buf = szBuffer;
+	if (!buf.IsEmpty())
+	{
+		int index = buf.ReverseFind('\\');
+		if (index != -1)
+		{
+			CString folder = buf.Left(index);
+			SetCurrentDirectory(folder.GetBuffer(0));
+		}
+	}
+
+	CFileDialog dlgStatFileOpen(TRUE, 
+								NULL, 
+								NULL, 
+								OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, 
+								_T("Script Files (*.txt)|*.txt|All Files (*.*)|*.*||"));
+
+	// new script file to use
+	if (dlgStatFileOpen.DoModal() == IDOK)	//when ok is pressed
+		m_Script.SetWindowText(dlgStatFileOpen.GetPathName());
+}
+
+//----------------------------------------------------------------------------
+//Frees memory and releases COM stuff etc...
+void CSTATDesktopDlg::OnCancel() 
+{
+	OnOK();
+}
+
+void CSTATDesktopDlg::OnExit() 
+{
+	SaveSettings();
+	OnOK();
+}
+
+
+//----------------------------------------------------------------------------
+//when the Run button is pressed
+void CSTATDesktopDlg::OnRun()
+{
+	if (bRunning)
+	{
+		CWaitCursor oWait;
+
+		Message("Signalling current script to stop.  Please wait...");
+		(iptrStopProcessing)(iHandle);
+	}
+	else
+	{
+		m_Output.ResetContent();
+		Message("*** STAT LOG ***");
+		RunIt();
+	}
+}
+
+
+//----------------------------------------------------------------------------
+// main work happens here
+void CSTATDesktopDlg::RunIt()
+{
+	// We should use GetData( true ) here to update all the internal data with the
+	// text in the dialog controls instead of GetWindowText.
+
+	CWaitCursor oWait;
+	int ret = ITS_OK;
+	bRunning = true;
+
+	// make sure we have something to work with
+	(*szBuffer) = (TCHAR)0;
+	m_Script.GetWindowText(szBuffer, sizeof(szBuffer));
+	if (!(*szBuffer))
+	{
+		CleanUp(_T("One or more required fields in the dialog are empty"));
+		return;
+	}
+
+	// initialise back end
+	if((ret = ConnectToEngine()) != ITS_OK)
+	{
+		CString msg;
+		if (ret == E_NOCONNECTION)
+			msg = _T("No connection specified");
+		else
+			msg = (iptrGetError)(iHandle);
+
+		CleanUp(msg);
+		return;
+	}
+
+	// turn on logging
+	if(m_LogToFile.GetCheck())
+	{
+		m_LogFileName.GetWindowText(szBuffer, sizeof(szBuffer));
+		CString cBuffer = szBuffer;
+
+		if (!cBuffer.IsEmpty() && (_tcscmp(szBuffer, _T("<date-time>")) != 0))
+			MessageFormat("Logging to %s Append: %d...", szBuffer, m_Append.GetCheck());
+		else
+		{
+			if (cBuffer.IsEmpty())
+				m_LogFileName.SetWindowText(_T("<date-time>"));
+			else
+				cBuffer.Empty();
+
+			MessageFormat("Logging to default file, Append: %d...", m_Append.GetCheck());
+		}
+
+		ret = (iptrSetCommandLogging)(iHandle, cBuffer, iMessageReporter,
+										EVerbose, (m_Append.GetCheck() > 0), NULL, NULL );
+		if (ret != LOG_FILE_OK)
+		{
+			CleanUp(_T("Logging could not be set"));
+			return;
+		}
+	}
+	else
+	{
+		CString cBuffer;
+		ret = (iptrSetCommandLogging)(iHandle, NULL, iMessageReporter,
+										EVerbose, (m_Append.GetCheck() > 0), NULL, NULL );
+		if (ret != LOG_FILE_OK)
+		{
+			CleanUp(_T("Logging could not be set"));
+			return;
+		}
+	}
+
+	// set the script execution speed
+	GetDlgItem(IDC_TIMEDELAY)->GetWindowText(szBuffer, sizeof(szBuffer));
+	(iptrSetCommandDelay)(iHandle, _ttoi(szBuffer));
+	MessageFormat("Command delay set to %d...", _ttoi(szBuffer));
+
+	// image verification
+	if(m_VerifyImage.GetCheck() && !SetImageVerification())
+	{
+		CleanUp(_T("Image verification could not be set"));
+		return;
+	}
+
+	// get list of commands in script
+	m_Script.GetWindowText(szBuffer, sizeof(szBuffer));
+	int iCount = 0;
+	ret = (iptrGetCommandCount)(iHandle, szBuffer, &iCount);
+	if(ret != ITS_OK)	//attempt to open as commands if file cannot be opened
+	{
+		CleanUp((iptrGetErrorText)(iHandle, ret));
+		return;
+	}
+
+	// set the progress bar
+	m_Progress.SetRange(0, (short)iCount);
+	m_Progress.SetPos(0);
+
+	//open script file
+	ret = (iptrOpenScriptFile)(iHandle, szBuffer, true);
+	if(ret != ITS_OK)	//attempt to open as commands if file cannot be opened
+	{
+		ret = (iptrOpenScriptFile)(iHandle, szBuffer, false);
+	}
+	if(ret != ITS_OK)
+	{
+		CleanUp((iptrGetErrorText)(iHandle, ret));
+		return;
+	}
+
+	EnableFields(FALSE);
+	oWait.Restore();
+
+	// event attributes for the child process - used to kill the thread if required
+	SECURITY_ATTRIBUTES eventAttr;
+	eventAttr.nLength = sizeof(eventAttr);
+	eventAttr.lpSecurityDescriptor = NULL;
+	eventAttr.bInheritHandle = TRUE;
+
+	THREADPROC_DATA *data = new THREADPROC_DATA;
+	data->windowHandle = GetSafeHwnd( );
+	data->handle = iHandle;
+	data->ptrRunScript = iptrRunScript;
+
+	// Would be nice to use MFC thread methods here but we want to be specific
+	// about using _beginthreadex and _endthreadex so we can manage the
+	// thread handle ourselves.  The MFC will neatly auto-close the handle but
+	// we do not want that.
+	// CWinThread *thread = ::AfxBeginThread( ThreadProc, &data );
+	// hThreadHandle = thread;
+	UINT dwThreadID = 0;
+	hThreadHandle = reinterpret_cast<HANDLE>(::_beginthreadex( NULL, 0, ThreadProc, data, 0, &dwThreadID ));
+
+	// Give the new thread chance to start.
+	// This is of no practical value in application operation.
+	// However, it is very useful in debugging and if we add this code we know
+	// the new thread will start now.
+	::Sleep(0);
+}
+
+//----------------------------------------------------------------------------
+//  Display a message
+void CSTATDesktopDlg::MessageFormat(const char *message, ...)
+{
+	char szText[1024] = {0};
+	va_list pMsg;
+
+	va_start (pMsg, message);
+	vsprintf (szText, message, pMsg);
+	va_end (pMsg);
+
+	CString temp = szText;
+	Message(temp);
+}
+
+
+//-----------------------------------------------------------------------------
+//  Display a message and (maybe) write to log file
+void CSTATDesktopDlg::Message(const char* message)
+{
+	int nCount = 0;
+	
+	m_Output.InsertString(-1, message);	
+	nCount = m_Output.GetCount();
+	if (nCount > 0)
+		m_Output.SetTopIndex(nCount - 1);	//The list view control is scrolled if necessary
+	
+	m_Output.UpdateWindow();
+}
+
+//----------------------------------------------------------------------------
+bool CSTATDesktopDlg::ShowScreenshot(const CString &filename)
+{
+	CFile cf;
+	m_pDib = NULL;
+	
+	// Attempt to open the Dib file for reading.
+	if( !cf.Open(filename, CFile::modeRead ) )
+		return false;
+
+	// Get the size of the file and store
+	// in a local variable. Subtract the
+	// size of the BITMAPFILEHEADER structure
+	// since we won't keep that in memory.
+	DWORD dwDibSize;
+	dwDibSize =	cf.GetLength() - sizeof( BITMAPFILEHEADER );
+
+	// Attempt to allocate the Dib memory.
+	unsigned char *pDib;
+	pDib = new unsigned char [dwDibSize];
+	if(!pDib)
+	{
+		cf.Close();
+		return false;
+	}
+
+	BITMAPFILEHEADER BFH;
+
+	// Read in the Dib header and data.
+	try
+	{
+
+		// Did we read in the entire BITMAPFILEHEADER?
+		if( cf.Read( &BFH, sizeof( BITMAPFILEHEADER ) )
+			!= sizeof( BITMAPFILEHEADER ) ||
+
+			// Is the type 'MB'?
+			BFH.bfType != 'MB' ||
+
+			// Did we read in the remaining data?
+			cf.Read( pDib, dwDibSize ) != dwDibSize )
+		{
+
+			// Delete the memory if we had any
+			// errors and return FALSE.
+			delete [] pDib;
+			cf.Close();
+			return false;
+		}
+	}
+
+	// If we catch an exception, delete the
+	// exception, the temporary Dib memory,
+	// and return FALSE.
+	catch( CFileException *e )
+	{
+		e->Delete();
+		delete [] pDib;
+		cf.Close();
+		return false;
+	}
+	
+	cf.Close();
+
+	// If we got to this point, the Dib has been
+	// loaded. If a Dib was already loaded into
+	// this class, we must now delete it.
+	if( m_pDib)
+		delete [] m_pDib;
+
+	// Store the local Dib data pointer and
+	// Dib size variables in the class member
+	// variables.
+	m_pDib = pDib;
+	m_dwDibSize = dwDibSize;
+
+	// Pointer our BITMAPINFOHEADER and RGBQUAD
+	// variables to the correct place in the Dib data.
+	m_pBIH = (BITMAPINFOHEADER *) m_pDib;
+	m_pPalette =
+		(RGBQUAD *) &m_pDib[sizeof(BITMAPINFOHEADER)];
+
+	// Calculate the number of palette entries.
+	m_nPaletteEntries = 1 << m_pBIH->biBitCount;
+	if( m_pBIH->biBitCount > 8 )
+		m_nPaletteEntries = 0;
+	else if( m_pBIH->biClrUsed != 0 )
+		m_nPaletteEntries = m_pBIH->biClrUsed;
+
+	// Point m_pDibBits to the actual Dib bits data.
+	m_pDibBits =
+		&m_pDib[sizeof(BITMAPINFOHEADER)+
+			m_nPaletteEntries*sizeof(RGBQUAD)];
+
+	// If we have a valid palette, delete it.
+	if( m_Palette.GetSafeHandle() != NULL )
+		m_Palette.DeleteObject();
+
+	// If there are palette entries, we'll need
+	// to create a LOGPALETTE then create the
+	// CPalette palette.
+	if(m_nPaletteEntries)
+	{
+		// Allocate the LOGPALETTE structure.
+		LOGPALETTE *pLogPal = (LOGPALETTE *) new char
+				[sizeof(LOGPALETTE) +
+				 m_nPaletteEntries * sizeof(PALETTEENTRY)];
+
+		if(pLogPal)
+		{
+			// Set the LOGPALETTE to version 0x300
+			// and store the number of palette
+			// entries.
+			pLogPal->palVersion = 0x300;
+			pLogPal->palNumEntries = (unsigned short)m_nPaletteEntries;
+
+			// Store the RGB values into each
+			// PALETTEENTRY element.
+			for( int i=0; i<m_nPaletteEntries; i++ ){
+				pLogPal->palPalEntry[i].peRed =
+					m_pPalette[i].rgbRed;
+				pLogPal->palPalEntry[i].peGreen =
+					m_pPalette[i].rgbGreen;
+				pLogPal->palPalEntry[i].peBlue =
+					m_pPalette[i].rgbBlue;
+				}
+
+			// Create the CPalette object and
+			// delete the LOGPALETTE memory.
+			m_Palette.CreatePalette( pLogPal );
+			delete [] pLogPal;
+		}
+		else
+			return false;
+	}
+	
+	// If we have not data we can't draw.
+	if(!m_pDib)
+		return false;
+	
+	// set the value that's in the BITMAPINFOHEADER.
+	
+	int nWidth = m_pBIH->biWidth;
+	int nHeight = m_pBIH->biHeight;
+
+	//HDC hdc, hImageBoxDC;
+	//HBITMAP hImageBoxBitmap;
+	
+	CDC* pDC = m_ImageBox.GetDC();
+	CDC ImageBoxDC;
+
+	ImageBoxDC.CreateCompatibleDC(pDC);
+	
+	CBitmap ImageBoxBitmap;
+	ImageBoxBitmap.CreateCompatibleBitmap(pDC, nWidth, nHeight);
+
+	//select the bitmap
+	ImageBoxDC.SelectObject(&ImageBoxBitmap);
+	ImageBoxDC.SetBkColor(OPAQUE);
+
+	//set MaskBitmap pixel data to that of the original DDB (on screen)
+	SetDIBits(ImageBoxDC.m_hDC, (HBITMAP)ImageBoxBitmap.GetSafeHandle(), 0L, nHeight, m_pDibBits, (BITMAPINFO *)m_pBIH, (DWORD)DIB_RGB_COLORS);
+
+	RECT Rect;
+	m_ImageBox.GetClientRect(&Rect);
+	
+	StretchDIBits(pDC -> m_hDC, 0, 0,
+			Rect.right, Rect.bottom,
+			0, 0,
+			m_pBIH -> biWidth, m_pBIH -> biHeight,
+			m_pDibBits,
+			(BITMAPINFO *) m_pBIH,
+			BI_RGB, SRCCOPY);
+
+	
+	m_ImageBox.ReleaseDC(pDC);
+
+	//release memory originally allocated
+	if(pDib)
+		delete [] pDib;
+
+	return true;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+//used to adjust speed execution time information
+void CSTATDesktopDlg::OnReleasedcaptureSpeedslider(NMHDR* pNMHDR, LRESULT* pResult) 
+{
+	(void)pNMHDR;
+	TCHAR buffer[10];
+	SetDlgItemText(IDC_TIMEDELAY, _itot(m_SliderPos.GetPos(), buffer, 10));
+	(*pResult) = 0;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+//adjusts slider according 
+void CSTATDesktopDlg::OnChangeTimedelay() 
+{
+	CString usertimer;
+	GetDlgItemText(IDC_TIMEDELAY, usertimer);
+	m_SliderPos.SetPos(_ttoi(usertimer));
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Call Notepad to view/edit script
+void CSTATDesktopDlg::OnEditscript() 
+{
+	CString file;
+	GetDlgItemText(IDC_SCRIPT, file);
+
+	if (!file.IsEmpty())
+	{
+		int index = file.ReverseFind('\\');
+		if (index != -1)
+		{
+			OpenFile(file.GetBuffer(0));
+		}
+	}
+
+}
+
+void CSTATDesktopDlg::OnView() 
+{
+	CString file;
+	GetDlgItemText(IDC_EDITLOGNAME, file);
+
+	if (file.IsEmpty() || (file.Compare(_T("<date-time>")) == 0))
+	{
+
+		CString setting=STAT_LOGFILEPATH_VALUE;
+		SetCurrentDirectory(setting);
+
+		CFileDialog dlgStatFileOpen(TRUE, 
+									NULL, 
+									NULL, 
+									OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, 
+									_T("Log Files (*.log)|*.log|All Files (*.*)|*.*||"));
+
+		// log file to use
+		if (dlgStatFileOpen.DoModal() == IDOK)	//when ok is pressed
+		{
+			file = dlgStatFileOpen.GetPathName();
+		}
+	}
+
+	if (!file.IsEmpty() && (file.Compare(_T("<date-time>")) != 0))
+		OpenFile(file.GetBuffer(0));
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Open a text file in Notepad
+void CSTATDesktopDlg::OpenFile(LPTSTR file)
+{
+	TCHAR szCurrentDir[MAX_PATH + 1];
+	if (GetWindowsDirectory(szCurrentDir, sizeof(szCurrentDir)))
+	{
+		CString cBuf;
+		cBuf = _T("\"");
+		cBuf += szCurrentDir;
+		cBuf += _T("\\Notepad.exe\" ");
+		cBuf += file;
+
+		if (!CallProcess(NULL, cBuf.GetBuffer(0), NULL))
+			AfxMessageBox(_T("Could not invoke Notepad.exe to view script file"), MB_OK, NULL);
+	}
+	else
+		AfxMessageBox(_T("Could not locate Windows directory"), MB_OK, NULL);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Invoke a process
+bool CSTATDesktopDlg::CallProcess(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory)
+{
+	bool valid = false;
+	STARTUPINFO startInfo = {0};
+	startInfo.cb = sizeof(STARTUPINFO);
+
+	PROCESS_INFORMATION procInfo = {0};
+
+	// event attributes for the child process
+	SECURITY_ATTRIBUTES eventAttr;
+	eventAttr.nLength = sizeof(eventAttr);
+	eventAttr.lpSecurityDescriptor = NULL;
+	eventAttr.bInheritHandle = TRUE;
+
+	if (CreateProcess(szApplication, szCommandLine, NULL, NULL, FALSE, NULL, NULL,
+					  szDirectory, &startInfo, &procInfo))
+	{
+		valid = true;
+		CloseHandle(procInfo.hThread);
+		CloseHandle(procInfo.hProcess);
+	}
+
+	return valid;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Browse for Reference images folder
+void CSTATDesktopDlg::OnBrowseimage() 
+{
+	TCHAR chName[MAX_PATH];
+
+	BROWSEINFO bi = {0};
+	bi.hwndOwner = m_hWnd;
+	bi.lpszTitle = _T("Please select folder where the reference bitmap files are stored...");
+
+	LPITEMIDLIST lpIDList = ::SHBrowseForFolder(&bi); //now display dialog box 
+
+	::SHGetPathFromIDList(lpIDList, chName); //Converts an item identifier list to a file system path
+
+	m_ImageLocation.SetWindowText(chName);	//pastes location into edit box
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Read previous STAT settings
+void CSTATDesktopDlg::ReadSettings()
+{
+	//set slider text
+	m_SliderPos.SetRangeMax(30000, TRUE);	//max delay time
+	m_SliderPos.SetRangeMin(100, TRUE);		//minimum delay time
+
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+		CString setting;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_DELAY,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			int iPos = _ttoi(setting);
+			if (iPos < 100)
+				setting= _T("100");
+
+			if (iPos > 30000)
+				setting= _T("30000");
+
+			m_Delay.SetWindowText(setting);
+			m_SliderPos.SetPos(iPos);
+		}
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_CUST_LOGFILE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			m_LogFileName.SetWindowText(setting);
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_FUDGE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			m_PercentageDiff.SetPos(_ttoi(setting));
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_REFDIR,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			m_ImageLocation.SetWindowText(setting);
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_SCRIPT,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			m_Script.SetWindowText(setting);
+
+		long lCount = 0;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_VERIFYIMAGE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			if (lCount)
+			{
+				m_VerifyImage.SetCheck(lCount);
+				m_ImageLocation.EnableWindow(TRUE);
+				m_PercentageDiff.EnableWindow(TRUE);
+			}
+			else
+			{
+				m_ImageLocation.EnableWindow(FALSE);
+				m_PercentageDiff.EnableWindow(FALSE);
+			}
+		}
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_LOGTOFILE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			if (lCount)
+			{
+				m_LogToFile.SetCheck(lCount);
+				m_LogFileName.EnableWindow(TRUE);
+			}
+			else
+				m_LogFileName.EnableWindow(FALSE);
+		}
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_CONNECTION,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			m_Connection.SetWindowText(setting);
+		}
+
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_APPEND,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+		}
+		m_Append.SetCheck(lCount);
+
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_PLATFORM,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+		}
+	}
+	OnImageverify();
+	OnLogToFile();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Save STAT settings
+void CSTATDesktopDlg::SaveSettings()
+{
+	// script
+	(*szBuffer) = (TCHAR)0;
+	m_Script.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_SCRIPT,ST_TEST_KEY);
+
+	// address
+	(*szBuffer) = (char)0;
+	m_Connection.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_CONNECTION,ST_TEST_KEY);
+
+	// delay
+	(*szBuffer) = (char)0;
+	m_Delay.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_DELAY,ST_TEST_KEY);
+
+	// percentage
+	(*szBuffer) = (char)0;
+	_itot(m_PercentageDiff.GetPos(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_FUDGE,ST_TEST_KEY);
+
+	// ref dir
+	(*szBuffer) = (char)0;
+	m_ImageLocation.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_REFDIR,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_LogFileName.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_CUST_LOGFILE,ST_TEST_KEY);
+
+	_ltot( m_Append.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_APPEND,ST_TEST_KEY);
+
+	_ltot(m_VerifyImage.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_VERIFYIMAGE,ST_TEST_KEY);
+
+	_ltot(m_LogToFile.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_LOGTOFILE,ST_TEST_KEY);
+
+  }
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Actions to perform when image verify checked/unchecked
+void CSTATDesktopDlg::OnImageverify()
+{
+	if (m_VerifyImage.GetCheck())
+	{
+		m_ImageLocation.EnableWindow(TRUE);
+		m_PercentageDiff.EnableWindow(TRUE);
+		m_BrowseImage.EnableWindow(TRUE);
+	}
+	else
+	{
+		m_ImageLocation.EnableWindow(FALSE);
+		m_PercentageDiff.EnableWindow(FALSE);
+		m_BrowseImage.EnableWindow(FALSE);
+	}
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Actions to perform when log to file checked/unchecked
+void CSTATDesktopDlg::OnLogToFile()
+{
+	if(m_LogToFile.GetCheck())
+	{
+		m_LogFileName.EnableWindow(TRUE);
+		m_Append.EnableWindow(TRUE);
+		m_BrowseLog.EnableWindow(TRUE);
+		m_ViewLog.EnableWindow(TRUE);
+	}
+	else
+	{
+		m_LogFileName.EnableWindow(FALSE);
+		m_Append.EnableWindow(FALSE);
+		m_BrowseLog.EnableWindow(FALSE);
+		m_ViewLog.EnableWindow(FALSE);
+	}
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Browse for a log file to write to
+void CSTATDesktopDlg::OnBrowseLog() 
+{
+	CFileDialog dlgStatFileOpen(TRUE, 
+								NULL, 
+								NULL, 
+								OFN_PATHMUSTEXIST, 
+								_T("Log Files (*.log)|*.log|Script Files (*.txt)|*.txt|All Files (*.*)|*.*||"));
+
+	// new script file to use
+	if (dlgStatFileOpen.DoModal() == IDOK)	//when ok is pressed
+		m_LogFileName.SetWindowText(dlgStatFileOpen.GetPathName());
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Make connection to the back end
+int CSTATDesktopDlg::ConnectToEngine() 
+{
+	int	retCode =	ITS_OK;
+
+	STATCONNECTTYPE type = SymbianInvalid;
+	char szConnection[512] = {0};
+
+	m_Connection.GetWindowText(szBuffer, sizeof(szBuffer));
+	strcpy(szConnection, szBuffer);
+
+	char *p = strchr(szConnection, ':');
+	if (p)
+	{
+		(*p) = (char)0;
+		if (stricmp(szConnection, "SymbianSocket") == 0)
+		{
+			type = SymbianSocket;
+		}
+		else if (stricmp(szConnection, "SymbianSerial") == 0)
+		{
+			type = SymbianSerial;
+		}
+		else if (stricmp(szConnection, "SymbianInfrared") == 0)
+		{
+			type = SymbianInfrared;
+		}
+		else if (stricmp(szConnection, "SymbianBluetooth") == 0)
+		{
+			type = SymbianBluetooth;
+		}
+		else if (stricmp(szConnection, "SymbianUsb") == 0)
+		{
+			type = SymbianUsb;
+		}
+
+		MessageFormat("Connecting over %s to %s...", szConnection, p + 1);
+
+		// initialise back end
+		iHandle =	(iptrConnect)(type, p + 1, NULL, NULL);
+
+		if( NULL != iHandle )
+		{
+			retCode =	ITS_OK;
+		}
+		else
+		{
+			retCode =	GENERAL_FAILURE;
+		}
+	}
+
+	return (retCode);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Set up image verification
+int CSTATDesktopDlg::SetImageVerification()
+{
+	(*szBuffer) = (char)0;
+	m_ImageLocation.GetWindowText(szBuffer, sizeof(szBuffer));
+
+	int iErrorCode = (iptrSetImageVerification)(iHandle, szBuffer,
+						true, m_PercentageDiff.GetPos());
+
+	// success?
+	if(iErrorCode)
+	{
+		Message("Image verification set");
+		return true;
+	}
+	else
+	{
+		iErrorCode = GENERAL_FAILURE;
+		Message("ERROR: No images available for verification");
+	}
+
+	return false;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Set up image verification
+void CSTATDesktopDlg::EnableFields(bool bEnable)
+{
+	// store
+	if (!bEnable)
+	{
+		iLastVerify = m_VerifyImage.GetCheck();
+		iLastLog = m_LogToFile.GetCheck();
+
+		GetDlgItem(IDRUN)->SetWindowText(_T("Stop"));
+	}
+
+	GetDlgItem(IDC_SCRIPT)->EnableWindow(bEnable);
+	GetDlgItem(IDC_BROWSE)->EnableWindow(bEnable);
+	GetDlgItem(IDEDITSCRIPT)->EnableWindow(bEnable);
+	GetDlgItem(IDC_TIMEDELAY)->EnableWindow(bEnable);
+	GetDlgItem(IDC_SPEEDSLIDER)->EnableWindow(bEnable);
+	GetDlgItem(IDC_IMAGEVERIFY)->EnableWindow(bEnable);
+	GetDlgItem(IDC_LOCATION)->EnableWindow(bEnable);
+	GetDlgItem(IDC_BROWSEIMAGE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_DIFFLOGNAME)->EnableWindow(bEnable);
+	GetDlgItem(IDC_EDITLOGNAME)->EnableWindow(bEnable);
+	GetDlgItem(IDC_APPEND)->EnableWindow(bEnable);
+	GetDlgItem(IDC_BROWSELOG)->EnableWindow(bEnable);
+	GetDlgItem(IDC_EDITLOGNAME)->EnableWindow(bEnable);
+	GetDlgItem(IDEXIT)->EnableWindow(bEnable);
+	GetDlgItem(IDC_PERCENTAGEDIFF)->EnableWindow(bEnable);
+
+	// restore
+	if (bEnable)
+	{
+		m_VerifyImage.SetCheck(iLastVerify);
+		m_LogToFile.SetCheck(iLastLog);
+		OnImageverify();
+		OnLogToFile();
+		GetDlgItem(IDRUN)->SetWindowText(_T("Run"));
+	}
+
+	UpdateWindow();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Release resources at finish
+void CSTATDesktopDlg::CleanUp(LPCTSTR message, bool bEnableFields)
+{
+	CString cMsg = message;
+	CleanUp(cMsg, bEnableFields);
+}
+
+void CSTATDesktopDlg::CleanUp(const CString &message, bool bEnableFields)
+{
+	m_Progress.SetPos(0);
+
+	if (bEnableFields)
+		EnableFields(TRUE);
+
+	if (!message.IsEmpty())
+	{
+		Message(message);
+	}
+
+	// close the handle to our thread
+  	if (hThreadHandle)
+  	{
+  		CloseHandle(hThreadHandle);
+  		hThreadHandle = (HANDLE)0;
+  	}
+
+	// release the back end
+	if( iHandle != 0 )
+	{
+		(iptrDisconnect)(iHandle);
+		iHandle = 0;
+	}
+
+	bRunning = false;
+}
+
+void CSTATDesktopDlg::OnManage() 
+{
+	STATManageConnection oManage;
+	if (IDOK == oManage.DoModal())
+	{
+		m_Connection.SetWindowText(cConnectionInfo);
+	}
+}
+
+void CSTATDesktopDlg::OnDestroy() 
+{
+	CleanUp(_T(""), false);
+
+	if( iMessageReporter != NULL )
+	{
+		delete iMessageReporter;
+		iMessageReporter =	NULL;
+	}
+
+	if( ihLib != NULL )
+	{
+		::FreeLibrary( ihLib );
+		ihLib =	NULL;
+	}
+
+	DeleteCriticalSection(&CriticalSection);
+
+	CDialog::OnDestroy();
+}
+
+LRESULT CSTATDesktopDlg::OnDoneCommand(WPARAM command, LPARAM )
+{
+	command;
+
+	int currentCommand = 0;
+	if( ITS_OK == (iptrGetCurrentCommandNumber)(iHandle, &currentCommand) )
+	{
+		m_Progress.SetPos(currentCommand);
+	}
+
+	return (0L );
+}
+
+LRESULT CSTATDesktopDlg::OnDoneScript(WPARAM iScriptExitCode, LPARAM )
+{
+	CleanUp((iptrGetErrorText)(iHandle, iScriptExitCode));
+
+	return (0L );
+}
+
+LRESULT CSTATDesktopDlg::OnLogMesage(WPARAM, LPARAM pLogMessage )
+{
+	LogMessage *logMessage = reinterpret_cast<LogMessage*>(pLogMessage);
+
+	ASSERT( FALSE == ::IsBadWritePtr( logMessage, sizeof(*logMessage) ) );
+
+	if( NULL != logMessage )
+	{
+		if (logMessage->iMessage.GetLength() != 0)
+		{
+			Message(logMessage->iMessage);
+		}
+
+		if (logMessage->iText.GetLength() != 0)
+		{
+			Message(logMessage->iText);
+		}
+
+		if (logMessage->iScreenShot)
+		{
+			ShowScreenshot(logMessage->iText);
+		}
+
+		if (logMessage->iMessageBox)
+		{
+			::AfxMessageBox(logMessage->iMessage, MB_OK, NULL);
+		}
+	}
+
+	return (0L);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/src/statmanageconnection.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,335 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+#include "statdesktop.h"
+#include "STATManageConnection.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+// global var to hold our selection when we exit the dialog
+CString cConnectionInfo;
+
+/////////////////////////////////////////////////////////////////////////////
+// STATManageConnection dialog
+
+
+STATManageConnection::STATManageConnection(CWnd* pParent /*=NULL*/)
+	: CDialog(STATManageConnection::IDD, pParent)
+{
+	//{{AFX_DATA_INIT(STATManageConnection)
+	//}}AFX_DATA_INIT
+}
+
+
+void STATManageConnection::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(STATManageConnection)
+	DDX_Control(pDX, IDC_ADDRESS, m_Address);
+	DDX_Control(pDX, IDC_TRANSPORT, m_Transport);
+	DDX_Control(pDX, IDC_LISTCONNECTIONS, m_ListConnections);
+	//}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(STATManageConnection, CDialog)
+	//{{AFX_MSG_MAP(STATManageConnection)
+	ON_BN_CLICKED(IDC_REMOVE, OnRemove)
+	ON_BN_CLICKED(IDC_ADD, OnAdd)
+	ON_LBN_SELCHANGE(IDC_LISTCONNECTIONS, OnSelchangeListconnections)
+	ON_CBN_SELCHANGE(IDC_TRANSPORT, OnSelchangeTransport)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// STATManageConnection message handlers
+
+BOOL STATManageConnection::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	cConnectionInfo.ReleaseBuffer();
+	m_Transport.SetCurSel(2);
+	statIniFile.SetIniFileName(STAT_INI_NAME);
+		CString setting;
+//	lCount = 0;
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+
+		lCount = 0;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_CONNECTIONIDX,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount = _ttol(setting);
+			m_ListConnections.SetCurSel(lCount);
+			OnSelchangeListconnections();
+		}
+	}
+
+	if(statIniFile.SectionExists(ST_CONNECTION_LIST) )
+	{
+		for( int i=0;i<lCount;++i)
+		{
+			TCHAR buf[6];
+			_ltot(i+1, buf, 10);
+			setting.Empty();
+			setting=statIniFile.GetKeyValue(buf,ST_CONNECTION_LIST);
+			if(!setting.IsEmpty())
+				m_ListConnections.AddString(setting);
+		}
+	}
+	return TRUE;
+}
+
+
+void STATManageConnection::OnAdd() 
+{
+	CString transport;
+	CString address;
+	switch(m_Transport.GetCurSel())
+	{
+	case 0:	// socket
+		transport = "SymbianSocket:";
+		break;
+	case 1:	// serial
+		transport = "SymbianSerial:";
+		break;
+	case 2:	// infra-red
+		transport = "SymbianInfrared:";
+		break;
+	case 3:	// bluetooth
+		transport = "SymbianBluetooth:";
+		break;
+	case 4:	// usb
+
+		//break;
+	default:
+		return;
+	}
+
+	m_Address.GetWindowText(address);
+	transport += address;
+
+	if (!transport.IsEmpty() && !InList(transport))
+	{
+		m_ListConnections.AddString(transport);
+		// highlight it in the list
+		m_ListConnections.SetCurSel(m_ListConnections.FindStringExact(0, transport.GetBuffer(0)));
+	}
+	else
+		AfxMessageBox(_T("This configuration already exists in the list."));
+}
+
+void STATManageConnection::OnRemove() 
+{
+	int index = m_ListConnections.GetCurSel();
+	if (index != LB_ERR)
+	{
+		m_ListConnections.DeleteString(index);
+		m_ListConnections.SetCurSel(0);
+		OnSelchangeListconnections();
+	}
+}
+
+void STATManageConnection::OnOK() 
+{
+	int index = m_ListConnections.GetCurSel();
+	if (index != LB_ERR)
+	{
+		CString item;
+		TCHAR buf[16];
+		CWaitCursor oWait;
+		m_ListConnections.GetText(index, cConnectionInfo);
+		lCount=m_ListConnections.GetCount();
+		_ltot(lCount, buf, 10);
+		statIniFile.WriteKey(buf,ST_CONNECTIONIDX,ST_TEST_KEY);
+		//empty connection list
+		statIniFile.DeleteSection(ST_CONNECTION_LIST);
+		for( int i=0;i<lCount;++i)
+		{
+			_ltot(i+1, buf, 10);
+			m_ListConnections.GetText(i, item);
+			statIniFile.WriteKey(item,buf,ST_CONNECTION_LIST);
+		}
+		CDialog::OnOK();
+	}
+}
+
+void STATManageConnection::OnCancel() 
+{
+	cConnectionInfo.ReleaseBuffer();
+	CDialog::OnCancel();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// 
+bool STATManageConnection::InList(CString & Entry)
+{
+	CString item;
+	int iCount = m_ListConnections.GetCount();
+	for (int i=0;i<iCount;i++)
+	{
+		m_ListConnections.GetText(i, item);
+
+		if (item.Compare(Entry.GetBuffer(0)) == 0)
+		{
+			return true;
+		}
+	}
+
+	return false;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Converts a char * to it's Unicode equivalent
+//
+LPTSTR STATManageConnection::ToUnicode(const char *string)
+{
+#ifdef UNICODE
+	static TCHAR szBuffer[MAX_UNICODE_LEN + 1] = {0};
+	szBuffer[0] = (TCHAR)0;
+
+    // Convert to UNICODE.
+    if (!MultiByteToWideChar(CP_ACP,					// conversion type
+							 0,							// flags
+							 string,					// source
+							 -1,						// length
+							 szBuffer,					// dest
+							 MAX_UNICODE_LEN))			// length
+    {
+        return _T("Could not convert");
+    }
+
+    return szBuffer;
+#else
+	return (LPTSTR)string;
+#endif
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Converts a Unicode to it's char * equivalent
+//
+char * STATManageConnection::ToAnsi(LPCTSTR string)
+{
+#ifdef UNICODE
+	static char szBuffer[MAX_UNICODE_LEN + 1] = {0};
+	szBuffer[0] = (char)0;
+
+    // Convert to ANSI.
+    if (!WideCharToMultiByte(CP_ACP,					// conversion type
+							 0,							// flags
+							 string,					// source
+							 -1,						// length
+							 szBuffer,					// dest
+							 MAX_UNICODE_LEN,			// length
+							 NULL,
+							 NULL ))
+    {
+        return "Could not convert";
+    }
+
+    return szBuffer;
+#else
+	return (char *)string;
+#endif
+}
+
+
+void STATManageConnection::OnSelchangeListconnections() 
+{
+	CString item;
+	int index = m_ListConnections.GetCurSel();
+	if (index != LB_ERR)
+	{
+		m_ListConnections.GetText(index, item);
+
+		int i = item.Find(_T(':'));
+		if (i != -1)
+		{
+			CString transport = item.Left(i);
+
+			if (transport.CompareNoCase(_T("SymbianSocket")) == 0)
+			{
+				m_Transport.SetCurSel(SymbianSocket - 1);
+			}
+			else if (transport.CompareNoCase(_T("SymbianSerial")) == 0)
+			{
+				m_Transport.SetCurSel(SymbianSerial - 1);
+			}
+			else if (transport.CompareNoCase(_T("SymbianInfrared")) == 0)
+			{
+				m_Transport.SetCurSel(SymbianInfrared - 1);
+			}
+			else if (transport.CompareNoCase(_T("SymbianBluetooth")) == 0)
+			{
+				m_Transport.SetCurSel(SymbianBluetooth - 1);
+			}
+			else if (transport.CompareNoCase(_T("SymbianUsb")) == 0)
+			{
+
+			}
+
+			m_Address.SetWindowText(item.Mid(i + 1));
+		}
+	}
+}
+
+void STATManageConnection::OnSelchangeTransport() 
+{
+	// If the user has clicked to a selection of the transport
+	// list then we warn them if they selected 'USB'.
+
+	CString item;
+	int index = m_Transport.GetCurSel();
+	if (index != LB_ERR)
+	{
+		m_Transport.GetLBText(index, item);
+
+		if ((item.CompareNoCase(_T("SymbianInfrared")) == 0) ||
+			(item.CompareNoCase(_T("SymbianBluetooth")) == 0))
+		{
+			// If the transport selection is infrared we show a 
+			// warning that infrared is treated the same as 
+			// serial and specify that the user should enter a 
+			// port number in the address field.
+			CString	symbian;
+			CString	appName;
+			CString	prompt;
+
+			if( ( symbian.LoadString( IDS_SYMBIAN ) ) &&
+				( appName.LoadString( IDS_APPNAME ) ) &&
+				( prompt.LoadString( IDS_PORTPROMPT ) ) )
+			{
+				CString	msg;
+				msg.Format( prompt, symbian, appName );
+
+				::AfxMessageBox( msg );
+			}
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/src/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/statdesktop.dep	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,59 @@
+# Microsoft Developer Studio Generated Dependency File, included by STATDesktop.mak
+
+..\common\src\INI.cpp : \
+	"..\common\inc\INI.h"\
+	
+
+.\src\STATDesktop.cpp : \
+	"..\lib\inc\cstatreturncodes.h"\
+	"..\lib\inc\messagereporter.h"\
+	"..\lib\inc\scriptprogressmonitor.h"\
+	"..\lib\inc\statcommon.h"\
+	"..\lib\inc\statexp.h"\
+	"..\common\inc\INI.h"\
+	".\inc\LogMessage.h"\
+	".\inc\MessageReporterImp.h"\
+	".\inc\resource.h"\
+	".\inc\STATDesktop.h"\
+	".\inc\STATDesktopDlg.h"\
+	".\inc\WindowMessages.h"\
+	
+
+.\src\statdesktop.rc : \
+	".\inc\resource.h"\
+	".\res\STATDesktop.ico"\
+	".\res\STATDesktop.rc2"\
+	
+
+.\src\STATDesktopDlg.cpp : \
+	"..\lib\inc\cstatreturncodes.h"\
+	"..\lib\inc\messagereporter.h"\
+	"..\lib\inc\scriptprogressmonitor.h"\
+	"..\lib\inc\statcommon.h"\
+	"..\lib\inc\statexp.h"\
+	"..\common\inc\INI.h"\
+	".\inc\LogMessage.h"\
+	".\inc\MessageReporterImp.h"\
+	".\inc\resource.h"\
+	".\inc\ScriptProgressMonitorImp.h"\
+	".\inc\STATDesktop.h"\
+	".\inc\STATDesktopDlg.h"\
+	".\inc\STATManageConnection.h"\
+	".\inc\WindowMessages.h"\
+	
+
+.\src\STATManageConnection.cpp : \
+	"..\lib\inc\cstatreturncodes.h"\
+	"..\lib\inc\messagereporter.h"\
+	"..\lib\inc\scriptprogressmonitor.h"\
+	"..\lib\inc\statcommon.h"\
+	"..\lib\inc\statexp.h"\
+	"..\common\inc\INI.h"\
+	".\inc\resource.h"\
+	".\inc\STATDesktop.h"\
+	".\inc\STATManageConnection.h"\
+	
+
+.\src\StdAfx.cpp : \
+	".\inc\StdAfx.h"\
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/statdesktop.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,193 @@
+# Microsoft Developer Studio Project File - Name="STATDesktop" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=STATDesktop - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "STATDesktop.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "STATDesktop.mak" CFG="STATDesktop - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "STATDesktop - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "STATDesktop - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "STATDesktop"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "STATDesktop - Win32 Release"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu".\inc\stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\inc" /I "\epoc32\tools\stat\headers" /I "..\common\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 Ws2_32.lib /nologo /subsystem:windows /machine:I386 /out:"..\..\bin\STATDesktop.exe"
+# SUBTRACT LINK32 /pdb:none /debug
+# Begin Special Build Tool
+ProjDir=.
+SOURCE="$(InputPath)"
+PostBuild_Desc=Performing Custom Build Step on STATDesktop
+PostBuild_Cmds=$(ProjDir)\UpdateDesktop.bat
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "STATDesktop - Win32 Debug"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu".\inc\stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\inc" /I "\epoc32\tools\stat\headers" /I "..\common\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 WS2_32.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"..\..\bin\STATDesktopd.exe" /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "STATDesktop - Win32 Release"
+# Name "STATDesktop - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\common\src\INI.cpp
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\STATDesktop.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\STATDesktop.dep
+# End Source File
+# Begin Source File
+
+SOURCE=.\STATDesktop.mak
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statdesktop.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\STATDesktopDlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\STATManageConnection.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\common\inc\INI.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\LogMessage.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\MessageReporterImp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\ScriptProgressMonitorImp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\STATDesktop.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\STATDesktopDlg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\STATManageConnection.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\StdAfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\WindowMessages.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\STATDesktop.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\STATDesktop.rc2
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/statdesktop.mak	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,304 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on STATDesktop.dsp
+!IF "$(CFG)" == ""
+CFG=STATDesktop - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to STATDesktop - Win32 Debug.
+!ENDIF 
+
+!IF "$(CFG)" != "STATDesktop - Win32 Release" && "$(CFG)" != "STATDesktop - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "STATDesktop.mak" CFG="STATDesktop - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "STATDesktop - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "STATDesktop - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+!ERROR An invalid configuration is specified.
+!ENDIF 
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "STATDesktop - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "..\..\bin\STATDesktop.exe" "$(OUTDIR)\STATDesktop.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\INI.obj"
+	-@erase "$(INTDIR)\INI.sbr"
+	-@erase "$(INTDIR)\STATDesktop.obj"
+	-@erase "$(INTDIR)\STATDesktop.pch"
+	-@erase "$(INTDIR)\statdesktop.res"
+	-@erase "$(INTDIR)\STATDesktop.sbr"
+	-@erase "$(INTDIR)\STATDesktopDlg.obj"
+	-@erase "$(INTDIR)\STATDesktopDlg.sbr"
+	-@erase "$(INTDIR)\STATManageConnection.obj"
+	-@erase "$(INTDIR)\STATManageConnection.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(OUTDIR)\STATDesktop.bsc"
+	-@erase "..\..\bin\STATDesktop.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\common\inc" /I "..\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATDesktop.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\statdesktop.res" /d "NDEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\STATDesktop.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\INI.sbr" \
+	"$(INTDIR)\STATDesktop.sbr" \
+	"$(INTDIR)\STATDesktopDlg.sbr" \
+	"$(INTDIR)\STATManageConnection.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\STATDesktop.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=Ws2_32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\STATDesktop.pdb" /machine:I386 /out:"..\..\bin\STATDesktop.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\INI.obj" \
+	"$(INTDIR)\STATDesktop.obj" \
+	"$(INTDIR)\STATDesktopDlg.obj" \
+	"$(INTDIR)\STATManageConnection.obj" \
+	"$(INTDIR)\StdAfx.obj" \
+	"$(INTDIR)\statdesktop.res"
+
+"..\..\bin\STATDesktop.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+ProjDir=.
+SOURCE="$(InputPath)"
+PostBuild_Desc=Performing Custom Build Step on STATDesktop
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+$(DS_POSTBUILD_DEP) : "..\..\bin\STATDesktop.exe" "$(OUTDIR)\STATDesktop.bsc"
+   .\UpdateDesktop.bat
+	echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ELSEIF  "$(CFG)" == "STATDesktop - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "..\..\bin\STATDesktopd.exe" "$(OUTDIR)\STATDesktop.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\INI.obj"
+	-@erase "$(INTDIR)\INI.sbr"
+	-@erase "$(INTDIR)\STATDesktop.obj"
+	-@erase "$(INTDIR)\STATDesktop.pch"
+	-@erase "$(INTDIR)\statdesktop.res"
+	-@erase "$(INTDIR)\STATDesktop.sbr"
+	-@erase "$(INTDIR)\STATDesktopDlg.obj"
+	-@erase "$(INTDIR)\STATDesktopDlg.sbr"
+	-@erase "$(INTDIR)\STATManageConnection.obj"
+	-@erase "$(INTDIR)\STATManageConnection.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(OUTDIR)\STATDesktop.bsc"
+	-@erase "$(OUTDIR)\STATDesktopd.pdb"
+	-@erase "..\..\bin\STATDesktopd.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\inc"  /I "..\common\inc" /I "..\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATDesktop.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\statdesktop.res" /d "_DEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\STATDesktop.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\INI.sbr" \
+	"$(INTDIR)\STATDesktop.sbr" \
+	"$(INTDIR)\STATDesktopDlg.sbr" \
+	"$(INTDIR)\STATManageConnection.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\STATDesktop.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=WS2_32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\STATDesktopd.pdb" /debug /machine:I386 /out:"..\..\bin\STATDesktopd.exe" /pdbtype:sept 
+LINK32_OBJS= \
+	"$(INTDIR)\INI.obj" \
+	"$(INTDIR)\STATDesktop.obj" \
+	"$(INTDIR)\STATDesktopDlg.obj" \
+	"$(INTDIR)\STATManageConnection.obj" \
+	"$(INTDIR)\StdAfx.obj" \
+	"$(INTDIR)\statdesktop.res"
+
+"..\..\bin\STATDesktopd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("STATDesktop.dep")
+!INCLUDE "STATDesktop.dep"
+!ELSE 
+!MESSAGE Warning: cannot find "STATDesktop.dep"
+!ENDIF 
+!ENDIF 
+
+
+!IF "$(CFG)" == "STATDesktop - Win32 Release" || "$(CFG)" == "STATDesktop - Win32 Debug"
+SOURCE=..\common\src\INI.cpp
+
+!IF  "$(CFG)" == "STATDesktop - Win32 Release"
+
+CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\common\inc" /I "..\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\INI.obj"	"$(INTDIR)\INI.sbr" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "STATDesktop - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\inc" /I "..\common\inc" /I "..\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\INI.obj"	"$(INTDIR)\INI.sbr" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+SOURCE=.\src\STATDesktop.cpp
+
+"$(INTDIR)\STATDesktop.obj"	"$(INTDIR)\STATDesktop.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATDesktop.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\statdesktop.rc
+
+!IF  "$(CFG)" == "STATDesktop - Win32 Release"
+
+
+"$(INTDIR)\statdesktop.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x809 /fo"$(INTDIR)\statdesktop.res" /i "src" /d "NDEBUG" $(SOURCE)
+
+
+!ELSEIF  "$(CFG)" == "STATDesktop - Win32 Debug"
+
+
+"$(INTDIR)\statdesktop.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x809 /fo"$(INTDIR)\statdesktop.res" /i "src" /d "_DEBUG" $(SOURCE)
+
+
+!ENDIF 
+
+SOURCE=.\src\STATDesktopDlg.cpp
+
+"$(INTDIR)\STATDesktopDlg.obj"	"$(INTDIR)\STATDesktopDlg.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATDesktop.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\STATManageConnection.cpp
+
+"$(INTDIR)\STATManageConnection.obj"	"$(INTDIR)\STATManageConnection.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATDesktop.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\StdAfx.cpp
+
+!IF  "$(CFG)" == "STATDesktop - Win32 Release"
+
+CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I ".\inc"  /I "..\common\inc" /I "..\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATDesktop.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\STATDesktop.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "STATDesktop - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\inc"  /I "..\common\inc" /I "..\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATDesktop.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\STATDesktop.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+
+!ENDIF 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/desktop/updatedesktop.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,34 @@
+@rem
+@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@@rem
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+
+rem which accompanies this distribution, and is available
+
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+copy ..\..\bin\statdesktop.exe \epoc32\tools\stat\statdesktop.exe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,50 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+
+TOOLS
+
+PRJ_EXPORTS
+
+..\..\lib\inc\cstatreturncodes.h	\epoc32\tools\stat\headers\cstatreturncodes.h
+..\..\lib\inc\ScriptProgressMonitor.h	\epoc32\tools\stat\headers\scriptprogressmonitor.h
+..\..\lib\inc\MessageReporter.h	\epoc32\tools\stat\headers\messagereporter.h
+..\..\lib\inc\stat.h			\epoc32\tools\stat\headers\stat.h
+..\..\lib\inc\statcommon.h		\epoc32\tools\stat\headers\statcommon.h
+..\..\lib\inc\statexp.h			\epoc32\tools\stat\headers\statexp.h
+
+PRJ_MMPFILES
+// Extension Makefile
+makefile statdll.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/group/statdll.mk	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,85 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+# which accompanies this distribution, and is available
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# Typically C:\apps\MSVC6\VC98\Bin
+COMPILER=nmake
+
+# Called with
+#
+# $(PLATFORM) = TOOLS
+# $(CFG)      = DEB, REL
+
+BLD	:  
+	@echo BLD called with $(PLATFORM)$(CFG)
+	
+# release version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-mkdir "$(EPOCROOT)epoc32\tools\STAT"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (DLL)
+	"$(COMPILER)" /A /NOLOGO /f "STATdll.mak" CFG="STATDll - Win32 Release"
+	
+	echo ** STAT DLL (RELEASE) compiled successfully
+
+!endif
+
+# debug version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (DLL)
+	"$(COMPILER)" /A /NOLOGO /f "STATdll.mak" CFG="STATDll - Win32 Debug"
+	
+	echo ** STAT DLL (DEBUG) compiled successfully
+
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-rmdir "..\Release" /q /s
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+	-rmdir "..\Debug" /q /s
+!endif
+
+RELEASABLES :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	@echo $(EPOCROOT)epoc32\tools\STAT\stat.dll
+	@echo $(EPOCROOT)epoc32\tools\STAT\stat.exp
+	@echo $(EPOCROOT)epoc32\tools\STAT\stat.lib
+!endif
+
+SAVESPACE : BLD
+
+MAKMAKE LIB CLEANLIB RESOURCE FREEZE FINAL : 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/inc/resource.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by M:\D\P4work\DP\development\project\2008\preq2582\sf\ana\testexec\testtoolsconn\stat\Desktop\source\dll\src\STATDll.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        1000
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           1000
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/inc/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#if !defined(AFX_STDAFX_H__8550F158_DA78_11D5_BC49_00B0D065107F__INCLUDED_)
+#define AFX_STDAFX_H__8550F158_DA78_11D5_BC49_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+#include <assert.h>
+
+//#include <afxwin.h>         // MFC core and standard components
+//#include <afxext.h>         // MFC extensions
+
+//#ifndef _AFX_NO_OLE_SUPPORT
+//#include <afxole.h>         // MFC OLE classes
+//#include <afxodlgs.h>       // MFC OLE dialog classes
+//#include <afxdisp.h>        // MFC Automation classes
+//#endif // _AFX_NO_OLE_SUPPORT
+
+
+//#ifndef _AFX_NO_DB_SUPPORT
+//#include <afxdb.h>			// MFC ODBC database classes
+//#endif // _AFX_NO_DB_SUPPORT
+
+//#ifndef _AFX_NO_DAO_SUPPORT
+//#include <afxdao.h>			// MFC DAO database classes
+//#endif // _AFX_NO_DAO_SUPPORT
+
+#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
+//#ifndef _AFX_NO_AFXCMN_SUPPORT
+//#include <afxcmn.h>			// MFC support for Windows Common Controls
+//#endif // _AFX_NO_AFXCMN_SUPPORT
+
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__8550F158_DA78_11D5_BC49_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/res/stat.rc2	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,13 @@
+//
+// STAT.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+	#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/src/statdll.rc	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,145 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "../inc/resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "Comments", "Test Automation DLL\0"
+            VALUE "CompanyName", "Nokia Corporation\0"
+            VALUE "FileDescription", "Nokia Test Automation Tool Dynamic Link Library\0"
+            VALUE "FileVersion", "4.0\0"
+            VALUE "InternalName", "STAT\0"
+            VALUE "LegalCopyright", "Copyright (C) 2005-2009 Nokia Corporation\0"
+            VALUE "LegalTrademarks", "STAT\0"
+            VALUE "OriginalFilename", "STAT.DLL\0"
+            VALUE "PrivateBuild", "\0"
+            VALUE "ProductName", "Nokia Test Automation Tool Dynamic Link Library\0"
+            VALUE "ProductVersion", "4.0\0"
+            VALUE "SpecialBuild", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "..\\inc\\resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif //_WIN32\r\n"
+    "#include ""..\\res\\stat.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "../res/stat.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/src/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/stat.def	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,45 @@
+LIBRARY stat
+EXPORTS
+	Version
+	GetError
+	GetErrorText
+	SetConnectionLogging
+	CloseConnectionLogging
+	Connect
+	ConnectMT
+	Disconnect
+	SetCommandDelay
+	SetCommandLogging
+	SetImageVerification
+	GetCommandCount
+	GetCurrentCommandNumber
+	OpenScriptFile
+	RunScript
+	SendRawCommand
+	SendCommandFile
+	StopProcessing
+	GetSnapshot
+	GetTEFSharedData
+	GetReceivedData
+
+	StdVersion 							= _StdVersion@0
+	StdSetConnectionLogging				= _StdSetConnectionLogging@4
+	StdCloseConnectionLogging			= _StdCloseConnectionLogging@0
+	StdDisconnect 						= _StdDisconnect@4
+	StdGetCommandCount					= _StdGetCommandCount@12
+	StdGetCurrentCommandNumber			= _StdGetCurrentCommandNumber@8
+	StdOpenScriptFile					= _StdOpenScriptFile@12
+	StdRunScript						= _StdRunScript@8
+	StdSendRawCommand 					= _StdSendRawCommand@12
+	StdSendCommandFile 					= _StdSendCommandFile@12
+	StdStopProcessing					= _StdStopProcessing@4
+	StdGetError							= _StdGetError@4
+	StdGetErrorText						= _StdGetErrorText@8
+	StdConnect							= _StdConnect@16
+	StdConnectMT						= _StdConnectMT@8
+	StdSetCommandDelay					= _StdSetCommandDelay@8
+	StdSetCommandLogging				= _StdSetCommandLogging@28
+	StdSetImageVerification 			= _StdSetImageVerification@16
+	StdGetSnapshot						= _StdGetSnapshot@20
+	StdGetTEFSharedData					= _StdGetTEFSharedData@4
+	StdGetReceivedData					= _StdGetReceivedData@4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/statd.def	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,45 @@
+LIBRARY statd
+EXPORTS
+	Version
+	GetError
+	GetErrorText
+	SetConnectionLogging
+	CloseConnectionLogging
+	Connect
+	ConnectMT
+	Disconnect
+	SetCommandDelay
+	SetCommandLogging
+	SetImageVerification
+	GetCommandCount
+	GetCurrentCommandNumber
+	OpenScriptFile
+	RunScript
+	SendRawCommand
+	SendCommandFile
+	StopProcessing
+	GetSnapshot
+	GetTEFSharedData
+	GetReceivedData
+
+	StdVersion 							= _StdVersion@0
+	StdSetConnectionLogging				= _StdSetConnectionLogging@4
+	StdCloseConnectionLogging			= _StdCloseConnectionLogging@0
+	StdDisconnect 						= _StdDisconnect@4
+	StdGetCommandCount					= _StdGetCommandCount@12
+	StdGetCurrentCommandNumber			= _StdGetCurrentCommandNumber@8
+	StdOpenScriptFile					= _StdOpenScriptFile@12
+	StdRunScript						= _StdRunScript@8
+	StdSendRawCommand 					= _StdSendRawCommand@12
+	StdSendCommandFile 					= _StdSendCommandFile@12
+	StdStopProcessing					= _StdStopProcessing@4
+	StdGetError							= _StdGetError@4
+	StdGetErrorText						= _StdGetErrorText@8
+	StdConnect							= _StdConnect@16
+	StdConnectMT						= _StdConnectMT@8
+	StdSetCommandDelay					= _StdSetCommandDelay@8
+	StdSetCommandLogging				= _StdSetCommandLogging@28
+	StdSetImageVerification 			= _StdSetImageVerification@16
+	StdGetSnapshot						= _StdGetSnapshot@20
+	StdGetTEFSharedData					= _StdGetTEFSharedData@4
+	StdGetReceivedData					= _StdGetReceivedData@4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/statdll.dep	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,10 @@
+# Microsoft Developer Studio Generated Dependency File, included by STATdll.mak
+
+.\src\statdll.rc : \
+	".\inc\resource.h"\
+	".\res\stat.rc2"\
+	
+
+.\src\StdAfx.cpp : \
+	".\inc\StdAfx.h"\
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/statdll.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,142 @@
+# Microsoft Developer Studio Project File - Name="STATDll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=STATDll - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "STATdll.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "STATdll.mak" CFG="STATDll - Win32 Release"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "STATDll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "STATDll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "STATDll"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "STATDll - Win32 Release"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "\epoc32\tools\stat"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /Yu".\inc\stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /D "_WINDLL" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo /o"Release/STATdll.bsc"
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 Ws2_32.lib ..\..\lib\Stat.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /nodefaultlib:"libcmtd.lib" /def:".\stat.def" /out:"..\..\bin\STAT.dll" /implib:"..\..\lib\STATDll.lib" /OPT:NOREF
+# Begin Special Build Tool
+ProjDir=.
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copying browse data...
+PostBuild_Cmds=$(ProjDir)\UpdateDll.bat	copy release\statdll.bsc \epoc32\tools\stat\statdll.bsc
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "STATDll - Win32 Debug"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /Yu".\inc\stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\inc" /I "..\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /D "_WINDLL" /D "_USRDLL" /FR /FD /GZ /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Ws2_32.lib ..\..\lib\Statd.lib /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /def:".\statd.def" /out:"..\..\bin\STATd.dll" /implib:"..\..\lib\STATDlld.lib" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "STATDll - Win32 Release"
+# Name "STATDll - Win32 Debug"
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\stat.def
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\statd.def
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\STATdll.dep
+# End Source File
+# Begin Source File
+
+SOURCE=.\STATdll.mak
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statdll.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/statdll.mak	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,231 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on STATdll.dsp
+!IF "$(CFG)" == ""
+CFG=STATDll - Win32 Release
+!MESSAGE No configuration specified. Defaulting to STATDll - Win32 Release.
+!ENDIF 
+
+!IF "$(CFG)" != "STATDll - Win32 Release" && "$(CFG)" != "STATDll - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "STATdll.mak" CFG="STATDll - Win32 Release"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "STATDll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "STATDll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+!ERROR An invalid configuration is specified.
+!ENDIF 
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "STATDll - Win32 Release"
+
+OUTDIR=\epoc32\tools\stat
+INTDIR=.\Release
+
+ALL : "..\..\bin\STAT.dll" ".\Release\STATdll.pch" ".\Release\STATdll.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\STATdll.pch"
+	-@erase "$(INTDIR)\statdll.res"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "..\..\bin\STAT.dll"
+	-@erase "..\..\lib\STATDll.exp"
+	-@erase "..\..\lib\STATDll.lib"
+	-@erase ".\Release\STATdll.bsc"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+"$(INTDIR)" :
+    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /D "_WINDLL" /D "_USRDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATdll.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\statdll.res" /d "NDEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"Release/STATdll.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\StdAfx.sbr"
+
+".\Release\STATdll.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=Ws2_32.lib ..\..\lib\Stat.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /nodefaultlib:"libcmtd.lib" /def:".\stat.def" /out:"..\..\bin\STAT.dll" /implib:"..\..\lib\STATDll.lib" /OPT:NOREF 
+LINK32_OBJS= \
+	"$(INTDIR)\StdAfx.obj" \
+	"$(INTDIR)\statdll.res"
+
+"..\..\bin\STAT.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+ProjDir=.
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copying browse data...
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+$(DS_POSTBUILD_DEP) : "..\..\bin\STAT.dll" ".\Release\STATdll.pch" ".\Release\STATdll.bsc"
+   .\UpdateDll.bat
+	copy release\statdll.bsc \epoc32\tools\stat\statdll.bsc
+	echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ELSEIF  "$(CFG)" == "STATDll - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "..\..\bin\STATd.dll" "$(OUTDIR)\STATdll.pch" "$(OUTDIR)\STATdll.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\STATdll.pch"
+	-@erase "$(INTDIR)\statdll.res"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(OUTDIR)\STATd.pdb"
+	-@erase "$(OUTDIR)\STATdll.bsc"
+	-@erase "..\..\bin\STATd.dll"
+	-@erase "..\..\lib\STATDlld.exp"
+	-@erase "..\..\lib\STATDlld.lib"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\inc" /I "..\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /D "_WINDLL" /D "_USRDLL" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\statdll.res" /d "_DEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\STATdll.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\STATdll.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=Ws2_32.lib ..\..\lib\Statd.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\STATd.pdb" /debug /machine:I386 /def:".\statd.def" /out:"..\..\bin\STATd.dll" /implib:"..\..\lib\STATDlld.lib" /pdbtype:sept 
+LINK32_OBJS= \
+	"$(INTDIR)\StdAfx.obj" \
+	"$(INTDIR)\statdll.res"
+
+"..\..\bin\STATd.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("STATdll.dep")
+!INCLUDE "STATdll.dep"
+!ELSE 
+!MESSAGE Warning: cannot find "STATdll.dep"
+!ENDIF 
+!ENDIF 
+
+
+!IF "$(CFG)" == "STATDll - Win32 Release" || "$(CFG)" == "STATDll - Win32 Debug"
+SOURCE=.\src\statdll.rc
+
+!IF  "$(CFG)" == "STATDll - Win32 Release"
+
+
+"$(INTDIR)\statdll.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x809 /fo"$(INTDIR)\statdll.res" /i "src" /d "NDEBUG" $(SOURCE)
+
+
+!ELSEIF  "$(CFG)" == "STATDll - Win32 Debug"
+
+
+"$(INTDIR)\statdll.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x809 /fo"$(INTDIR)\statdll.res" /i "src" /d "_DEBUG" $(SOURCE)
+
+
+!ENDIF 
+
+SOURCE=.\src\StdAfx.cpp
+
+!IF  "$(CFG)" == "STATDll - Win32 Release"
+
+CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /D "_WINDLL" /D "_USRDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATdll.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\STATdll.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "STATDll - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\inc" /I "..\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /D "_WINDLL" /D "_USRDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATdll.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\STATdll.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+
+!ENDIF 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/dll/updatedll.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+@rem
+@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@@rem
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+
+rem which accompanies this distribution, and is available
+
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+copy ..\lib\inc\statexp.h \epoc32\tools\stat\headers\statexp.h
+copy ..\lib\inc\stat.h \epoc32\tools\stat\headers\stat.h
+
+copy ..\..\lib\statdll.lib \epoc32\tools\stat\stat.lib
+copy ..\..\lib\statdll.exp \epoc32\tools\stat\stat.exp
+
+copy ..\..\bin\stat.dll \epoc32\tools\stat\stat.dll
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+
+TOOLS
+
+PRJ_MMPFILES
+// Extension Makefile
+makefile statlib.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/group/statlib.mk	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+# which accompanies this distribution, and is available
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# Typically C:\apps\MSVC6\VC98\Bin
+COMPILER=nmake
+
+# Called with
+#
+# $(PLATFORM) = TOOLS
+# $(CFG)      = DEB, REL
+
+BLD	:  
+	@echo BLD called with $(PLATFORM)$(CFG)
+
+# release version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-mkdir "$(EPOCROOT)epoc32\tools\STAT"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (LIB)
+	"$(COMPILER)" /A /NOLOGO /f "statlib.mak" CFG="STATLib - Win32 Release"
+	
+	echo ** STAT LIB (RELEASE) compiled successfully
+
+!endif
+
+# debug version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (LIB)
+	"$(COMPILER)" /A /NOLOGO /f "statlib.mak" CFG="STATLib - Win32 Debug"
+	
+	echo ** STAT LIB (DEBUG) compiled successfully
+
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-rmdir "..\Release" /q /s
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+	-rmdir "..\Debug" /q /s
+!endif
+
+RELEASABLES :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	@echo $(EPOCROOT)epoc32\tools\STAT\stat.lib
+!endif
+
+SAVESPACE : BLD
+
+MAKMAKE LIB CLEANLIB RESOURCE FREEZE FINAL : 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/creporter.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Header file for functions for the Reporter logging mechanism*
+*/
+
+
+
+
+#ifndef CPO_REPORT_HPP
+#define CPO_REPORT_HPP
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+// Comment out this line for release version ...
+// #define RPT_DEBUG_PROG
+
+#define CPO_GARBAGE_CHAR               0xDB    // decimal value ( 3339 )
+#define CPO_TRUE                       1
+#define CPO_FALSE                      0
+#define CPO_BOOL                        unsigned int
+
+#define BITFIELD                       unsigned long
+#define CPO_MAX_FILENAME_LEN           255
+
+// status values
+#define CPO_CLEAR                      0
+#define CPO_CONNECTED                  1  // component currently initiated
+#define CPO_ACTIVATED                  2  // component currently active
+
+
+// Max values for messages
+#define RPT_OPEN_MSG_LEN               2048
+#define RPT_MAX_MSG_LEN                  256
+#define RPT_MAX_PROGRAM_LEN              15
+
+// Max values for message file contents
+#define RPT_MAX_LIST_ENTRIES           1000
+#define RPT_MAX_LINE_LEN                200
+
+// Bit values for the current state 
+#define RPT_CLEAR                         0
+#define RPT_FILE                          4   // Output to file
+#define RPT_STDOUT                        8   // Output to stdout
+#define RPT_STDERR                       16   // Output to stderr
+#define RPT_DEBUG_ON                     32   // Are debug messages processed ?
+#define RPT_OUTPUT_MASK        ( RPT_FILE | \
+                               RPT_STDOUT | \
+                               RPT_STDERR )
+
+// Bit values for the prefix mask
+#define RPT_MSG_ONLY                      1
+#define RPT_MSG_TYPE                      2
+#define RPT_APPNAME                       4
+#define RPT_DATE                          8
+#define RPT_TIME                         16
+#define RPT_ALL            ( RPT_MSG_TYPE | \
+                              RPT_APPNAME | \
+                                 RPT_DATE | \
+                                 RPT_TIME )
+
+// Different kinds of Reporter messages
+#define RPT_DEBUG                       'D'
+#define RPT_INFO                        'I'
+#define RPT_WARN                        'W'
+#define RPT_ERROR                       'E'
+#define RPT_MSG                         'M'
+#define RPT_HEADER                      'H'
+#define RPT_TEXT                        'T'
+
+class Reporter
+{
+public:
+  Reporter ();
+   ~Reporter ();
+    
+  // connection methods
+  CPO_BOOL  init ( const char * appName,
+                             const BITFIELD prefixMask,
+                             const BITFIELD destination );
+  CPO_BOOL  init ( const char * appName,
+                             const BITFIELD prefixMask,
+                             const BITFIELD destination,
+                             const char * path );
+  CPO_BOOL  init ( const char * appName,
+                             const BITFIELD prefixMask,
+                             const BITFIELD destination,
+                             const char * path,
+                             const char * file,
+							 const unsigned long ulOpenAttributes = OPEN_ALWAYS);
+
+  CPO_BOOL  connected ( void );
+  CPO_BOOL  active ( void );
+  void     debugON ( void );
+  void     debugOFF ( void );
+  void     sleep ( void );
+  void     wake ( void );
+  void     load ( const char * filename );
+  void     kill ( void );
+  
+  // display methods
+  void     dash ( void );
+  void     star ( void );
+  void     blank ( void );
+  void     header ( char * message, ... );
+  void     msg ( char * message, ... );
+  void     debug ( char * message, ... );
+  void     info  ( char * message, ... );
+  void     warn  ( char * message, ... );
+  void     error ( char * message, ... );
+  char *   text ( char * message, ... );
+
+  void     header ( int code, ... );
+  void     msg ( int code, ... );
+  void     debug ( int code, ... );
+  void     info  ( int code, ... );
+  void     warn  ( int code, ... );
+  void     error ( int code, ... );
+  char *   text ( int code, ... );
+
+private:
+
+  // variables
+  va_list pCurrent;                               // pointer to arg list
+  BITFIELD state;                                 // current state flags
+  BITFIELD prefix;                                // info to prepend to message
+  HANDLE hFile;		                              // handle to log file
+  char filename [ CPO_MAX_FILENAME_LEN + 1 ];     // name of log file
+  char progname [ RPT_MAX_PROGRAM_LEN + 1 ];      // name of calling process
+  int fileRead;                                   // valid list entries ?
+  char *messageList [ RPT_MAX_LIST_ENTRIES ]; // list of messages
+  char buffer [ RPT_OPEN_MSG_LEN ];               // common temp buffer
+
+  // methods
+  void        prepare ( void );
+  CPO_BOOL     setup ( const char * appName, 
+                       const BITFIELD prefixMask,
+					   const unsigned long ulOpenAttributes = OPEN_ALWAYS );
+  void        actOnCode ( int code, char messType );
+  void        extractName ( char * file, const char * path, 
+                                       const int length );
+  void        generateFilename ( char * validName, 
+                                            const char * appName );
+  int         openFile ( unsigned long ulOpenAttributes = OPEN_ALWAYS );
+  void        closeFile ( void );
+  void        validateText ( char * text, const int length );
+  void        addHeaderInfo ( char * prefixInfo );
+  void        addLogInfo ( char * prefixInfo, const char msgType );
+  void        buildMessage ( const char * message, 
+                                        const char messType );
+  void        writeToStream ( const char * str );
+  void        readMessageFile ( const char * file );
+  void        addMessage ( void );
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/cstatdataformatconverter.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef CSTATDataFormatConverter_H
+#define CSTATDataFormatConverter_H
+
+#include <oaidl.h>
+#include <statcommon.h>
+#include "CSTATLogfile.h"
+
+const long int KWriteOnceFileStoreUid=268435511;
+const long int KMultiBitmapFileImageUid=268435522;
+const long int KMultiBitmapFileImageChecksum=1194943545;
+
+enum TBitmapColor
+{
+	EMonochromeBitmap,
+	EColorBitmap
+};
+
+enum TBitmapfileCompression
+{
+	ENoBitmapCompression=0,
+	EByteRLECompression,
+	ETwelveBitRLECompression,
+	ESixteenBitRLECompression,
+	ETwentyFourBitRLECompression
+};
+
+struct SEpocBitmapHeader
+{
+	long iBitmapSize;
+	long iStructSize;
+	long iWidthInPixels;
+	long iHeightInPixels;
+	long iWidthInTwips;
+	long iHeightInTwips;
+	long iBitsPerPixel;
+	TBitmapColor iColor;
+	long iPaletteEntries;	// always 0 in current implementations
+	TBitmapfileCompression iCompression;
+};
+
+#include <pshpack2.h>
+struct TRgbTriple
+{
+	unsigned char rgbtBlue;
+	unsigned char rgbtGreen;
+	unsigned char rgbtRed;
+};
+#include <poppack.h>
+
+struct TRgbQuad
+{
+	unsigned char iBlue;
+	unsigned char iGreen;
+	unsigned char iRed;
+	unsigned char iReserved;
+};
+
+class TRgb
+{
+public:
+	TRgb();
+	TRgb(long unsigned int val);
+	TRgb(int aRed,int aGreen,int aBlue);
+	TRgb &operator=(const TRgb& aColor);
+	int operator==(const TRgb& aColor);
+	int Difference(const TRgb& col) const;
+	int Gray2() const;
+	int Gray4() const;
+	int Gray16() const;
+	int Gray256() const;
+	int Color16() const;
+	int Color256() const;
+	int Color4K() const;
+	int Color64K() const;
+	long int Color16M() const;
+	static TRgb Gray2(int aGray2);
+	static TRgb Gray4(int aGray4);
+	static TRgb Gray16(int aGray16);
+	static TRgb Gray256(int aGray256);
+	static TRgb Color16(int aColor16);
+	static TRgb Color256(int aColor256);
+	static TRgb Color4K(int aColor64K);
+	static TRgb Color64K(int aColor64K);
+	static TRgb Color16M(long int aColor16M);
+public:
+	unsigned char iRed;
+	unsigned char iGreen;
+	unsigned char iBlue;
+	unsigned char iSpare;
+};
+
+class CSTATDataFormatConverter : public VARIANT
+{
+	public:
+		CSTATDataFormatConverter(CSTATLogFile *pLog);
+		virtual ~CSTATDataFormatConverter();
+		bool ConvertStringToUnicode(CString& data);
+		int ConvertScreenShot(CString &mbmdirectory, CString &destptr);
+		void GetScreenshotData(TBitmapFileHeader **ppFHeader, TBitmapInfoHeader **ppBMPHeader, char **ppBits, unsigned long *pSize)
+		{
+			*ppFHeader = &fileheader;
+			*ppBMPHeader = &bmpHeader;
+			*ppBits = bmpBits;
+			*pSize = lDataSize;
+		}
+
+		bool bWriteToFile;						// flag to write bitmap out to disk or not
+
+	private:
+		void EnsureBufSize(int size);
+		int LoadBitmap(CString &file);
+		int SaveBitmap(CString &file);
+		bool ExpandByteRLEData(char* aDest,int aDestSize,char* aSrce,int aSrceSize);
+		bool ExpandTwelveBitRLEData(char* aDest,int aDestSizeInBytes,char* aSrce,int aSrceSizeInBytes);
+		bool ExpandSixteenBitRLEData(char* aDest,int aDestSizeInBytes,char* aSrce,int aSrceSizeInBytes);
+		bool ExpandTwentyFourBitRLEData(char* aDest,int aDestSizeInBytes,char* aSrce,int aSrceSizeInBytes);
+		TRgb GetPixel(int aXCoord,int aYCoord);
+		int ByteWidth(int aPixelWidth,int aBitsPerPixel);
+
+		CSTATLogFile *pLogFile;					// pointer to our logging class
+		BYTE* m_index;							// command buffer access
+		int m_bufsize;							// command buffer size
+
+		SEpocBitmapHeader iPbmHeader;			// EPOC screenshot header info
+		char* pPbmBits;							// EPOC screenshot data
+		TBitmapFileHeader fileheader;			// converted screenshot header info
+		TBitmapInfoHeader bmpHeader;			// converted screenshot bitmap info
+		char* bmpBits;							// converted screenshot data
+		unsigned long lDataSize;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/cstatimageverify.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef CSTATImageVerify_H
+#define CSTATImageVerify_H
+
+#include "CSTATLogFile.h"
+
+#define VERIFY_MAX_IMAGES	250
+
+//class to be used to store names of reference images in time ascending order
+//Verification will then take place according to current location in the array
+class CSTATReferenceImages
+{
+	public :
+		CString completefilenamepath;
+		ULONGLONG lCreationTime;
+};
+
+class CSTATImageVerify
+{
+	public :
+		CSTATImageVerify(CSTATLogFile *pLog);
+		~CSTATImageVerify();
+
+		int Initialise(const CString& path);							// sets the location of the reference images
+		int CopyReferenceImages(LPTSTR refimagelocation);	// copy new ref images
+		int DeleteReferenceImages();						// remove existing reference images
+		int EnableVerification(int fudge);					//will load ref file names into array and sort them accroding to creation time
+		int VerifyImage(CString& lastscreenshot);			//image verification function (blitting)
+		int IsActive() { return iImageCount; }				// are we using verification?
+		void DisableVerification() { iImageCount = 0; }		// turn it off
+
+	private :
+		bool ImagesRemaining() { return (lastrefimageloaded < iImageCount); }
+		bool LoadNewImage(CString& newimage);				//image loading for reference and new images
+		bool LoadRefImage();								// ...
+		
+		CSTATReferenceImages refimagearray[250];			// array of images to verify against
+		int lastrefimageloaded;								// position of last image
+		int margin;											// percentage error allowed on images
+		int iImageCount;									// total images for verification
+		CString referenceimagedir;							// location of reference images
+		CSTATLogFile *pLogFile;								// pointer to our logging class
+
+		CPalette m_Palette;
+		unsigned char *m_pDib, *m_pDib2, *m_pDibBits, *m_pDibBits2;
+		DWORD m_dwDibSize, m_dwDibSize2;
+		BITMAPINFOHEADER *m_pBIH, *m_pBIH2;
+		RGBQUAD *m_pPalette, *m_pPalette2;
+		int m_nPaletteEntries, m_nPaletteEntries2;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/cstatlogfile.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef CSTATLogFile_H
+#define CSTATLogFile_H
+
+#include <afxmt.h>
+#include "CSTATReturnCodes.h"
+#include "MessageReporter.h"
+
+class CSTATLogFile
+{
+public :
+	// logging
+	CSTATLogFile();
+	~CSTATLogFile();
+	int CreateLogFile(const CString& newlogfilename,const CString& defaultPath ,const char* prefix, bool append, bool bMessages, bool bFile);
+	void SetMessageReporter(MessageReporter *const messageReporter);
+	void WriteTimeToLog();					// write the current date/time to log
+	void Write(char *szText, ...);			// write standard text to log
+	void Write(CString cBuf);				// write CString text to log
+	void CloseLogFile();					// close
+
+	// messaging
+	int Set(const char* newtext);													// write CString to storage buffer and to log
+	int Set(int iMsgCode, const char* newtext = NULL, bool bMsgBox = false, bool bScrshot = false);
+	// bool Get(CString &msg, CString &newtext, bool &bMsgBox, bool &bScrshot);  // get log message from storage buffer
+	const char* Text(int iMsgCode) { return ReturnCodes.GetRetMsg(iMsgCode); }    // get error text
+
+	int ToAnsi(LPCTSTR szUnicode, LPSTR szBuffer, int nBufLen);
+	LPCTSTR ToUnicode(const char *string);
+
+private :
+	char* FormatText(const char* message);
+
+	CSTATReturnCodes ReturnCodes;			// return codes for use within STAT
+
+	// logging
+	CFile logfile;							// log file object
+	CString Logfilename;					// the name of our log file
+	char szLogPrefix[51];					// holds a prefix to all log messages
+
+	MessageReporter	*iMessageReporter;
+
+	// messages
+	bool bWriteToScreen;					// flag for writing to dialog box
+	bool bWriteToFile;						// flag for writing to log file
+	bool bMessage;							// flag for waiting message
+	bool bMessageBox;						// display in a MessageBox
+	bool bScreenshot;						// display associated screenshot bitmap
+	CString message;						// basic message
+	CString text;							// associated error text
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/cstatreturncodes.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,214 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef CSTATReturnCodes_H
+#define CSTATReturnCodes_H
+
+#define GENERAL_FAILURE						0
+#define EXPIRED_VERSION						1
+#define TIME_DELAY_INIT_FAILURE				2
+#define DLL_INIT_FAILURE					3
+#define OPEN_SCRIPT_FILE_FAILURE			4
+#define INTERPRET_COMMANDS_FAILURE			5
+#define COMMANDDECODER_INIT_FAILURE			6
+#define DATACONVERTER_INIT_FAILURE			7
+#define DIRMANAGER_INIT_FAILURE				8
+#define RETCODES_INIT_FAILURE				9
+#define COMLIB_INIT_FAILURE					10
+#define COPYING								11
+#define REFDIR_FOUND						12
+#define ITS_OK								13
+#define TIME_DELAY_INIT_SUCCESS				14
+#define ALMOST								15
+#define ERROR_REGISTRY						16
+#define LOG_DIR_FAILURE						17
+#define LOG_DIR_FOUND						18
+#define LOG_DIR_DUPLICATE_FOUND				19
+#define LOG_DIR_CREATE_REG_FAILURE			20
+#define LOG_DIR_CREATE_FAILURE				21
+#define LOG_DIR_INFORM						22
+#define LOG_DIR_REG_FAILURE					23
+#define LOG_FILE_FAILURE					24
+#define LOG_FILE_OK							25
+#define OPEN_SCRIPT_FILE_OK					26
+#define OPEN_SCRIPT_FILE_COMPLETE_FAILURE	27
+#define CLEANUP_FAILURE						28
+#define END_COMMAND_FAILURE					29
+#define END_SCRIPT							30
+#define BEGIN_COMMAND_FAILURE				31
+#define CONNECT_FIRST						32
+#define COM_MEM_FAILURE						33
+#define CONNECTED							34
+#define INVALID_HASH_COMMAND				35
+#define NEW_IMAGE_DIRECTORY					36
+#define CURRENT_IMAGE_DIRECTORY_OK			37
+#define NO_END_TO_COMMENT_COMMAND			38
+#define COMMENT_COMMAND						39
+#define INVALID_COMMENT_COMMAND				40
+#define LOGFILE_INIT_FAILURE				41
+#define PAUSE_TIME							42
+#define DEVINFO_RECEIVED					43
+#define DEVINFO_TRYING						44
+#define DEVINFO_FAILURE						45
+#define MACHINEINFO_RECEIVED				46
+#define MACHINEINFO_TRYING					47
+#define MACHINEINFO_FAILURE					48
+#define KEYDATA_INFORM						49
+#define KEYDATA_OK							50
+#define KEYDATA_FAILURE						51
+#define SYSKEYDATA_INFORM					52
+#define SYSKEYDATA_OK						53
+#define SYSKEYDATA_FAILURE					54
+#define COMBOKEYDATA_INFORM					55
+#define COMBOKEYDATA_OK						56
+#define COMBOKEYDATA_FAILURE				57
+#define COMBOKEYDATA_INVALID				58
+#define APPSTART_INFORM						59
+#define APPSTART_OK							60
+#define APPSTART_FAILURE					61
+#define FILEOPEN_INFORM						62
+#define FILEOPEN_OK							63
+#define FILEOPEN_FAILURE					64
+#define FILETRANSFER_INFORM					65
+#define FILETRANSFER_OK						66
+#define FILETRANSFER_FAILURE				67
+#define E_ENGINEOBJECTFAILURE				68
+#define FILERETRIEVE_INFORM					69
+#define FILERETRIEVE_OK						70
+#define FILERETRIEVE_FAILURE				71
+#define TOUCHSCREEN_INFORM					72
+#define TOUCHSCREEN_OK						73
+#define TOUCHSCREEN_FAILURE					74
+#define APPCLOSE_INFORM						75
+#define APPCLOSE_OK							76
+#define APPCLOSE_FAILURE					77
+#define ESHELL_START_INFORM					78
+#define ESHELL_START_OK						79
+#define ESHELL_START_FAILURE				80
+#define ESHELL_STOP_INFORM					81
+#define ESHELL_STOP_OK						82
+#define ESHELL_STOP_FAILURE					83
+#define SCREENSHOT_INFORM					84 
+#define SCREENSHOT_OK						85
+#define SCREENSHOT_FAILURE					86
+#define SCREENSHOT_MOVETOPC_INFORM			87
+#define SCREENSHOT_MOVETOPC_OK				88
+#define SCREENSHOT_MOVETOPC_FAILURE			89
+#define SCREENSHOT_CONVERSION_FAILURE		90
+#define SCREENSHOT_CONVERSION_OK			91
+#define IMAGEVERIFY_INIT_FAILURE			92
+#define DELETEIMAGES_FAILURE				93
+#define REFIMAGELOAD_OK						94
+#define REFIMAGELOAD_FAILURE				95
+#define REFIMAGELOAD_FAILURE_LIMIT			96
+#define NEWIMAGELOAD_OK						97
+#define NEWIMAGELOAD_FAILURE				98
+#define VERIFICATION_PASS					99
+#define VERIFICATION_FAILURE				100
+#define START_VERIFICATION					101
+#define CREATE_DIR_FAILURE					102
+#define NO_BITMAPS							103
+#define TOUCHSCREEN_INVALID_COMMAND			104
+#define KEYHOLD_INFORM						105
+#define KEYHOLD_OK							106
+#define KEYHOLD_FAILURE						107
+#define KEYHOLD_INVALID_COMMAND				108
+#define KEYHOLD_STRING_INVALID				109
+#define ERR_INVALID_IMAGE_DIRECTORY			110
+#define ERR_FILE_COPY_FAILED				111
+#define E_BADPLATFORM						112
+#define E_BADFILESYSINTERFACE				113
+#define E_BADREQUESTINTERFACE				114
+#define E_ENGINECONNECTFAILURE				115
+#define E_REQUESTOBJECTFAILURE				116
+#define E_REQUESTINITFAILURE				117
+#define E_NOREFERENCEIMAGES					118
+#define FILE_DELETE_INFORM					119
+#define FILE_DELETE_OK						120
+#define FILE_DELETE_FAILURE					121
+#define CREATE_FOLDER_INFORM				122
+#define CREATE_FOLDER_OK					123
+#define CREATE_FOLDER_FAILURE				124
+#define REMOVE_FOLDER_INFORM				125
+#define REMOVE_FOLDER_OK					126
+#define REMOVE_FOLDER_FAILURE				127
+#define E_NOT_SUPPORTED						128
+#define E_USERCANCEL						129
+#define E_OUTOFMEM							130
+#define INVALID_COMMAND_FORMAT				131
+#define E_MESSAGE_INIT_FAILURE				132
+#define E_BADFORMAT							133
+#define E_FILE_OPEN_READ_FAILED				134
+#define E_NOIMAGEFOLDER						135
+#define E_NOIMAGESTOCONVERT					136
+#define E_BITMAPLOADFAILED					137
+#define E_BITMAPSAVEFAILED					138
+#define E_BADWRITE							139
+#define E_FILE_OPEN_WRITE_FAILED			140
+#define E_BADCOMPRESSION					141
+#define E_SCREENSHOT_LEFTOVERFILES			142
+#define CONVERTINGIMAGE						143
+#define TO									144
+#define FILERETRIEVE_COPY					145
+#define E_INVALIDCMDSYNTAX					146
+#define READINGIMAGE						147
+#define SCREENSHOT_INTOMEMORY_OK			148
+#define E_COMMANDRETRY						149
+#define E_COMMANDFAILED						150
+#define E_CONNECTIONFAILED					151
+#define E_WRITEFAILED						152
+#define E_READFAILED						153
+#define NO_DATA_AT_PORT						154
+#define E_TOOMUCHTIME						155
+#define E_TOOMANYERRORS						156
+#define E_BADID								157
+#define E_BADFILENAME						158
+#define E_BADNUMBERBYTES					159
+#define E_OUTOFMEMNOTSUPPORTED				160
+#define RETRIEVETO							161
+#define E_INVALIDMESSAGETYPE				162
+#define E_RESYNCCOMMAND						163
+#define E_NOFILEDATA						164
+#define E_SOCKETSTARTUP						165
+#define E_SOCKETCREATE						166
+#define E_SOCKETCONNECT						167
+#define E_SOCKETBIND						168
+#define E_SOCKETLISTEN						169
+#define E_SOCKETHOSTNAME					170
+#define E_SOCKETSEND						171
+#define E_SOCKETRECV						172
+#define E_PROCESSTERMINATED					173
+#define E_SOCKETCLOSE						174
+#define E_SOCKETSHUTDOWN					175
+#define USE_EXISTING_IMAGES					176
+#define E_NOCONNECTION						177
+
+
+class CSTATReturnCodes
+{
+	public:
+		CSTATReturnCodes();
+		const char* GetRetMsg(const DWORD codenum);
+
+	private:
+		DWORD iMaxCodes;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/messagereporter.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if ! defined (MESSAGEREPORTER_H_356396A9_4FCA_44bc_90BB_A4826F5F82EA)
+#define MESSAGEREPORTER_H_356396A9_4FCA_44bc_90BB_A4826F5F82EA
+
+class MessageReporter
+{
+protected:
+	MessageReporter(void);
+	~MessageReporter();
+
+public:
+	// Override in a derived class to call-back when a log message
+	// is available.
+	virtual void OnMessage( const char* message, const char* text,
+										bool bMsgBox, bool bScrshot ) = 0;
+};
+
+inline MessageReporter::MessageReporter( void )
+{
+	;
+}
+
+inline MessageReporter::~MessageReporter()
+{
+	;
+}
+
+#endif // ! defined (MESSAGEREPORTER_H_356396A9_4FCA_44bc_90BB_A4826F5F82EA)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/messagetypes.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#if !defined(__MESSAGETYPES_H__)
+#define __MESSAGETYPES_H__
+
+// messages sent by PC
+enum TSTATPCMsg 
+	{
+		ESTATPCMsgHello,
+		ESTATPCMsgStartApp,
+		ESTATPCMsgOpenFile,
+		ESTATPCMsgScreenCapture,
+		ESTATPCMsgStopApp,
+		ESTATPCMsgIconPress,
+		ESTATPCMsgReady,
+		ESTATPCMsgSelectDrive,
+		ESTATPCMsgSelectLanguage,
+		ESTATPCMsgSelectQuestion,
+		ESTATPCMsgSelectOptions,
+		ESTATPCMsgSelectDelDepend,
+		ESTATPCMsgSelectText,
+		ESTATPCMsgSelectAbortRetrySkip,
+		ESTATPCMsgSelectInUse,
+		ESTATPCMsgSelectSecWarning,
+		ESTATPCMsgTypeText,
+		ESTATPCMsgTypeSysText,
+		ESTATPCMsgTypeCombinationText,
+		ESTATPCMsgEShell,
+		ESTATPCMsgKeyHold,
+		ESTATPCMsgDeleteFile,
+		ESTATPCMsgCreateFolder,
+		ESTATPCMsgRemoveFolder,
+		ESTATPCMsgGoodBye,
+		ESTATPCMsgInvalidCommand
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/scriptprogressmonitor.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#if ! defined (SCRIPTPROGRESSMONITOR_H_523472E4_3321_4496_9000_3D8878255FD3)
+#define SCRIPTPROGRESSMONITOR_H_523472E4_3321_4496_9000_3D8878255FD3
+
+class ScriptProgressMonitor
+{
+protected:
+	ScriptProgressMonitor(void);
+	~ScriptProgressMonitor();
+
+public:
+	// Override in a derived class to call-back when a single
+	// command of the current script is processed.
+	virtual void OnCompleteCommand( int command ) = 0;
+
+	// Override in a derived class to call-back when the
+	// whole of current script is processed.
+	virtual void OnCompleteScript( int scriptExitCode ) = 0;
+};
+
+inline ScriptProgressMonitor::ScriptProgressMonitor( void )
+{
+	;
+}
+
+inline ScriptProgressMonitor::~ScriptProgressMonitor()
+{
+	;
+}
+
+#endif // ! defined (SCRIPTPROGRESSMONITOR_H_523472E4_3321_4496_9000_3D8878255FD3)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/stat.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STAT_H
+#define STAT_H
+
+// possible connection types supported
+typedef enum STATConnectType
+{
+	SymbianInvalid	 = 0,	
+	SymbianSocket    = 1,
+	SymbianSerial    = 2,
+	SymbianInfrared	 = 3,
+	SymbianBluetooth = 4,
+	SymbianUsb = 5,
+} STATCONNECTTYPE;
+
+// possible logging levels
+typedef enum STATLogLevel
+{
+	ETerse   = 0,
+	ENormal  = 1,
+	EVerbose = 2
+} STATLOGLEVEL;
+
+// bitmap access structures
+#include <pshpack2.h>
+struct TBitmapFileHeader
+{
+	unsigned short bfType;
+	unsigned long bfSize;
+	unsigned short bfReserved1;
+	unsigned short bfReserved2;
+	unsigned long bfOffBits;
+};
+#include <poppack.h>
+
+struct TBitmapInfoHeader
+{
+	unsigned long biSize;
+	long biWidth;
+	long biHeight;
+	unsigned short biPlanes;
+	unsigned short biBitCount;
+	unsigned long biCompression;
+	unsigned long biSizeImage;
+	long biXPelsPerMeter;
+	long biYPelsPerMeter;
+	unsigned long biClrUsed;
+	unsigned long biClrImportant;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statbitmap.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,374 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+const long unsigned int color16array[16]= {
+	0x00000000,	0x00555555,	0x00000080,	0x00008080,
+	0x00008000,	0x000000ff,	0x0000ffff,	0x0000ff00,
+	0x00ff00ff,	0x00ff0000,	0x00ffff00,	0x00800080,
+	0x00800000,	0x00808000,0x00aaaaaa,	0x00ffffff	};
+
+const unsigned char color16inverse[512] = {
+	0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x05, 0x05,	0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x05, 0x05,
+	0x04, 0x04, 0x01, 0x03, 0x03, 0x03, 0x05, 0x05,	0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x05,
+	0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06,	0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x06, 0x06,
+	0x07, 0x07, 0x07, 0x03, 0x03, 0x06, 0x06, 0x06,	0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06, 0x06,
+	0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x05, 0x05,	0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x05, 0x05,
+	0x04, 0x01, 0x01, 0x01, 0x03, 0x03, 0x05, 0x05,	0x04, 0x04, 0x01, 0x03, 0x03, 0x03, 0x03, 0x05,
+	0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06,	0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x06, 0x06,
+	0x07, 0x07, 0x07, 0x03, 0x03, 0x06, 0x06, 0x06,	0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06, 0x06,
+	0x0c, 0x0c, 0x01, 0x0b, 0x0b, 0x0b, 0x05, 0x05,	0x0c, 0x01, 0x01, 0x01, 0x0b, 0x0b, 0x05, 0x05,
+	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05,	0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05,
+	0x0d, 0x0d, 0x01, 0x01, 0x03, 0x0e, 0x0e, 0x06,	0x0d, 0x0d, 0x01, 0x01, 0x0e, 0x0e, 0x0e, 0x06,
+	0x07, 0x07, 0x01, 0x01, 0x0e, 0x0e, 0x06, 0x06,	0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06, 0x06,
+	0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x05,	0x0c, 0x0c, 0x01, 0x0b, 0x0b, 0x0b, 0x0b, 0x05,
+	0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05,	0x0d, 0x0d, 0x01, 0x01, 0x01, 0x0e, 0x0e, 0x0e,
+	0x0d, 0x0d, 0x01, 0x01, 0x0e, 0x0e, 0x0e, 0x0e,	0x0d, 0x0d, 0x01, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,
+	0x0d, 0x0d, 0x01, 0x0e, 0x0e, 0x0e, 0x0e, 0x06,	0x07, 0x07, 0x07, 0x0e, 0x0e, 0x0e, 0x06, 0x06,
+	0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x08,	0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x08,
+	0x0d, 0x0d, 0x01, 0x01, 0x0b, 0x0e, 0x0e, 0x08,	0x0d, 0x0d, 0x01, 0x01, 0x0e, 0x0e, 0x0e, 0x0e,
+	0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,	0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,
+	0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0f,	0x0a, 0x0a, 0x0a, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f,
+	0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b, 0x08, 0x08,	0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b, 0x08, 0x08,
+	0x0d, 0x0d, 0x01, 0x01, 0x0e, 0x0e, 0x0e, 0x08,	0x0d, 0x0d, 0x01, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,
+	0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,	0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,
+	0x0a, 0x0a, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0f,	0x0a, 0x0a, 0x0a, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f,
+	0x09, 0x09, 0x09, 0x0b, 0x0b, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0b, 0x0b, 0x08, 0x08, 0x08,
+	0x09, 0x09, 0x01, 0x01, 0x0e, 0x0e, 0x08, 0x08,	0x0d, 0x0d, 0x01, 0x0e, 0x0e, 0x0e, 0x0e, 0x08,
+	0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0f,	0x0a, 0x0a, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0f,
+	0x0a, 0x0a, 0x0a, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f,	0x0a, 0x0a, 0x0a, 0x0a, 0x0f, 0x0f, 0x0f, 0x0f,
+	0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08,
+	0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0e, 0x0e, 0x0e, 0x08, 0x08,
+	0x0a, 0x0a, 0x0a, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f,	0x0a, 0x0a, 0x0a, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f,
+	0x0a, 0x0a, 0x0a, 0x0a, 0x0f, 0x0f, 0x0f, 0x0f,	0x0a, 0x0a, 0x0a, 0x0a, 0x0f, 0x0f, 0x0f, 0x0f
+	};
+
+const long unsigned int color256array[256] = {
+	0x00000000,	0x00000033,	0x00000066,	0x00000099,	0x000000cc,	0x000000ff,
+	0x00003300,	0x00003333,	0x00003366,	0x00003399,	0x000033cc,	0x000033ff,
+	0x00006600,	0x00006633,	0x00006666,	0x00006699,	0x000066cc,	0x000066ff,
+	0x00009900,	0x00009933,	0x00009966,	0x00009999,	0x000099cc,	0x000099ff,
+	0x0000cc00,	0x0000cc33,	0x0000cc66,	0x0000cc99,	0x0000cccc,	0x0000ccff,
+	0x0000ff00,	0x0000ff33,	0x0000ff66,	0x0000ff99,	0x0000ffcc,	0x0000ffff,
+
+	0x00330000,	0x00330033,	0x00330066,	0x00330099,	0x003300cc,	0x003300ff,
+	0x00333300,	0x00333333,	0x00333366,	0x00333399,	0x003333cc,	0x003333ff,
+	0x00336600,	0x00336633,	0x00336666,	0x00336699,	0x003366cc,	0x003366ff,
+	0x00339900,	0x00339933,	0x00339966,	0x00339999,	0x003399cc,	0x003399ff,
+	0x0033cc00,	0x0033cc33,	0x0033cc66,	0x0033cc99,	0x0033cccc,	0x0033ccff,
+	0x0033ff00,	0x0033ff33,	0x0033ff66,	0x0033ff99,	0x0033ffcc,	0x0033ffff,
+
+	0x00660000,	0x00660033,	0x00660066,	0x00660099,	0x006600cc,	0x006600ff,
+	0x00663300,	0x00663333,	0x00663366,	0x00663399,	0x006633cc,	0x006633ff,
+	0x00666600,	0x00666633,	0x00666666,	0x00666699,	0x006666cc,	0x006666ff,
+	0x00669900,	0x00669933,	0x00669966,	0x00669999,	0x006699cc,	0x006699ff,
+	0x0066cc00,	0x0066cc33,	0x0066cc66,	0x0066cc99,	0x0066cccc,	0x0066ccff,
+	0x0066ff00,	0x0066ff33,	0x0066ff66,	0x0066ff99,	0x0066ffcc,	0x0066ffff,
+
+	0x00111111, 0x00222222, 0x00444444, 0x00555555, 0x00777777,
+	0x00000011, 0x00000022, 0x00000044, 0x00000055, 0x00000077,
+	0x00001100,	0x00002200,	0x00004400,	0x00005500,	0x00007700,
+	0x00110000,	0x00220000,	0x00440000,	0x00550000,	0x00770000,
+
+	0x00880000,	0x00aa0000,	0x00bb0000,	0x00dd0000,	0x00ee0000,
+	0x00008800,	0x0000aa00,	0x0000bb00,	0x0000dd00,	0x0000ee00,
+	0x00000088,	0x000000aa,	0x000000bb,	0x000000dd,	0x000000ee,
+	0x00888888, 0x00aaaaaa, 0x00bbbbbb, 0x00dddddd, 0x00eeeeee,
+
+	0x00990000,	0x00990033,	0x00990066,	0x00990099,	0x009900cc,	0x009900ff,
+	0x00993300,	0x00993333,	0x00993366,	0x00993399,	0x009933cc,	0x009933ff,
+	0x00996600,	0x00996633,	0x00996666,	0x00996699,	0x009966cc,	0x009966ff,
+	0x00999900,	0x00999933,	0x00999966,	0x00999999,	0x009999cc,	0x009999ff,
+	0x0099cc00,	0x0099cc33,	0x0099cc66,	0x0099cc99,	0x0099cccc,	0x0099ccff,
+	0x0099ff00,	0x0099ff33,	0x0099ff66,	0x0099ff99,	0x0099ffcc,	0x0099ffff,
+
+	0x00cc0000,	0x00cc0033,	0x00cc0066,	0x00cc0099,	0x00cc00cc,	0x00cc00ff,
+	0x00cc3300,	0x00cc3333,	0x00cc3366,	0x00cc3399,	0x00cc33cc,	0x00cc33ff,
+	0x00cc6600,	0x00cc6633,	0x00cc6666,	0x00cc6699,	0x00cc66cc,	0x00cc66ff,
+	0x00cc9900,	0x00cc9933,	0x00cc9966,	0x00cc9999,	0x00cc99cc,	0x00cc99ff,
+	0x00cccc00,	0x00cccc33,	0x00cccc66,	0x00cccc99,	0x00cccccc,	0x00ccccff,
+	0x00ccff00,	0x00ccff33,	0x00ccff66,	0x00ccff99,	0x00ccffcc,	0x00ccffff,
+
+	0x00ff0000,	0x00ff0033,	0x00ff0066,	0x00ff0099,	0x00ff00cc,	0x00ff00ff,
+	0x00ff3300,	0x00ff3333,	0x00ff3366,	0x00ff3399,	0x00ff33cc,	0x00ff33ff,
+	0x00ff6600,	0x00ff6633,	0x00ff6666,	0x00ff6699,	0x00ff66cc,	0x00ff66ff,
+	0x00ff9900,	0x00ff9933,	0x00ff9966,	0x00ff9999,	0x00ff99cc,	0x00ff99ff,
+	0x00ffcc00,	0x00ffcc33,	0x00ffcc66,	0x00ffcc99,	0x00ffcccc,	0x00ffccff,
+	0x00ffff00,	0x00ffff33,	0x00ffff66,	0x00ffff99,	0x00ffffcc,	0x00ffffff
+	};
+
+const unsigned char color256inverse[4096] = {
+	0x00, 0x71, 0x72, 0x01, 0x73, 0x74, 0x02, 0x75,	0x8a, 0x03, 0x8b, 0x8c, 0x04, 0x8d, 0x8e, 0x05,
+	0x76, 0x6c, 0x72, 0x01, 0x73, 0x74, 0x02, 0x75,	0x8a, 0x03, 0x8b, 0x8c, 0x04, 0x8d, 0x8e, 0x05,
+	0x77, 0x77, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b,
+	0x06, 0x06, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b,
+	0x78, 0x78, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b,
+	0x79, 0x79, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e,	0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11,
+	0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e,	0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11,
+	0x7a, 0x7a, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e,	0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11,
+	0x85, 0x85, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14,	0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17,
+	0x12, 0x12, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14,	0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17,
+	0x86, 0x86, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14,	0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17,
+	0x87, 0x87, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a,	0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d,
+	0x18, 0x18, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a,	0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d,
+	0x88, 0x88, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a,	0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d,
+	0x89, 0x89, 0x1f, 0x1f, 0x1f, 0x20, 0x20, 0x20,	0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23,
+	0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x20, 0x20, 0x20,	0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23,
+	0x7b, 0x6c, 0x72, 0x01, 0x73, 0x74, 0x02, 0x75,	0x8a, 0x03, 0x8b, 0x8c, 0x04, 0x8d, 0x8e, 0x05,
+	0x6c, 0x6c, 0x6c, 0x01, 0x73, 0x74, 0x02, 0x75,	0x8a, 0x03, 0x8b, 0x8c, 0x04, 0x8d, 0x8e, 0x05,
+	0x77, 0x6c, 0x6d, 0x07, 0x07, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b,
+	0x06, 0x06, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b,
+	0x78, 0x78, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08,	0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b,
+	0x79, 0x79, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e,	0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11,
+	0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e,	0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11,
+	0x7a, 0x7a, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e,	0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11,
+	0x85, 0x85, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14,	0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17,
+	0x12, 0x12, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14,	0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17,
+	0x86, 0x86, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14,	0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17,
+	0x87, 0x87, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a,	0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d,
+	0x18, 0x18, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a,	0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d,
+	0x88, 0x88, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a,	0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d,
+	0x89, 0x89, 0x1f, 0x1f, 0x1f, 0x20, 0x20, 0x20,	0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23,
+	0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x20, 0x20, 0x20,	0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23,
+	0x7c, 0x7c, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26,	0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29,
+	0x7c, 0x6c, 0x6d, 0x25, 0x25, 0x26, 0x26, 0x26,	0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29,
+	0x2a, 0x6d, 0x6d, 0x6d, 0x6d, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x2a, 0x2a, 0x6d, 0x2b, 0x2b, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x2a, 0x2a, 0x6d, 0x2b, 0x6e, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44,	0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47,
+	0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44,	0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47,
+	0x24, 0x24, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26,	0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29,
+	0x24, 0x24, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26,	0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29,
+	0x2a, 0x2a, 0x6d, 0x2b, 0x2b, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x2a, 0x2a, 0x2b, 0x2b, 0x2b, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x2a, 0x2a, 0x2b, 0x2b, 0x6e, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44,	0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47,
+	0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44,	0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47,
+	0x7d, 0x7d, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26,	0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29,
+	0x7d, 0x7d, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26,	0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29,
+	0x2a, 0x2a, 0x6d, 0x2b, 0x6e, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x2a, 0x2a, 0x2b, 0x2b, 0x6e, 0x2c, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x2a, 0x2a, 0x6e, 0x6e, 0x6e, 0x6e, 0x2c, 0x2c,	0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f,
+	0x30, 0x30, 0x31, 0x31, 0x6e, 0x6f, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32,	0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38,	0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e,	0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41,
+	0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44,	0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47,
+	0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44,	0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47,
+	0x7e, 0x7e, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a,	0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4c, 0x4d, 0x4d,
+	0x7e, 0x7e, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a,	0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4c, 0x4d, 0x4d,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x6e, 0x6f, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x54, 0x54, 0x55, 0x55, 0x6f, 0x6f, 0x6f, 0x6f,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x6f, 0x56, 0x56,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x6f, 0x56, 0x70,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68,	0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b,
+	0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68,	0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b,
+	0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a,	0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4c, 0x4d, 0x4d,
+	0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a,	0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4c, 0x4d, 0x4d,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x6f, 0x56, 0x56,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x56,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x70,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68,	0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b,
+	0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68,	0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b,
+	0x7f, 0x7f, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a,	0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4c, 0x4d, 0x4d,
+	0x7f, 0x7f, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a,	0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4c, 0x4d, 0x4d,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50,	0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x6f, 0x56, 0x70,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x70,	0x57, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x54, 0x54, 0x55, 0x55, 0x55, 0x70, 0x70, 0x70,	0x70, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x70,	0x8f, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c,	0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62,	0x63, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65,
+	0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68,	0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b,
+	0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68,	0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b,
+	0x80, 0x80, 0x80, 0x95, 0x95, 0x96, 0x96, 0x96,	0x97, 0x97, 0x97, 0x98, 0x98, 0x98, 0x99, 0x99,
+	0x80, 0x80, 0x80, 0x95, 0x95, 0x96, 0x96, 0x96,	0x97, 0x97, 0x97, 0x98, 0x98, 0x98, 0x99, 0x99,
+	0x80, 0x80, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0x6f, 0xa2, 0x70,	0x8f, 0xa3, 0xa3, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0x70,	0x8f, 0xa3, 0xa3, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0x70, 0x70, 0x70,	0x8f, 0x8f, 0x8f, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0x8f, 0x8f, 0x8f,	0x8f, 0x8f, 0x8f, 0x8f, 0xaa, 0xaa, 0xab, 0xab,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0x8f,	0x8f, 0xa9, 0xa9, 0xaa, 0xaa, 0xaa, 0xab, 0xab,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0x8f,	0x8f, 0xa9, 0x90, 0x90, 0xaa, 0xaa, 0xab, 0xab,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0x8f, 0xaf, 0x90, 0x91, 0xb0, 0xb0, 0xb1, 0xb1,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0xaf, 0xaf, 0xaf, 0xb0, 0xb0, 0xb0, 0xb1, 0xb1,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0xaf, 0xaf, 0xaf, 0xb0, 0xb0, 0xb0, 0xb1, 0xb1,
+	0xb2, 0xb2, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4,	0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7,
+	0xb2, 0xb2, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4,	0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7,
+	0x94, 0x94, 0x95, 0x95, 0x95, 0x96, 0x96, 0x96,	0x97, 0x97, 0x97, 0x98, 0x98, 0x98, 0x99, 0x99,
+	0x94, 0x94, 0x95, 0x95, 0x95, 0x96, 0x96, 0x96,	0x97, 0x97, 0x97, 0x98, 0x98, 0x98, 0x99, 0x99,
+	0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2,	0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2,	0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0x70,	0x8f, 0xa3, 0xa3, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0x8f,	0x8f, 0xa9, 0xa9, 0xaa, 0xaa, 0xaa, 0xab, 0xab,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0xa8,	0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xaa, 0xab, 0xab,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0xa8,	0xa9, 0xa9, 0x90, 0x90, 0xaa, 0xaa, 0xab, 0xab,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0xaf, 0xaf, 0x90, 0x91, 0xb0, 0xb0, 0xb1, 0xb1,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0xaf, 0xaf, 0xaf, 0xb0, 0xb0, 0xb0, 0xb1, 0xb1,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0xaf, 0xaf, 0xaf, 0xb0, 0xb0, 0xb0, 0xb1, 0xb1,
+	0xb2, 0xb2, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4,	0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7,
+	0xb2, 0xb2, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4,	0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7,
+	0x81, 0x81, 0x81, 0x95, 0x95, 0x96, 0x96, 0x96,	0x97, 0x97, 0x97, 0x98, 0x98, 0x98, 0x99, 0x99,
+	0x81, 0x81, 0x81, 0x95, 0x95, 0x96, 0x96, 0x96,	0x97, 0x97, 0x97, 0x98, 0x98, 0x98, 0x99, 0x99,
+	0x81, 0x81, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c,	0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2,	0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2,	0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0x70,	0x8f, 0xa3, 0x90, 0xa4, 0xa4, 0xa4, 0xa5, 0xa5,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0x8f,	0x8f, 0xa9, 0x90, 0x90, 0xaa, 0xaa, 0xab, 0xab,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0xa8,	0xa9, 0xa9, 0x90, 0x90, 0xaa, 0xaa, 0xab, 0xab,
+	0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0x90,	0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xab, 0xab,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0x90, 0x90, 0x90, 0x91, 0x91, 0x91, 0xb1, 0xb1,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0xaf, 0xaf, 0x90, 0x91, 0xb0, 0xb0, 0xb1, 0xb1,
+	0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae,	0xaf, 0xaf, 0x90, 0x91, 0xb0, 0x92, 0xb1, 0xb1,
+	0xb2, 0xb2, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4,	0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7,
+	0xb2, 0xb2, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4,	0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7,
+	0x82, 0x82, 0x82, 0xb9, 0xb9, 0xba, 0xba, 0xba,	0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd,
+	0x82, 0x82, 0x82, 0xb9, 0xb9, 0xba, 0xba, 0xba,	0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd,
+	0x82, 0x82, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0x8f, 0xcd, 0x90, 0x91, 0xce, 0xce, 0xcf, 0xcf,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0xcd, 0xcd, 0x90, 0x91, 0xce, 0xce, 0xcf, 0xcf,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0x90, 0x90, 0x90, 0x91, 0x91, 0x91, 0xcf, 0xcf,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0xd5,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0x91, 0x91, 0xd4, 0xd4, 0xd5, 0xd5,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0x91, 0x91, 0xd4, 0x92, 0x92, 0xd5,
+	0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, 0xd8,	0xd9, 0xd9, 0xd9, 0x91, 0xda, 0x92, 0x93, 0xdb,
+	0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, 0xd8,	0xd9, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xdb, 0xdb,
+	0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xba, 0xba, 0xba,	0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd,
+	0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xba, 0xba, 0xba,	0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd,
+	0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xcf, 0xcf,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xcf, 0xcf,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0xcd, 0xcd, 0x90, 0x91, 0xce, 0xce, 0xcf, 0xcf,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0x91, 0x91, 0xd4, 0xd4, 0xd5, 0xd5,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0xd3, 0xd4, 0xd4, 0xd4, 0xd5, 0xd5,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0xd3, 0xd4, 0xd4, 0x92, 0x92, 0xd5,
+	0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, 0xd8,	0xd9, 0xd9, 0xd9, 0xda, 0xda, 0x92, 0x93, 0xdb,
+	0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, 0xd8,	0xd9, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xdb, 0xdb,
+	0x83, 0x83, 0x83, 0xb9, 0xb9, 0xba, 0xba, 0xba,	0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd,
+	0x83, 0x83, 0x83, 0xb9, 0xb9, 0xba, 0xba, 0xba,	0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd,
+	0x83, 0x83, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0,	0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6,	0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xcf, 0xcf,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xcf, 0xcf,
+	0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc,	0xcd, 0xcd, 0x90, 0x91, 0xce, 0x92, 0xcf, 0xcf,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0x91, 0x91, 0xd4, 0x92, 0x92, 0xd5,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0xd3, 0xd4, 0xd4, 0x92, 0x92, 0xd5,
+	0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2,	0xd3, 0xd3, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92,
+	0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, 0xd8,	0xd9, 0xd9, 0xd9, 0x92, 0x92, 0x92, 0x93, 0x93,
+	0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, 0xd8,	0xd9, 0xd9, 0xd9, 0xda, 0xda, 0x92, 0x93, 0xdb,
+	0x84, 0x84, 0x84, 0xdd, 0xdd, 0xde, 0xde, 0xde,	0xdf, 0xdf, 0xdf, 0xe0, 0xe0, 0xe0, 0xe1, 0xe1,
+	0x84, 0x84, 0x84, 0xdd, 0xdd, 0xde, 0xde, 0xde,	0xdf, 0xdf, 0xdf, 0xe0, 0xe0, 0xe0, 0xe1, 0xe1,
+	0x84, 0x84, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4,	0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7,
+	0xe2, 0xe2, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4,	0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7,
+	0xe2, 0xe2, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4,	0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7,
+	0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea,	0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xed, 0xed,
+	0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea,	0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xed, 0xed,
+	0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea,	0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xed, 0xed,
+	0xee, 0xee, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0,	0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3,
+	0xee, 0xee, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0,	0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3,
+	0xee, 0xee, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0,	0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3,
+	0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6,	0xf7, 0xf7, 0xf7, 0x91, 0xf8, 0x92, 0x93, 0xf9,
+	0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6,	0xf7, 0xf7, 0xf7, 0xf8, 0xf8, 0x92, 0x93, 0xf9,
+	0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6,	0xf7, 0xf7, 0xf7, 0x92, 0x92, 0x92, 0x93, 0x93,
+	0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfc,	0xfd, 0xfd, 0xfd, 0x93, 0x93, 0x93, 0x93, 0x93,
+	0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfc,	0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0x93, 0x93, 0xff,
+	0xdc, 0xdc, 0xdd, 0xdd, 0xdd, 0xde, 0xde, 0xde,	0xdf, 0xdf, 0xdf, 0xe0, 0xe0, 0xe0, 0xe1, 0xe1,
+	0xdc, 0xdc, 0xdd, 0xdd, 0xdd, 0xde, 0xde, 0xde,	0xdf, 0xdf, 0xdf, 0xe0, 0xe0, 0xe0, 0xe1, 0xe1,
+	0xe2, 0xe2, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4,	0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7,
+	0xe2, 0xe2, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4,	0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7,
+	0xe2, 0xe2, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4,	0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7,
+	0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea,	0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xed, 0xed,
+	0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea,	0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xed, 0xed,
+	0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea,	0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xed, 0xed,
+	0xee, 0xee, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0,	0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3,
+	0xee, 0xee, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0,	0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3,
+	0xee, 0xee, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0,	0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3,
+	0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6,	0xf7, 0xf7, 0xf7, 0xf8, 0xf8, 0xf8, 0xf9, 0xf9,
+	0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6,	0xf7, 0xf7, 0xf7, 0xf8, 0xf8, 0xf8, 0xf9, 0xf9,
+	0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6,	0xf7, 0xf7, 0xf7, 0xf8, 0xf8, 0x92, 0x93, 0xf9,
+	0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfc,	0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0x93, 0x93, 0xff,
+	0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfc,	0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0xfe, 0xff, 0xff
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statcommon.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATCOMMON_H
+#define STATCOMMON_H
+
+// external definitions
+#include "stat.h"
+
+// current version - edit this for version updates to DLL
+#define STAT_VERSION_MAJOR "3"
+#define STAT_VERSION_MINOR "4"
+#define STAT_VERSION_PATCH "1001"
+
+
+// amount of time a thread sleeps between each processing cycle
+#define STAT_THREAD_SLEEP_TIME 5
+
+#define STAT_INI_NAME _T("stat.ini")
+
+
+#define STAT_WORKINGPATH_VALUE		_T("c:\\apps\\stat\\Work")
+
+#define STAT_LOGFILEPATH_VALUE		_T("c:\\apps\\stat\\LogFiles")
+
+#define STAT_SCRIPTFILEPATH_VALUE	_T("c:\\apps\\stat\\Scripts")
+
+#define STAT_INSTALLPATH_VALUE	_T("c:\\apps\\stat")
+
+
+// STAT Desktop and DLL Tester registry settings
+#define ST_TEST_KEY						_T("Settings")
+#define ST_ITERATIONS					_T("Iterations")
+
+#define ST_DELAY						_T("Delay")
+#define ST_DELAY_VALUE					_T("")
+
+#define ST_LOGFILE						_T("Logfile")
+#define ST_CMDFILE						_T("Commandfile")
+#define ST_RAWCMD						_T("RawCommand")
+
+#define ST_FUDGE						_T("FudgeFactor")
+#define ST_FUDGE_VALUE					_T("0")
+
+#define ST_SNAPSHOT						_T("Snapshot")
+
+#define ST_REFDIR						_T("RefDir")
+#define ST_REFDIR_VALUE					_T("")
+
+#define ST_ADDRESS						_T("Address")
+#define ST_RAWCMD						_T("RawCommand")
+#define ST_LINK							_T("LinkIndex")
+#define ST_CONNECTIONIDX				_T("ConnectionIndex")
+#define ST_CONNECTIONDLL				_T("ConnectionDLL")
+
+#define ST_CONNECTION					_T("Connection")
+#define ST_CONNECTION_VALUE				_T("SymbianSerial:COM2")
+
+#define ST_PLATFORM						_T("PlatformIndex")
+#define ST_VERIFYREMOVEIMAGES			_T("VerifyRemoveImages")
+
+#define ST_VERIFYIMAGE					_T("VerifyImage")
+#define ST_VERIFYIMAGE_VALUE			0
+
+#define ST_LOGTOFILE					_T("LogToFile")
+#define ST_LOGTOFILE_VALUE				0
+
+
+#define ST_SCRIPT						_T("Script")
+#define ST_SCRIPT_VALUE					_T("<b><s><e>")
+
+#define ST_CUST_LOGFILE					_T("CustomLogFile")
+#define ST_CUST_LOGFILE_VALUE			_T("")
+
+#define ST_APPEND						_T("Append")
+#define ST_APPEND_VALUE					0
+
+#define ST_CHKRAWCMD					_T("ChkRawCmd")
+#define ST_CHKCMDFILE					_T("ChkCmdFile")
+#define ST_CHKVERIF						_T("ChkVerif")
+#define ST_CHKSNAP						_T("ChkSnap")
+#define ST_CHKLOGTOFILE					_T("ChkLogtofile")
+
+#define ST_WORKINGPATH					_T("WorkingPath")
+#define ST_WORKINGPATH_VALUE			_T("c:\\apps\\stat\\Work")
+
+#define ST_LOGFILEPATH					_T("LogFilePath")
+#define ST_LOGFILEPATH_VALUE			_T("c:\\apps\\stat\\LogFiles")
+
+#define ST_SCRIPTFILEPATH				_T("ScriptFilePath")
+#define ST_SCRIPTFILEPATH_VALUE			_T("c:\\apps\\stat\\Scripts")
+
+#define ST_INSTALLPATH				_T("InstallPath")
+#define ST_INSTALLPATH_VALUE			_T("c:\\apps\\stat")
+
+// STAT Service registry settings
+#define ST_CONTROLLER_LIST				_T("Controllers")
+#define ST_CONNECTION_LIST				_T("Connections")
+#define ST_TRANSPORT_TYPE				_T("ServiceTransport")
+#define ST_TRANSPORT_PORT				_T("ServicePort")
+#define ST_SCRIPTLOCATION				_T("ScriptLocation")
+#define ST_LOGLOCATION					_T("LogLocation")
+
+// STAT Service command types
+typedef enum STATCommandType
+{
+	SymbianScript		= 1,
+	SymbianError		= 2,
+	SymbianDeviceInfo	= 3,
+	SymbianServiceLogs	= 4
+} STATCOMMANDTYPE;
+
+// default socket communication ports
+#define ST_DEFAULTDEVICEPORT			3000
+#define ST_DEFAULTSERVICEPORT			3001
+#define ST_MAX_CONNECTION_COUNT			25
+
+// script execution states
+typedef enum StatState
+{
+	STAT_RUN,
+	STAT_PAUSE,
+	STAT_STOP
+} STAT_STATE;
+
+#define STAT_APPNAME		"STAT DLL"
+#define STAT_SERVICENAME	"STAT Service"
+
+//not used
+// logging defaults
+//#define STAT_APPNAME	"STAT DLL"
+//#define STAT_LOGDIR		"C:\\"
+//#define STAT_LOGFILE	"stat_output.log"
+
+// debug file returned from remote device
+//#define STAT_DEBUGFILE	"C:\\stat_debug.log"
+
+#define MAX_LOG_MSG_LEN		1024
+#define MAX_ERROR_MSG_LEN	256
+
+#ifdef UNICODE
+#define MAX_UNICODE_LEN		2048
+#endif
+
+// communications
+typedef struct STATCommand
+{
+	unsigned long cIdentifier;	// used as 'char' but 'unsigned long' to cater for word boundaries
+//	char cIdentifier;
+	unsigned long ulLength;
+} STATCOMMAND;
+
+// special command identifiers
+#define STAT_FAILURE		'*'
+#define STAT_RESYNCID		'?'
+#define STAT_REFRESH		'Q'
+#define STAT_BEGIN			'B'
+#define STAT_END			'E'
+#define STAT_REBOOT			'|'
+
+
+// size of data transmissions
+// This is moved to a header file common to desktop 
+// and device side code.
+
+// timeouts on no data
+#define STAT_MAXTIME		240000	// max time to process a command
+#define STAT_RETRYDELAY		330		// delay between checking the port when no data
+
+// timeouts on transmission errors
+#define STAT_MAX_ERRORLEN	1024	// max length of error text
+#define STAT_MAXERRORS		7		// max errors allowed in a single command
+
+// old #defines used in connect transport
+#define STAT_ERRORDELAY		3000	// delay on an error
+#define STAT_MAXRETRIES		10		// max retries on error
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statcomms.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATCOMMS_H
+#define STATCOMMS_H
+
+#include "statcommon.h"
+#include "stattransport.h"
+
+class STATComms : public CSTATTransport
+{
+public:
+	STATComms();
+	~STATComms();
+
+	int SetTransport(const STATCONNECTTYPE eConnect);
+	int Initialise(void);
+	int Connect(const char *pAddress = NULL);
+	int Send(const char cIdentifier, const char *pData = NULL, const unsigned long ulLength = 0);
+	int Receive(char *cIdentifier, char **ppData = NULL, unsigned long *pLength = NULL);
+	int Disconnect(void);
+	int Release(void);
+	char * Error(void);
+	unsigned int GetMaxPacketSize(void) const;	// Get the maximum size
+												// of each data paacket we transfer
+												// in one go.
+												// Sub-classes will override this
+												// if tey support breaking up of
+												// packets.
+
+private:
+	CSTATTransport *pTransport;			// pointer to the selected transport
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// STATComms::GetMaxPacketSize
+// Our implementation checks if we have a transport component
+// and delegates to that object or returns the base class
+// implementation.
+inline unsigned int STATComms::GetMaxPacketSize(void) const
+{
+	return (pTransport->GetMaxPacketSize());
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statengine.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATENGINE_H
+#define STATENGINE_H
+
+#include <statcommon.h>
+#include <CSTATLogfile.h>
+#include <CSTATDataFormatConverter.h>
+#include <CSTATImageVerify.h>
+#include <statcomms.h>
+#include <statscriptdecoder.h>
+#include <ini.h>
+
+#include "ScriptProgressMonitor.h"
+#include <winsock2.h>
+
+#define DOTTED_LINE "--------------------------------------------------------------------------------------------------------------"
+
+class CSTATEngine
+{
+public:
+	CSTATEngine();
+	~CSTATEngine();
+	int Initialise(const STATCONNECTTYPE eConnect, const char *pAddress = NULL);	// start everything
+	void SetCommandDelay(int iMillisecondDelay);					// set delay between commands
+	int SetLogging(const CString& logfilename, const char* prefix, 
+			bool append, bool bMessages, bool bFile, MessageReporter *const aMessageReporter);	// set a log message
+	int GetCommandCount(CString file, int *pCount);					// get amount of commands in script
+	int OpenScriptFile(CString file, bool bIsFile);					// load the script
+	int RunScript(ScriptProgressMonitor *const monitor);			// run the script
+	int Release(void);												// release all resources
+	const char* GetErrorText(int iCode) { return pLog->Text(iCode); }	// convert an error code into a text message
+	const char* GetReceivedData(void);
+	int GetDeviceReturnCode() { return iDeviceCode; }				// get device return code
+	void SetMultithreaded(bool bState = true) { bMultithreaded = bState; }	// set multithreaded check
+
+	static LPTSTR ToUnicode(const char *string);					// convert ANSI to Unicode
+	static char * ToAnsi(LPCTSTR string);							// convert Unicode to ANSI
+	static void CreateAllDirectories(CString &fullpath);			// create sub folders
+	
+	CSTATDataFormatConverter *pConverter;							// bitmap conversion
+	CSTATImageVerify *pImageVerify;									// image verification
+	STAT_STATE eStopProcessing;										// flag to pause/stop processing
+	int iCurrentCommand;											// index of the current command being processed
+	char *pDeviceInfo;												// pointer to device information
+	char *iTEFSharedData;											// pointer to TEF shared data information
+	int iMaxTimeLimit;												// max time to wait for a command
+
+private:
+
+	
+
+	void SetScreenshotDirectory(const char *szScreenshotDir)	{ cScreenshotDirectory = szScreenshotDir; }
+	int SetScreenshotDefaultDirectory(void);
+	int SendCommand(CSTATScriptCommand *pCommand, CSTATScriptCommand **ppRecvCommand);
+	int SendSingleCommand(CSTATScriptCommand *pCommand, CSTATScriptCommand **ppRecvCommand);
+	int ReadTransferFile(const char *pFile, CSTATScriptCommand *pCommand);
+	int SaveTransferFile(const char *pFile, char *pContents, unsigned long ulLength);
+	void LogDetails(const char *prefix, CSTATScriptCommand *pCommand);
+	int ConvertAndSaveScreeenshot(CString &file, const char *pContents, const unsigned long ulLength);
+	int SaveTheFile(CString path, const char *pContents, const unsigned long ulLength);
+	void Message(const char *pMsg, ...);
+	bool StopProcessing();
+	bool RemoveLeftoverMBMFiles();
+	void AppendCommandToSTATLog(char *heading, char *log, unsigned long length);
+	void StoreData( char* aData, unsigned long aLength, char*& aOutputPtr );
+	CString GetConnection(STATCONNECTTYPE eConnectType);
+
+	CSTATScriptCommand oRecvCommand;		// last received command
+	STATComms *pComms;						// transport
+	CSTATScriptDecoder *pDecoder;			// script decoder
+	CSTATLogFile *pLog;						// log file
+	CString cScreenshotDirectory;			// screenshot location
+	int iDelay;								// command delay
+	const int minimumdelay;
+	const int maximumdelay;
+	char szAddress[256];					// the name of the port we are using
+	STATCONNECTTYPE eConnectType;			// current connection type
+	int iDeviceCode;						// device return code
+	bool bMultithreaded;					// flag if operating in multithreaded environment
+	CStatIniFile statIniFile;					// ini file reader
+	CString receivedData;
+
+	void WriteToSocket(const char *data, int *length);
+	void ReadFromSocket(char *data, int *length);
+	int SetSocket(const char *ip, const int port);
+	int ReleaseSocket();
+
+	bool settingSocket;
+	SOCKET dataSocket;
+	WSADATA wsaData;
+
+};
+
+inline const char* CSTATEngine::GetReceivedData(void)
+{
+	return ( receivedData.operator LPCTSTR( ) );
+}
+
+
+
+//----------------------------------------------------------------------------
+// our thread-safe mechanism - this must be defined, initialised and destroyed by
+// the code using CSTATEngine.  See STATMember.cpp for an example
+extern CRITICAL_SECTION CriticalSection;
+//----------------------------------------------------------------------------
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statexp.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,234 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATEXP30_H
+#define STATEXP30_H
+
+#ifndef STAT_EXPORT
+#define STAT_EXPORT // __declspec(dllexport) // exports now defined in .DEF file
+#endif
+
+#include <Stat.h>
+#include <StatCommon.h>
+#include <ScriptProgressMonitor.h>
+#include <MessageReporter.h>
+#include <CStatReturnCodes.h>
+
+// These functions are exported by name from the STAT DLL and should
+// be linked with dynamically by any application that needs them.
+
+const char	ProcVersion[] =	{ "StdVersion" };
+typedef	const char* (WINAPI *PROC_VERSION)( void );
+
+const char	ProcGetError[] =	{ "StdGetError" };
+typedef	const char* (WINAPI *PROC_GETERROR)( int handle );
+
+const char	ProcGetErrorText[] =	{ "StdGetErrorText" };
+typedef	const char* (WINAPI *PROC_GETERRORTEXT)( int handle, int errorCode );
+
+const char	ProcGetTEFSharedData[] =	{ "StdGetTEFSharedData" };
+typedef	const char* (WINAPI *PROC_GETTEFSHAREDDATA)( int handle );
+
+const char	ProcSetConnectionLogging[] =	{ "StdSetConnectionLogging" };
+typedef	int (WINAPI *PROC_SETCONNECTIONLOGGING)( const char *logPath );
+
+const char	ProcCloseConnectionLogging[] =	{ "StdCloseConnectionLogging" };
+typedef	void (WINAPI *PROC_CLOSECONNECTIONLOGGING)( void );
+
+const char	ProcConnect[] =	{ "StdConnect" };
+typedef	int (WINAPI *PROC_CONNECT)(	STATCONNECTTYPE iConnectType,
+									const char * pszPlatformType,
+									void *,
+									void *);
+
+const char	ProcDisconnect[] =	{ "StdDisconnect" };
+typedef	int (WINAPI *PROC_DISCONNECT)( int handle );
+
+const char	ProcSetCommandDelay[] =	{ "StdSetCommandDelay" };
+typedef	int (WINAPI *PROC_SETCOMMANDDELAY)(	int handle,
+											unsigned int iMillisecondDelay
+											);
+
+const char	ProcSetCommandLogging[] =	{ "StdSetCommandLogging" };
+typedef	int (WINAPI *PROC_SETCOMMANDLOGGING)(	int handle, 
+												const char *pszLogPath,
+												MessageReporter *const aMessageReporter,
+												STATLOGLEVEL iLevel,
+												bool bAppend,
+												void*,
+												void*
+												);
+
+const char	ProcSetImageVerification[] =	{ "StdSetImageVerification" };
+typedef	int (WINAPI *PROC_SETIMAGEVERIFICATION)(	int handle, 
+													const char *pszRefDir, 
+													bool bRemoveOldImages, 
+													int iFactor
+													);
+
+const char	ProcOpenScriptFile[] =	{ "StdOpenScriptFile" };
+typedef	int (WINAPI *PROC_OPENSCRIPTFILE)(	int handle, 
+											LPCTSTR pszText,
+											bool bIsFile
+											);
+
+const char	ProcRunScript[] =	{ "StdRunScript" };
+typedef	int (WINAPI *PROC_RUNSCRIPT)(	int handle, 
+										ScriptProgressMonitor *const monitor
+										);
+
+const char	ProcSendRawCommand[] =	{ "StdSendRawCommand" };
+typedef	int (WINAPI *PROC_SENDRAWCOMMAND)(	int handle, 
+											const char *pszText,
+											ScriptProgressMonitor *const monitor
+											);
+
+const char	ProcSendCommandFile[] =	{ "StdSendCommandFile" };
+typedef	int (WINAPI *PROC_SENDCOMMANDFILE)(	int handle, 
+											const char *pszFile,
+											ScriptProgressMonitor *const monitor
+											);
+
+const char	ProcGetCommandCount[] =	{ "StdGetCommandCount" };
+typedef	int (WINAPI *PROC_GETCOMMANDCOUNT)(	int handle, 
+											const char *pszFile,
+											int *commandCount
+											);
+
+const char	ProcGetCurrentCommandNumber[] =	{ "StdGetCurrentCommandNumber" };
+typedef	int (WINAPI *PROC_GETCURRENTCOMMANDNUMBER)(	int handle, 
+													int *commandNumber
+													);
+
+const char	ProcGetReceivedData[] =	{ "StdGetReceivedData" };
+typedef	const char* (WINAPI *PROC_GETRECEIVEDDATA)( int handle );
+const char	ProcStopProcessing[] =	{ "StdStopProcessing" };
+typedef	int (WINAPI *PROC_STOPPROCESSING)( int handle );
+
+const char	ProcGetSnapShot[] =	{ "StdGetSnapShot" };
+typedef	int (WINAPI *PROC_GETSNAPSHOT)(	int handle, 
+										TBitmapFileHeader **ppFile,
+										TBitmapInfoHeader **ppBitmap,
+										char **ppData,
+										unsigned long *pSize
+										);
+
+const char	DLLFolder[] =	{ "\\epoc32\\tools\\stat" };
+const char	DLLName[] =	{ "stat.dll" };
+const char	DLLUsbName[] =	{ "SymbianUsb.dll" };
+
+// Exported funcion entrypoints
+extern "C"
+{
+	// miscellaneous
+	STAT_EXPORT const char * __cdecl Version();
+	STAT_EXPORT const char * __stdcall StdVersion();
+
+	STAT_EXPORT const char * __cdecl GetError(const int handle = 0);
+	STAT_EXPORT const char * __stdcall StdGetError(const int handle = 0);
+
+	STAT_EXPORT const char * __cdecl GetErrorText(const int handle, int errorCode);
+	STAT_EXPORT const char * __stdcall StdGetErrorText(const int handle, int errorCode);
+
+	STAT_EXPORT const char * __cdecl GetTEFSharedData(const int handle = 0);
+	STAT_EXPORT const char * __stdcall StdGetTEFSharedData(const int handle = 0);
+
+	STAT_EXPORT int __cdecl SetConnectionLogging(const char *pszLogPath);
+	STAT_EXPORT void __cdecl CloseConnectionLogging();
+	STAT_EXPORT int __stdcall StdSetConnectionLogging(const char *pszLogPath);
+	STAT_EXPORT void __stdcall StdCloseConnectionLogging();
+	
+	// connection
+	STAT_EXPORT int __cdecl Connect(const STATCONNECTTYPE iConnectType, 
+							const char *pszPlatformType, 
+							void *Reserved1 = NULL, 
+							void *Reserved2 = NULL);
+	STAT_EXPORT int __stdcall StdConnect(const STATCONNECTTYPE iConnectType, 
+										 const char *pszPlatformType, 
+										 void *Reserved1 = NULL, 
+										 void *Reserved2 = NULL);
+
+	STAT_EXPORT int __cdecl ConnectMT(const STATCONNECTTYPE iConnectType, 
+							const char *pszPlatformType);
+	STAT_EXPORT int __stdcall StdConnectMT(const STATCONNECTTYPE iConnectType, 
+										 const char *pszPlatformType);
+
+	STAT_EXPORT int __cdecl Disconnect(const int handle);
+	STAT_EXPORT int __stdcall StdDisconnect(const int handle);
+
+	// remote command delay (100 - 30000ms)
+	STAT_EXPORT int __cdecl SetCommandDelay(const int handle, const unsigned int iMillisecondDelay);
+	STAT_EXPORT int __stdcall StdSetCommandDelay(const int handle, const unsigned int iMillisecondDelay);
+
+	// logging
+	STAT_EXPORT int __cdecl SetCommandLogging(const int handle, 
+									  const char *pszLogPath,
+									  MessageReporter *const aMessageReporter,
+									  const STATLOGLEVEL iLevel = EVerbose,
+									  const bool bAppend = true,
+									  void* Reserved1 = NULL,
+									  void* Reserved2 = NULL);
+	STAT_EXPORT int __stdcall StdSetCommandLogging(const int handle, 
+												   const char *pszLogPath,
+												   MessageReporter *const aMessageReporter,
+												   const STATLOGLEVEL iLevel = EVerbose,
+												   const bool bAppend = true,
+												   void* Reserved1 = NULL,
+												   void* Reserved2 = NULL);
+
+	// image verification
+	STAT_EXPORT int __cdecl SetImageVerification(const int handle, 
+										 const char *pszRefDir, 
+										 const bool bRemoveOldImages, 
+										 const int iFactor);
+	STAT_EXPORT int __stdcall StdSetImageVerification(const int handle, 
+													  const char *pszRefDir, 
+													  const bool bRemoveOldImages, 
+													  const int iFactor);
+
+	// target manipulation
+	STAT_EXPORT int __cdecl GetCommandCount(const int handle, const char *pszFile, int *commandCount);
+	STAT_EXPORT int __stdcall StdGetCommandCount(const int handle, const char *pszFile, int *commandCount);
+
+	STAT_EXPORT int __cdecl GetCurrentCommandNumber(const int handle, int *commandNumber);
+	STAT_EXPORT int __stdcall StdGetCurrentCommandNumber(const int handle, int *commandNumber);
+
+	STAT_EXPORT const char* __cdecl GetReceivedData(const int handle);
+	STAT_EXPORT const char* __stdcall StdGetReceivedData(const int handle);
+	STAT_EXPORT int __cdecl OpenScriptFile(const int handle, LPCTSTR pszText, bool bIsFile);
+	STAT_EXPORT int __stdcall StdOpenScriptFile(const int handle, LPCTSTR pszText, bool bIsFile);
+
+	STAT_EXPORT int __cdecl RunScript(const int handle, ScriptProgressMonitor *const monitor);
+	STAT_EXPORT int __stdcall StdRunScript(const int handle, ScriptProgressMonitor *const monitor);
+
+	STAT_EXPORT int __cdecl SendRawCommand(const int handle, const char *pszText, ScriptProgressMonitor *const monitor);
+	STAT_EXPORT int __stdcall StdSendRawCommand(const int handle, const char *pszText, ScriptProgressMonitor *const monitor);
+
+	STAT_EXPORT int __cdecl SendCommandFile(const int handle, const char *pszFile, ScriptProgressMonitor *const monitor);
+	STAT_EXPORT int __stdcall StdSendCommandFile(const int handle, const char *pszFile, ScriptProgressMonitor *const monitor);
+
+	STAT_EXPORT int __cdecl StopProcessing(int handle);
+	STAT_EXPORT int __stdcall StdStopProcessing(int handle);
+
+	STAT_EXPORT int __cdecl GetSnapshot(const int handle, TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize);
+	STAT_EXPORT int __stdcall StdGetSnapshot(const int handle, TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize);
+}
+
+#endif // STATEXP30_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statlist.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATLIST30_H
+#define STATLIST30_H
+
+#include "statmember.h"
+
+#define MAX_VERSION_LEN 32
+
+class STATDLLList
+{
+public:
+	STATDLLList();
+	~STATDLLList();
+	int SetLogging(const char *path);
+	void StopLogging();
+	DWORD CreateListMember(const STATCONNECTTYPE iConnectType, const char *pszPlatformType);
+	STATDLLMember* Member(const DWORD dwHandle);
+	bool RemoveListMember(const DWORD dwHandle);
+	bool ListExists() { return (ListStart != 0); }
+	char *Version() { return szVersion; }
+
+	char szErrorText[MAX_ERROR_MSG_LEN * 2];	// connection error message (if any)
+
+private:
+	void WalkList();
+
+	Reporter oRep;								// debug logging
+	STATDLLMember *ListStart;					// start of connection list
+	char szVersion[MAX_VERSION_LEN];
+};
+
+// stat connection list
+extern STATDLLList aList;
+
+#endif // STATLIST30_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statmember.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     STAT member class header file
+*
+*/
+
+
+
+
+#ifndef STATMEMBER30_H
+#define STATMEMBER30_H
+
+#include <creporter.h>
+#include <statengine.h>
+#include "ini.h"
+
+#define MAX_ID_PREFIX				256
+
+class STATDLLMember
+{
+public:
+	STATDLLMember(const STATCONNECTTYPE iConnectType, 
+				  const char *pszPlatformType,
+				  Reporter *theRep = NULL);
+	virtual ~STATDLLMember();
+	bool Prepare(int iMillisecondDelay, LPTSTR pszLogPath, bool bAppend, MessageReporter *const aMessageReporter, LPTSTR pszRefDir, const bool bRemoveOldImages, const int iFactor, bool bState);
+	int SetCommandDelay(int iMillisecondDelay);		// set the command delay
+	int SetLogging(LPTSTR pszLogPath, bool bAppend, MessageReporter *const aMessageReporter);// set logging of the back end operations
+	int SetImageVerification(LPTSTR pszRefDir, const bool bRemoveOldImages, const int iFactor);
+	void SetResponseTimeout(const unsigned long lMilliseconds) { pEngine->iMaxTimeLimit = lMilliseconds; }
+	void SetMultithreaded(bool bState = true) { pEngine->SetMultithreaded(bState); }	// set multithreaded check
+
+	int OpenScriptFile(LPCTSTR pszText, bool bIsFile);
+	int RunScript(ScriptProgressMonitor *const monitor);
+	int SendCommandFile(LPCTSTR pszFile, ScriptProgressMonitor *const monitor);			// execute a command file
+	int SendRawCommand(LPCTSTR pszText, ScriptProgressMonitor *const monitor);			// execute a command script
+	int StopProcessing(void);
+	int GetCommandCount(LPCTSTR pszFile, int* commandCount);
+	int GetCurrentCommandNumber( int* commandNumber);
+	const char * GetReceivedData(void);
+	const char * GetErrorText( int errorCode );
+
+	int GetSnapshot(TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize);
+	const char * GetDeviceInfo() { return pEngine->pDeviceInfo; }
+	const char * GetTEFSharedData() { return pEngine->iTEFSharedData; }
+	const char * GetErrorText() {	return szErrorText; }	// returns complete error message
+	int GetErrorCode() { return iErrorCode; }		// return just the code
+
+	static LPTSTR ToUnicode(const char *string);	// convert ANSI to Unicode
+	static const char * ToAnsi(LPCTSTR string);			// convert Unicode to ANSI
+	static void ParseConnection(char *pConnection, STATCONNECTTYPE *pType, char **ppAddress);
+
+	STATCONNECTTYPE iConnectionType;				// type of connection
+	char *pszAddress;								// our selected address
+
+	STATDLLMember* lPrevConnection;					// previous connection in list
+	STATDLLMember* lNextConnection;					// next connection in list
+
+private:
+	void Message(const char * message, ...);
+	void ErrorMessage(const char * message, ...);
+
+	CSTATEngine *pEngine;							// pointer to back end
+	int iErrorCode;									// error code
+	char szErrorText[MAX_ERROR_MSG_LEN * 2];		// error message
+	char szPrefix[MAX_ID_PREFIX];					// id prefix
+	Reporter *pRep;									// pointer to logging
+	CStatIniFile statIniFile;							// ini file reader
+};
+
+#endif // STATMEMBER30_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statscriptdecoder.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATSCRIPTDECODER_H
+#define STATSCRIPTDECODER_H
+
+#include "stat.h"
+#include "CSTATDataFormatConverter.h"
+#include "CSTATImageVerify.h"
+
+class CSTATScriptCommand
+{
+public:
+	CSTATScriptCommand();
+	~CSTATScriptCommand();
+	char *Command()			{ return pCommand; }
+	unsigned long Length()	{ return ulLength; }
+	bool SetData(const char *pData, const unsigned long theLength);
+	void Reset();
+
+	char cCommandID;
+	unsigned long ulLength;
+
+private:
+	char *pCommand;
+};
+
+class CSTATScriptDecoder
+{
+public:
+	CSTATScriptDecoder(CSTATLogFile *theLog);
+	~CSTATScriptDecoder();
+	int Initialise(const CString& file, bool bIsFile);
+	int GetNextCommand(CSTATScriptCommand **ppCommand);
+	void Release();
+
+private:
+	int ReadDataIntoMemory(const CString& commands);
+	int ReadFileIntoMemory(CFile& scriptdata);
+	int ValidateScript();
+	int ExtractComment();
+	bool IncrementCounter(void);
+
+	CSTATLogFile *pLog;
+	char *lpBuffer;										// buffer that holds read script file
+	long lFileLength;									// length of file read
+	int iCounter;										// step counter through file
+	CSTATScriptCommand LastCommand;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statserial.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// statserial.h
+// Serial transport class definition
+////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef STATSERIAL_H
+#define STATSERIAL_H
+
+#include "statcommon.h"
+#include "stattransport.h"
+
+// COM port settings
+// There is a problem with the use of ::ReadFile as this is a blocking
+// operation called in a critical section.  If the call blocks for too
+// long and the user closes the thread then the section is lost for ever.
+// Reduce the timeouts to prevent the threads locking when there is
+// a link error.  This is the wrong thing to do as we should really
+// update the reading to check the port first and query if data
+// is available.
+#define STAT_WRITETOTALTIMEOUTMULTIPLIER	0
+#define STAT_WRITETOTALTIMEOUTCONSTANT		1000
+#define STAT_READINTERVALTIMEOUT			0
+#define STAT_READTOTALTIMEOUTMULTIPLIER		0
+#if defined _DEBUG
+	// In a release build wait a few seconds.
+	// In a debug build wait for longer as we may be debugging and 
+	// pausing at break-points and generally slowing things up a bit.
+	#define STAT_READTOTALTIMEOUTCONSTANT		(10 * 1000)
+#else // defined _DEBUG
+	#define STAT_READTOTALTIMEOUTCONSTANT		1000
+#endif // defined _DEBUG
+
+#define STAT_BAUDRATE						CBR_115200
+#define STAT_BYTESIZE						8
+#define STAT_PARITY							NOPARITY
+#define STAT_STOPBITS						ONESTOPBIT
+
+
+class CSTATSerial : public CSTATTransport
+{
+public:
+	CSTATSerial(STATCONNECTTYPE eConnect);	// Request that when this object
+											// is created then it knows what
+											// implementation of serial it is.
+											// We could use sub-classes but there
+											// is so little difference we handle
+											// all serial transports as one case.
+											// The only difference is in the packet
+											// size which we store as an object
+											// data field.
+	~CSTATSerial();
+	int Initialise(void);
+	int Connect(const char *pAddress = NULL);
+	int Send(const char cIdentifier, const char *pData = NULL, const unsigned long ulLength = 0);
+	int Receive(char *cIdentifier, char **ppData = NULL, unsigned long *pLength = NULL);
+	int Disconnect(void);
+	int Release(void);
+	unsigned int GetMaxPacketSize(void) const;	// Override base class method
+												// to specify that we have
+												// a limit to the pakcet size
+												// and the specific limit
+												// depends upon the serial
+												// transport we represent.
+
+private:
+	bool OpenComPort(const char *pAddress);
+	int ReceiveBytes( char *buff, unsigned long size );
+
+	HANDLE hComPort;				// com port to work with
+	unsigned long int iMaxPacketSize;
+									// Holds the maximum size of the
+									// packets we send.
+	char *pBuffer;					// Holds received data
+	unsigned long int iBufferLength;
+									// Holds the length of the receive data 
+									// buffer
+};
+
+inline unsigned int CSTATSerial::GetMaxPacketSize(void) const
+{
+	return (iMaxPacketSize);
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statserialbluetooth.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATSERIALBLUETOOTH_H
+#define STATSERIALBLUETOOTH_H
+
+#include "statcommon.h"
+#include "stattransport.h"
+
+// COM port settings
+#define STATBT_WRITETOTALTIMEOUTMULTIPLIER		10
+#define STATBT_WRITETOTALTIMEOUTCONSTANT		10
+#define STATBT_READINTERVALTIMEOUT				100
+#define STATBT_READTOTALTIMEOUTMULTIPLIER		100
+#define STATBT_READTOTALTIMEOUTCONSTANT			120000
+
+#define STATBT_BAUDRATE						CBR_115200
+#define STATBT_BYTESIZE						8
+#define STATBT_PARITY						NOPARITY
+#define STATBT_STOPBITS						ONESTOPBIT
+
+
+class CSTATSerialBluetooth : public CSTATTransport
+{
+public:
+	CSTATSerialBluetooth();
+	~CSTATSerialBluetooth();
+	int Initialise(void);
+	int Connect(const char *pAddress = NULL);
+	int Send(const char cIdentifier, const char *pData = NULL, const unsigned long ulLength = 0);
+	int Receive(char *cIdentifier, char **ppData = NULL, unsigned long *pLength = NULL);
+	int Disconnect(void);
+	int Release(void);
+
+private:
+	bool OpenComPort(const char *pAddress);
+	int ReceiveBytes( char *buff, unsigned long size );
+	
+	HANDLE hComPort;				// com port to work with
+	char *pTemp;					// holds received data
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/statsocket_block.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATSOCKET_H
+#define STATSOCKET_H
+
+#include <winsock2.h>
+#include "statcommon.h"
+#include "stattransport.h"
+#include "../../../../Common/inc/SerialPacketSize.h"
+
+#define SOCKETTIMEOUT 300 //300 seconds
+
+class CSTATSocket : public CSTATTransport
+{
+public:
+	CSTATSocket();
+	~CSTATSocket();
+	int Initialise(void);
+	int Connect(const char *pAddress = NULL);
+	int Send(const char cIdentifier, const char *pCommand = NULL, const unsigned long ulLength = 0);
+	int Receive(char *cIdentifier, char **ppData = NULL, unsigned long *pLength = NULL);
+	int Disconnect(void);
+	int Release(void);
+	unsigned int GetMaxPacketSize(void) const;
+
+private:
+
+	SOCKET sock;
+    SOCKADDR_IN sin;
+
+	SOCKET listener;
+    SOCKADDR_IN remote_sin;
+
+	char *pBuffer;					// Holds received data
+	unsigned long int iBufferLength;
+									// Holds the length of the receive data 
+									// buffer
+};
+
+inline unsigned int CSTATSocket::GetMaxPacketSize(void) const
+{
+	return (KMaxTCPIPPacketSize);
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/stattransport.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATTRANSPORT_H
+#define STATTRANSPORT_H
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <memory.h>
+#include "CSTATReturnCodes.h"
+
+
+// abstract transport class
+class CSTATTransport
+{
+public:
+	CSTATTransport();
+	~CSTATTransport() {}
+
+	// these must be derived for selected transport
+	virtual int Initialise(void) = 0;
+	virtual int Connect(const char *pAddress = NULL) = 0;
+	virtual int Send(const char cIdentifier, const char *pData = NULL, const unsigned long ulLength = 0) = 0;
+	virtual int Receive(char *cIdentifier, char **ppData = NULL, unsigned long *pLength = NULL) = 0;
+	virtual int Disconnect(void) = 0;
+	virtual int Release(void) = 0;
+	virtual char * Error(void);
+	virtual unsigned int GetMaxPacketSize(void) const = 0;
+	
+protected:
+	void SetError(const char *pText, ...);
+
+private:
+	char szError[STAT_MAX_ERRORLEN + 1];
+};
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Constructor
+inline CSTATTransport::CSTATTransport(void)
+{
+	memset(&szError, 0, sizeof(szError));
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Return error text
+inline char * CSTATTransport::Error(void)
+{
+	return szError;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Set error text
+inline void CSTATTransport::SetError(const char *pText, ...)
+{
+	memset(&szError, 0, sizeof(szError));
+
+	va_list pCurrent = (va_list)0;
+    va_start (pCurrent, pText);
+	vsprintf (szError, pText, pCurrent);
+    va_end (pCurrent);
+
+	char szExtra[20] = {0};
+	sprintf(szExtra, " (%d)", GetLastError());
+	strcat (szError, szExtra);
+}
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#if !defined(AFX_STDAFX_H__CB0CFE43_F6B6_4fd6_BA4E_62F3A588FA05__INCLUDED_)
+#define AFX_STDAFX_H__CB0CFE43_F6B6_4fd6_BA4E_62F3A588FA05__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <assert.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__CB0CFE43_F6B6_4fd6_BA4E_62F3A588FA05__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/inc/windowmessages.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if ! defined (WINDOW_MESSAGES_H_0731AB35_7D26_459d_9A0E_1AFB32883064)
+#define WINDOW_MESSAGES_H_0731AB35_7D26_459d_9A0E_1AFB32883064
+
+/////////////////////////////////////////////////////////////////////////////
+// WM_DONE_COMMAND
+// Passed from the script progress monitor to the main UI window (this is
+// the desktop dialog) to indicate that a single command of the current
+// scipt has been processed.
+/////////////////////////////////////////////////////////////////////////////
+#define WM_DONE_COMMAND	(WM_USER + 0x0001)
+
+/////////////////////////////////////////////////////////////////////////////
+// WM_DONE_SCRIPT
+// Passed from the script progress monitor to the main UI window (this is
+// the desktop dialog) to indicate that the current  script has 
+// been processed.
+/////////////////////////////////////////////////////////////////////////////
+#define WM_DONE_SCRIPT	(WM_USER + 0x0002)
+
+/////////////////////////////////////////////////////////////////////////////
+// WM_SHOW_LOG_MESSAGE
+// Passed from the log file to the application main window.
+// There is a data structure passed in this message (as the lParam) and 
+// the receiving window must delete it.
+/////////////////////////////////////////////////////////////////////////////
+#define WM_SHOW_LOG_MESSAGE	(WM_USER + 0x0003)
+
+#endif // ! defined (WINDOW_MESSAGES_H_0731AB35_7D26_459d_9A0E_1AFB32883064)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/crepmisc.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,623 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include <time.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include "cReporter.h"
+
+
+/*****************************************************************************
+ * Reporter preparation
+ * 
+ * Sets member strings to a known state
+ *****************************************************************************/
+
+void
+Reporter::prepare ( void )
+{
+  int i;
+  
+#ifdef RPT_DEBUG_PROG
+  // set filename contents to garbage value
+  for (i=0;i<CPO_MAX_FILENAME_LEN;i++)
+  {
+    filename [ i ] = CPO_GARBAGE_CHAR;
+  }
+  
+  // set program name contents to garbage value
+  for (i=0;i<RPT_MAX_PROGRAM_LEN;i++)
+  {
+    progname [ i ] = CPO_GARBAGE_CHAR;
+  }
+#endif  
+
+  for (i=0;i<RPT_MAX_LIST_ENTRIES;i++)
+  {
+    messageList [ i ] = (char *)0;
+  }
+  
+  fileRead = 0;
+  pCurrent = (va_list) 0;
+  prefix = 0;
+  state = 0;
+  hFile = (HANDLE) 0;
+  filename [ 0 ] = '\0';
+  progname [ 0 ] = '\0';
+}
+
+/*****************************************************************************
+ * Reporter setup
+ * 
+ * Checks the output streams.
+ * Sets the prefix mask.
+ * Stores a copy of the application name.
+ * Puts a message into the logging file that the Reporter is initialised.
+ *****************************************************************************/
+
+CPO_BOOL
+Reporter::setup ( const char * appName,
+                  const BITFIELD prefixMask,
+				  const unsigned long ulOpenAttributes )
+{
+  // check for valid output destinations
+  if ( !( state & RPT_FILE ) && 
+       !( state & RPT_STDOUT ) &&
+       !( state & RPT_STDERR ) )
+  {
+    return ( CPO_FALSE );
+  }  
+
+  // check for valid mask
+  if ( !( prefixMask & RPT_MSG_TYPE ) && 
+       !( prefixMask & RPT_APPNAME ) &&
+       !( prefixMask & RPT_DATE ) &&
+       !( prefixMask & RPT_TIME ) )
+  {
+    prefix = RPT_MSG_ONLY;
+  }  
+  else
+  {
+    prefix = prefixMask;
+  }
+  
+  // get the actual program name and make sure it is valid
+  extractName ( progname, appName, RPT_MAX_PROGRAM_LEN );
+  validateText ( progname, RPT_MAX_PROGRAM_LEN );
+  if ( !( *progname ) )
+  {
+    return ( CPO_FALSE );
+  }
+
+  if ( state & RPT_FILE )
+  {
+    // open output file
+    if ( !openFile ( ulOpenAttributes ) )
+    {
+      state -= RPT_FILE;
+      if ( !( state & RPT_OUTPUT_MASK ) )
+      {
+        return ( CPO_FALSE );
+      }
+    }
+  }
+  
+  // set flags to show everything ok
+  state |= CPO_CONNECTED;
+  state |= CPO_ACTIVATED;
+  
+  return ( CPO_TRUE );
+}
+
+/*****************************************************************************
+ * Resolve a code to a message and build it.
+ *****************************************************************************/
+
+void
+Reporter::actOnCode ( int code, char messType )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && 
+       ( state & CPO_ACTIVATED ) &&
+       code >= 0 && 
+       code < RPT_MAX_LIST_ENTRIES )
+  {
+    if ( messageList [ code ] )
+    {
+      buildMessage ( messageList [ code ], messType );
+    }
+    else
+    {
+      char tmpMsg [ 128 ];
+      (void) sprintf ( tmpMsg, "[ No message text for code %d ]", code );
+      buildMessage ( tmpMsg, messType );
+    }
+  }
+}
+
+/*****************************************************************************
+ * Generate a filename using the application name and current date.
+ *****************************************************************************/
+
+void
+Reporter::generateFilename ( char * validName, const char * appName )
+{
+  /* Construct a filename for the logging to be written to.
+   * Filename is of the format x[xxx]9988.rpt where :
+   * 
+   * xxxx = up to first 4 chars of calling program's name
+   * 99 = 2 digit day of month
+   * 88 = 2 digit month of year
+   */
+
+  const int PROG_LEN = 4;
+  time_t curtime;
+  struct tm *tminfo;
+  
+  // get filename from path
+  extractName ( buffer, appName, PROG_LEN );
+  
+  (void) time ( &curtime );
+  tminfo = localtime ( &curtime );
+
+  (void) sprintf ( validName, 
+                   "%s%02d%02d.RPT", 
+                   buffer, 
+                   tminfo->tm_mday, 
+                   tminfo->tm_mon + 1);
+
+#ifdef RPT_DEBUG_PROG
+  (void) fprintf ( stdout, "filename [%s] generated from [%s]\n", 
+                   validName, appName );
+  (void) fflush ( stdout );
+#endif  
+}
+
+/*****************************************************************************
+ * Extract 'length' characters of the actual filename from the path.
+ *****************************************************************************/
+
+void
+Reporter::extractName ( char * file, const char * path, const int length )
+{
+  char *ptr;
+
+  // find the last backslash
+  ptr = strrchr ( path, '\\' );
+
+  if ( !ptr )
+  {
+    strncpy ( file, path, length );
+  }
+  else
+  {
+    strncpy ( file, (++ptr), length );
+  }
+  
+  *( file + length ) = '\0';
+}
+
+/****************************************************************************
+ * Open the file or print a message if we can't
+ *****************************************************************************/
+
+int 
+Reporter::openFile ( unsigned long ulOpenAttributes )
+{
+#ifdef UNICODE
+	TCHAR uFilename[CPO_MAX_FILENAME_LEN + 1];
+
+    // Convert to UNICODE.
+    if (!MultiByteToWideChar(CP_ACP,					// conversion type
+							 0,							// flags
+							 filename,					// source
+							 -1,						// length
+							 uFilename,					// dest
+							 CPO_MAX_FILENAME_LEN))		// length
+    {
+		return ( CPO_FALSE );
+    }
+
+	hFile = CreateFile(uFilename,
+				   GENERIC_WRITE,
+				   FILE_SHARE_READ | FILE_SHARE_WRITE,
+				   NULL,
+				   ulOpenAttributes,
+				   FILE_ATTRIBUTE_NORMAL,
+				   NULL);
+#else
+	hFile = CreateFile(filename,
+				   GENERIC_WRITE,
+				   FILE_SHARE_READ | FILE_SHARE_WRITE,
+				   NULL,
+				   ulOpenAttributes,
+				   FILE_ATTRIBUTE_NORMAL,
+				   NULL);
+#endif
+
+	if (hFile == INVALID_HANDLE_VALUE)
+	{
+//		char szTemp[500] = {0};
+//		sprintf(szTemp, "WARNING : [%s] could not be opened. File output disabled", filename);
+//		MessageBox(NULL, szTemp, NULL, MB_OK);
+		return ( CPO_FALSE );
+	}
+
+	// move to the end if a file already exists
+	SetFilePointer(hFile, 0, 0, FILE_END);
+
+#ifdef RPT_DEBUG_PROG
+  (void) fprintf ( stdout, "file [%s] opened\n", filename );
+  (void) fflush ( stdout );
+#endif  
+
+  return ( CPO_TRUE );
+}
+
+/*****************************************************************************
+ * Construct the parts of the complete message.
+ *****************************************************************************/
+
+void
+Reporter::buildMessage ( const char * message, const char messType )
+{
+  char prefixInfo [ RPT_MAX_MSG_LEN + 1 ];
+  char finalStr [ RPT_OPEN_MSG_LEN + RPT_MAX_MSG_LEN + 1 ];
+  int maxlen;
+
+  // get prefix information
+  switch ( messType )
+  {
+   case RPT_TEXT:
+   case RPT_MSG:
+     *( prefixInfo ) = '\0';
+     break;
+   case RPT_HEADER:
+     addHeaderInfo ( prefixInfo );
+     break;
+   default:
+     addLogInfo ( prefixInfo, messType );
+     break;
+  }
+  
+  // parse arguments passed with message
+  (void) vsprintf ( buffer, message, pCurrent );
+
+  // get max length of output string
+  if ( messType == RPT_DEBUG || messType == RPT_MSG || 
+       messType == RPT_ERROR || messType == RPT_TEXT )
+  {
+    maxlen = RPT_OPEN_MSG_LEN - (int) strlen ( prefixInfo ) - 1;
+  }
+  else
+  {
+    maxlen = RPT_MAX_MSG_LEN - (int) strlen ( prefixInfo ) - 1;
+  }
+
+  // make sure we are dealing with a valid message of correct length
+  validateText ( buffer, maxlen );
+
+  // generate the output string
+  (void) sprintf ( finalStr,
+                   "%s%s",
+                   prefixInfo, 
+                   buffer );
+
+  if ( messType == RPT_TEXT )
+  {
+    (void) strcpy ( buffer, finalStr );
+  }
+  else
+  {
+    writeToStream ( finalStr );
+  }
+}
+
+/*****************************************************************************
+ * Validate the supplied string for zero length and unprintable chars up to 
+ * length bytes.
+ * 
+ * If unprintable chars are found embedded in the text, the text will be
+ * truncated at that point.  
+ *
+ * If the text is longer than the specified length, it will be truncated at
+ * that length.
+ *
+ * If the text is empty or the 1st char is unprintable, the function will
+ * insert replacement 'invalid' text.
+ *****************************************************************************/
+
+void
+Reporter::validateText ( char * text, const int length )
+{
+  int len = (int) strlen ( text );
+  if ( len > length )
+  {
+    len = length;
+  }
+
+  // check for empty message or unprintable 1st char
+  if ( len && isprint ( text [ 0 ] ) )
+  {
+    // check message for unprintable characters
+    for (int i=1;i<len;i++)
+    {
+		if (text [ i ] != '\t')
+		{
+		  if ( ! ( isprint ( text [ i ] ) ) )
+		  {
+			break;
+		  }
+		}
+    }
+
+    text [ i ] = '\0';
+  }
+  else
+  {
+    (void) strcpy ( text, "####" );
+  }
+}
+
+/*****************************************************************************
+ * Generate the prefix information to prepend to a 'write' message.
+ *
+ * NOTE: No checks are done to ensure prefix info is not too small for 
+ *       allocated string.  If more information is prepended in the future, 
+ *       this will have to be implemented.
+ *****************************************************************************/
+
+void
+Reporter::addHeaderInfo ( char * prefixInfo )
+{
+  time_t curTime;
+  
+  // create the time string
+  (void) time ( &curTime );
+  (void) strftime ( buffer, 
+                    sizeof ( buffer ), 
+                    "%a %b %d %Y  %H:%M:%S",
+                    localtime ( &curTime ) );
+
+  // append the program name
+  (void) sprintf ( prefixInfo,
+                   "%s [%s] ",
+                   buffer, 
+                   progname );
+}
+
+/*****************************************************************************
+ * Generate the prefix information to prepend to the message.
+ * If msg type is RPT_ERROR, info is generated regardless of prefix setting.
+ *
+ * NOTE: No checks are done to ensure prefix info is not too small for 
+ *       allocated string.  If more information is prepended in the future, 
+ *       this will have to be implemented.
+ *****************************************************************************/
+
+void
+Reporter::addLogInfo ( char * prefixInfo, const char msgType )
+{
+  int bytesUsed = 0;
+  time_t curTime;
+  *( prefixInfo ) = '\0';
+
+  if ( prefix == RPT_MSG_ONLY)
+  {
+    return;
+  }
+  
+#ifdef RPT_DEBUG_PROG
+  // fill prefix string to check for memory leaks
+  for (int i=1;i<RPT_MAX_MSG_LEN;i++)
+  {
+    *( prefixInfo + i ) = CPO_GARBAGE_CHAR;
+  }
+#endif  
+
+  if ( ( prefix & RPT_MSG_TYPE ) )
+  {
+    *( prefixInfo ) = msgType;
+    *( prefixInfo + 1 ) = ' ';
+    *( prefixInfo + 2 ) = '\0';
+
+    bytesUsed += 2;
+  }
+  
+  if ( ( prefix & RPT_APPNAME ) )
+  {
+    (void) sprintf ( prefixInfo + bytesUsed, "%s ", progname );
+    bytesUsed += (int) strlen ( progname ) + 1;
+  }
+  
+  if ( ( prefix & RPT_DATE ) )
+  {
+    const int sublen = 5;
+
+    // create the date string
+    (void) time ( &curTime );
+    (void) strftime ( buffer, 
+                      sizeof ( buffer ), 
+                      "%d/%m",
+                      localtime ( &curTime ) );
+
+    (void) sprintf ( prefixInfo + bytesUsed, "%s ", buffer );
+    bytesUsed += ( sublen + 1 );
+  }
+  
+  if ( ( prefix & RPT_TIME ) )
+  {
+    const int sublen = 8;
+
+    // create the time string
+    (void) time ( &curTime );
+    (void) strftime ( buffer, 
+                      sizeof ( buffer ), 
+                      "%H:%M:%S",
+                      localtime ( &curTime ) );
+
+    (void) sprintf ( prefixInfo + bytesUsed, "%s ", buffer );
+    bytesUsed += ( sublen + 1 );
+  }
+
+  // null terminate to be sure
+  *( prefixInfo + bytesUsed ) = '\0';
+}
+
+/*****************************************************************************
+ * Send text to appropriate stream(s).
+ *****************************************************************************/
+
+void
+Reporter::writeToStream ( const char * str )
+{
+#ifdef RPT_DEBUG_PROG
+  (void) fprintf ( stdout, "output [%s]\n", str );
+  (void) fflush ( stdout );
+#endif  
+
+  // write output string to file
+  if ( state & RPT_FILE )
+  {
+	  unsigned long lBytesWritten;
+
+	  // need to seek to end of file in case other handles have written in the meantime
+	  SetFilePointer(hFile, 0, NULL, FILE_END);
+
+	  WriteFile(hFile, str, strlen(str), &lBytesWritten, NULL);
+	  WriteFile(hFile, "\r\n", 2, &lBytesWritten, NULL);
+
+	  // in case other processes are using this file to log
+	  FlushFileBuffers(hFile);
+  }
+
+  // write output string to standard output
+  if ( state & RPT_STDOUT )
+  {
+    (void) fprintf ( stdout, "%s\n", str );
+    (void) fflush ( stdout );
+  }
+  
+  // write output string to standard error
+  if ( state & RPT_STDERR )
+  {
+    (void) fprintf ( stderr, "%s\n", str );
+    (void) fflush ( stderr );
+  }
+}
+
+/*****************************************************************************
+ * Close the output file stream.
+ *****************************************************************************/
+
+void 
+Reporter::closeFile ( void )
+{
+	CloseHandle(hFile);
+
+#ifdef RPT_DEBUG_PROG
+  (void) fprintf ( stdout, "file [%s] closed\n", filename );
+  (void) fflush ( stdout );
+#endif  
+}
+
+/***************************************************************************
+ * Open the message file, then read in contents, processing a line at a
+ * time, putting the current line into global buffer string.
+ ***************************************************************************/
+
+void
+Reporter::readMessageFile ( const char * file )
+{
+  FILE * finptr;
+  
+  // open initialisation file
+  if ( ( finptr = fopen ( file, "r" ) ) == NULL )
+  {
+    return;
+  }
+  
+  // read each line
+  while ( ( fgets ( buffer, RPT_MAX_LINE_LEN, finptr ) ) != NULL )
+  {
+    if ( *( buffer ) != '\n' && *( buffer ) != '#' )
+    {
+      addMessage ( );
+    }
+  }
+
+  (void) fclose ( finptr );
+}
+
+/***************************************************************************
+ * Split the line of text into code and message and allocate memory in
+ * list and store it.
+ ***************************************************************************/
+
+void
+Reporter::addMessage ( void )
+{
+  char *pCode;
+  char *pText;
+  int code;
+
+  // extract the code and text
+  pCode = strtok ( buffer, ":" );
+  pText = strtok ( NULL, "\n" );
+
+  // check for legitimate values
+  if ( !pCode || !pText )
+  {
+    return;
+  }
+
+  code = atoi ( pCode );
+  if ( code > RPT_MAX_LIST_ENTRIES || messageList [ code ] )
+  {
+    return;
+  }
+  
+  // jump any spaces in front of text
+  while ( *( pText ) == ' ' || *( pText ) == '\t' )
+  {
+    pText++;
+  }
+  
+  // copy string
+  // messageList [ code ] = new char ( strlen ( pText ) + 1 );
+  messageList [ code ] = 
+    (char *) malloc ( sizeof ( char ) * ( strlen ( pText ) + 1 ) );
+
+  (void) strcpy ( messageList [ code ], pText );
+
+#ifdef RPT_DEBUG_PROG
+//   (void) fprintf ( stdout, "code [%s] text [%s] entry [%s] len %d\n", 
+//                    pCode, pText, messageList [ code ], strlen ( pText ) );
+//   (void) fflush ( stdout );
+#endif
+
+  // let object know there is at least one message entry
+  fileRead = 1;
+}
+
+/****************************************************************************/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/creporter.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,723 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include <string.h>
+#include <malloc.h>
+#include <winbase.h>
+#include "cReporter.h"
+
+CRITICAL_SECTION aCriticalSection;
+
+/*****************************************************************************
+ * Basic constructor
+ *****************************************************************************/
+
+Reporter::Reporter()
+: pCurrent((va_list)0), state(0), prefix(0), hFile((HANDLE)0), fileRead(0)
+{
+	memset(filename, 0, sizeof(filename));
+	memset(progname, 0, sizeof(progname));
+	memset(buffer, 0, sizeof(buffer));
+
+	int i;
+	for (i=0;i<RPT_MAX_LIST_ENTRIES;i++)
+		messageList[i] = NULL;
+}
+
+/***************************************************************************
+ * Destructor to free any memory we've allocated.
+ ***************************************************************************/
+
+Reporter::~Reporter ( void )
+{
+  kill();
+}
+
+/*****************************************************************************
+ * Initialiser for Reporter using automatic filename generator.
+ * 
+ * Generates a filename if requested. If file doesn't exist, it is created.
+ *****************************************************************************/
+
+CPO_BOOL
+Reporter::init ( const char * appName,
+                 const BITFIELD prefixMask,
+                 const BITFIELD destination )
+{
+  // must not be initialised
+  if ( state & CPO_CONNECTED )
+  {
+    return ( CPO_FALSE );
+  }
+
+  // initialise variables
+  prepare ( );
+  
+  // set up logging file
+  state = destination;
+  if ( state & RPT_FILE )
+  {
+    generateFilename ( filename, appName );
+  }
+  
+  // final preparations
+  if ( ! ( setup ( appName, prefixMask ) ) )
+  {
+    return ( CPO_FALSE );
+  }
+
+#ifdef RPT_DEBUG_PROG
+    (void) fprintf ( stdout, 
+                     "progname [%s] prefix %ld dest %ld file [%s] state %ld\n",
+                     progname, prefixMask, destination, filename, state );
+    (void) fflush ( stdout );
+#endif  
+
+  InitializeCriticalSection(&aCriticalSection);
+  return ( CPO_TRUE );
+}
+
+/*****************************************************************************
+ * Initialiser for Reporter using specific path for file output.
+ * 
+ * Opens an output file if requested at the supplied path.  
+ * If the requested file doesn't exist, it is created.
+ * If the path is invalid, initialisation will fail.
+ *****************************************************************************/
+
+CPO_BOOL
+Reporter::init ( const char * appName,
+                 const BITFIELD prefixMask,
+                 const BITFIELD destination,
+                 const char * path )
+{
+  char tmpFile [ CPO_MAX_FILENAME_LEN + 1 ];
+  char tmpPath [ CPO_MAX_FILENAME_LEN + 1 ];
+  
+  // must not be initialised
+  if ( state & CPO_CONNECTED )
+  {
+    return ( CPO_FALSE );
+  }
+
+// initialise variables
+  prepare ( );
+  
+  // because we supplied a path, make sure we are setup for file output
+  state = destination;
+  if ( !(state & RPT_FILE) )
+  {
+    state += RPT_FILE;
+  }
+
+  // generate the output filename
+  generateFilename ( tmpFile, appName );
+
+  // add a backslash if there isn't one
+  strcpy(tmpPath, path);
+  if ((*(tmpPath + strlen(tmpPath) - 1)) != '\\')
+	strcat(tmpPath, "\\");
+
+  (void) sprintf ( filename, "%s%s", tmpPath, tmpFile );
+  
+  // final preparations
+  if ( ! ( setup ( appName, prefixMask ) ) )
+  {
+    return ( CPO_FALSE );
+  }
+
+#ifdef RPT_DEBUG_PROG
+    (void) fprintf ( stdout, 
+                     "appname [%s] prefix %ld dest %ld file [%s] state %ld\n", 
+                     appName, prefixMask, destination, filename, state );
+    (void) fflush ( stdout );
+#endif  
+    
+  InitializeCriticalSection(&aCriticalSection);
+  return ( CPO_TRUE );
+}
+
+/*****************************************************************************
+ * Initialiser for Reporter using specific path and filename for output.
+ * 
+ * Opens an output file using supplied name at supplied path.  
+ * If the requested file doesn't exist, it is created.
+ * If the path is invalid, initialisation will fail.
+ *****************************************************************************/
+
+CPO_BOOL
+Reporter::init ( const char * appName,
+                 const BITFIELD prefixMask,
+                 const BITFIELD destination,
+                 const char * path,
+                 const char * file,
+				 const unsigned long ulOpenAttributes)
+{
+  char tmpFile [ CPO_MAX_FILENAME_LEN + 1 ];
+  char tmpPath [ CPO_MAX_FILENAME_LEN + 1 ];
+
+  // must not be initialised
+  if ( state & CPO_CONNECTED )
+  {
+    return ( CPO_FALSE );
+  }
+
+ // initialise variables
+  prepare ( );
+  
+  // because we supplied a filename, make sure we are setup for file output
+  state = destination;
+  if ( ! ( state & RPT_FILE ) )
+  {
+    state += RPT_FILE;
+  }
+
+  // get the actual filename if a full path has been supplied
+  extractName ( tmpFile, file, CPO_MAX_FILENAME_LEN );
+
+  // add a backslash if there isn't one
+  strcpy(tmpPath, path);
+  if ((*(tmpPath + strlen(tmpPath) - 1)) != '\\')
+	strcat(tmpPath, "\\");
+
+  (void) sprintf ( filename, "%s%s", tmpPath, tmpFile );
+  
+  // final preparations
+  if ( ! ( setup ( appName, prefixMask, ulOpenAttributes ) ) )
+  {
+    return ( CPO_FALSE );
+  }
+
+#ifdef RPT_DEBUG_PROG
+    (void) fprintf ( stdout, 
+                     "appname [%s] prefix %ld dest %ld file [%s] state %ld\n", 
+                     appName, prefixMask, destination, filename, state );
+    (void) fflush ( stdout );
+#endif  
+    
+  InitializeCriticalSection(&aCriticalSection);
+  return ( CPO_TRUE );
+}
+
+/*****************************************************************************
+ * Append a 'Warning' message to file
+ *****************************************************************************/
+
+void
+Reporter::warn ( char * message, ... )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    va_start ( pCurrent, message );
+    buildMessage ( message, RPT_WARN );
+    va_end ( pCurrent );
+	LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append an 'Error' message to file
+ *****************************************************************************/
+
+void
+Reporter::error ( char * message, ... )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    va_start ( pCurrent, message );
+    buildMessage ( message, RPT_ERROR );
+    va_end ( pCurrent );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a 'Info' message to file
+ *****************************************************************************/
+
+void
+Reporter::info ( char * message, ... )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    va_start ( pCurrent, message );
+    buildMessage ( message, RPT_INFO );
+    va_end ( pCurrent );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a 'Debug' message to file
+ *****************************************************************************/
+
+void
+Reporter::debug ( char * message, ... )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && 
+       ( state & CPO_ACTIVATED ) && 
+       ( state & RPT_DEBUG_ON ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    va_start ( pCurrent, message );
+    buildMessage ( message, RPT_DEBUG );
+    va_end ( pCurrent );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a message to output stream with no accompanying information.
+ *****************************************************************************/
+
+void
+Reporter::msg ( char * message, ... )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    va_start ( pCurrent, message );
+    buildMessage ( message, RPT_MSG );
+    va_end ( pCurrent );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Write a special message containing day, mth, year, and time with the text.
+ *****************************************************************************/
+
+void
+Reporter::header ( char * message, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    va_start ( pCurrent, message );
+    buildMessage ( message, RPT_HEADER );
+    va_end ( pCurrent );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Return the text associated with a particular code.
+ *****************************************************************************/
+
+char *
+Reporter::text ( char * message, ... )
+{
+  *( buffer ) = '\0';
+  
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    va_start ( pCurrent, message );
+    buildMessage ( message, RPT_TEXT );
+    va_end ( pCurrent );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+
+  return ( buffer );
+}
+
+/*****************************************************************************
+ * Append a 'Warning' message to file from message list.
+ *****************************************************************************/
+
+void
+Reporter::warn ( int code, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+	  EnterCriticalSection(&aCriticalSection);
+
+	  va_start ( pCurrent, code );
+	  actOnCode ( code, RPT_WARN );
+	  va_end ( pCurrent );
+
+	  LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append an 'Error' message to file from message list.
+ *****************************************************************************/
+
+void
+Reporter::error ( int code, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+	  EnterCriticalSection(&aCriticalSection);
+
+	  va_start ( pCurrent, code );
+	  actOnCode ( code, RPT_ERROR );
+	  va_end ( pCurrent );
+
+	  LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a 'Info' message to file from message list.
+ *****************************************************************************/
+
+void
+Reporter::info ( int code, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+	  EnterCriticalSection(&aCriticalSection);
+
+	  va_start ( pCurrent, code );
+	  actOnCode ( code, RPT_INFO );
+	  va_end ( pCurrent );
+
+	  LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a 'Debug' message to file from message list.
+ *****************************************************************************/
+
+void
+Reporter::debug ( int code, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+	  EnterCriticalSection(&aCriticalSection);
+
+	  if ( state & RPT_DEBUG_ON )
+	  {
+		va_start ( pCurrent, code );
+		actOnCode ( code, RPT_DEBUG );
+		va_end ( pCurrent );
+	  }
+
+	  LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a message to output stream with no accompanying information.
+ *****************************************************************************/
+
+void
+Reporter::msg ( int code, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+	  EnterCriticalSection(&aCriticalSection);
+
+	  va_start ( pCurrent, code );
+	  actOnCode ( code, RPT_MSG );
+	  va_end ( pCurrent );
+
+	  LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Write a special message containing day, mth, year, and time with the text.
+ *****************************************************************************/
+
+void
+Reporter::header ( int code, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+	  EnterCriticalSection(&aCriticalSection);
+
+	  va_start ( pCurrent, code );
+	  actOnCode ( code, RPT_HEADER );
+	  va_end ( pCurrent );
+
+	  LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Return the text associated with a particular code.
+ *****************************************************************************/
+
+char *
+Reporter::text ( int code, ... )
+{
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+	  EnterCriticalSection(&aCriticalSection);
+
+	  *( buffer ) = '\0';
+  
+	  va_start ( pCurrent, code );
+	  actOnCode ( code, RPT_TEXT );
+	  va_end ( pCurrent );
+
+	  LeaveCriticalSection(&aCriticalSection);
+  }
+  return ( buffer );
+}
+
+/*****************************************************************************
+ * Append a dashed line to file
+ *****************************************************************************/
+
+void
+Reporter::dash ( void )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    writeToStream ( "----------------------------------------"
+                    "---------------------------------------" );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a star line to file
+ *****************************************************************************/
+
+void
+Reporter::star ( void )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    writeToStream ( "****************************************"
+                    "***************************************" );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Append a blank line to file
+ *****************************************************************************/
+
+void
+Reporter::blank ( void )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    writeToStream ( " " );
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Shutdown the Reporter
+ * Puts a message into the logging file that the Reporter has shutdown.
+ * Closes the logging file.
+ *****************************************************************************/
+
+void
+Reporter::kill ( void )
+{
+  // must be initialised
+  if ( state & CPO_CONNECTED )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    if ( state & RPT_FILE )
+    {
+      closeFile ( );
+    }
+
+    // clear in case actions are tried on an uninitialised Reporter
+    state = CPO_CLEAR;
+
+    // free any memory allocated
+    if ( fileRead )
+    {
+      for (int i=0;i<RPT_MAX_LIST_ENTRIES;i++)
+      {
+        if ( messageList [ i ] )
+        {
+          //delete ( messageList [ i ] );
+          free ( messageList [ i ] );
+        }
+      }
+    }
+    LeaveCriticalSection(&aCriticalSection);
+  }
+
+  DeleteCriticalSection(&aCriticalSection);
+}
+
+/*****************************************************************************
+ * Return whether the Reporter is currently initialised or not.
+ *****************************************************************************/
+
+CPO_BOOL
+Reporter::connected ( void )
+{
+  return ( (BOOLEAN) state & CPO_CONNECTED );
+}
+
+/*****************************************************************************
+ * Return whether the Reporter is currently active or not.
+ *****************************************************************************/
+
+CPO_BOOL
+Reporter::active ( void )
+{
+  return ( (BOOLEAN) state & CPO_ACTIVATED );
+}
+
+/*****************************************************************************
+ * Suspend the Reporter
+ *****************************************************************************/
+
+void
+Reporter::sleep ( void )
+{
+  // must be initialised and activated
+  if ( ( state & CPO_CONNECTED ) && ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    state -= CPO_ACTIVATED;
+    
+    if ( state & RPT_FILE )
+    {
+      closeFile ( );
+    }
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Re-activate the Reporter
+ *****************************************************************************/
+
+void
+Reporter::wake ( void )
+{
+  // must be initialised but not activated
+  if ( ( state & CPO_CONNECTED ) && ! ( state & CPO_ACTIVATED ) )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    state += CPO_ACTIVATED;
+    
+    if ( state & RPT_FILE && !openFile ( ) )
+    {
+      // couldn't reopen the file so stop outputting to it
+      state -= RPT_FILE;
+
+      // no output left so shutdown Reporter
+      if ( !( state & RPT_OUTPUT_MASK ) )
+      {
+        kill ( );
+      }
+    }
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Allow debug messages.
+ *****************************************************************************/
+
+void
+Reporter::debugON ( void )
+{
+  if ( state & CPO_CONNECTED )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    if ( !( state & RPT_DEBUG_ON ) )
+    {
+      state += RPT_DEBUG_ON;
+      debug ( "DEBUG messages will be processed" );
+    }
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/*****************************************************************************
+ * Refuse debug messages.
+ *****************************************************************************/
+
+void
+Reporter::debugOFF ( void )
+{
+  if ( state & CPO_CONNECTED )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    if ( state & RPT_DEBUG_ON )
+    {
+      debug ( "DEBUG messages will not be processed" );
+      state -= RPT_DEBUG_ON;
+    }
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/***************************************************************************
+ * Loads the contents of a message file into memory.
+ ***************************************************************************/
+
+void
+Reporter::load ( const char * file )
+{
+  if ( state & CPO_CONNECTED )
+  {
+    EnterCriticalSection(&aCriticalSection);
+    readMessageFile ( file );
+    if ( fileRead )
+    {
+      debug ( "Messages loaded from %s", file );
+    }
+    else
+    {
+      debug ( "No messages loaded from %s", file );
+    }
+    
+#ifdef RPT_DEBUG_PROG
+    if ( fileRead )
+    {
+      for (int i=0;i<RPT_MAX_LIST_ENTRIES;i++)
+      {
+        if ( messageList [ i ] )
+        {
+          (void) fprintf ( stdout, "%d : [%s] %d\n", 
+                           i, messageList [ i ], 
+                           strlen ( messageList [ i ] ) );
+        }
+      }
+    }
+#endif
+    LeaveCriticalSection(&aCriticalSection);
+  }
+}
+
+/***************************************************************************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/cstatdataformatconverter.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,673 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "afxpriv.h"
+#include "CSTATDataFormatConverter.h"
+
+//-------------------------------------------------------------------------------
+//standard functions for new variant class
+CSTATDataFormatConverter::CSTATDataFormatConverter(CSTATLogFile *pLog)
+: bWriteToFile(true)
+{
+	vt = VT_BLOB;
+	    
+	BLOB* pBody = new BLOB;
+	byref = pBody;
+	pBody->pBlobData = m_index = new BYTE [16];	//16 is the default buffer size
+	pBody->cbSize = m_bufsize = 16;
+
+	// set up logging
+	pLogFile = pLog;
+
+	// reset bitmap structures
+	memset(&iPbmHeader, 0xff, sizeof(iPbmHeader));
+	memset(&fileheader, 0xff, sizeof(fileheader));
+	memset(&bmpHeader, 0xff, sizeof(bmpHeader));
+	pPbmBits = NULL;
+	bmpBits = NULL;
+	lDataSize = 0;
+}
+
+//-------------------------------------------------------------------------------
+
+//Destructor
+CSTATDataFormatConverter::~CSTATDataFormatConverter()
+{
+	BLOB* pBody = (BLOB*)byref;
+	if (pBody)
+	{
+		if (pBody->pBlobData) 
+			delete [] pBody->pBlobData;
+	
+		delete pBody;
+	}
+
+	if (pPbmBits)
+	{
+		delete [] pPbmBits;
+		pPbmBits = NULL;
+	}
+
+	if (bmpBits)
+	{
+		delete [] bmpBits;
+		bmpBits = NULL;
+	}
+}
+
+//----------------------------------------------------------------------------
+
+bool CSTATDataFormatConverter::ConvertStringToUnicode(CString& data)
+{
+	// clear the existing buffer
+	((BLOB*)byref)->cbSize = 0;
+
+	// length IN BYTES of the UNICODE result (not the TCHAR input)
+	UINT len = (data.GetLength() + 1) * 2;
+
+	// check that the buffer can hold the contents -- otherwise enlarge
+	EnsureBufSize( len );
+
+	// convert the input string to unicode
+	USES_CONVERSION;
+	LPWSTR wstr = T2W(data.GetBuffer(0));
+
+	// copy data into the buffer and set the size
+	memcpy( m_index, wstr, len);
+	((BLOB*)byref)->cbSize = len;
+
+	// done
+	return true;
+}
+
+//----------------------------------------------------------------------------
+
+void CSTATDataFormatConverter::EnsureBufSize(int size)
+{
+	if (size > m_bufsize)
+	{
+		BLOB* pBody = (BLOB*)byref;
+		BYTE* newbuf = new BYTE [size];
+		delete[] pBody->pBlobData;
+		m_index = pBody->pBlobData = newbuf;
+		m_bufsize = size;
+	}
+}
+
+//----------------------------------------------------------------------------
+//Converts from .mbm to .bmp
+int
+CSTATDataFormatConverter::ConvertScreenShot(CString &mbmdirectory, CString &destdir)
+{
+	CFileFind imagefinder;
+	CString searchpattern = mbmdirectory;
+	if (searchpattern.Right(1) != _T('\\'))
+		searchpattern += _T("\\");
+	searchpattern += "*.mbm";
+
+	// there will only ever be one file to be converted at a time
+	if (imagefinder.FindFile(searchpattern, 0))
+	{
+		imagefinder.FindNextFile();
+
+		// get the source filename (in quotes)
+		CString imagefilename = _T("\"");
+		imagefilename += imagefinder.GetFilePath();
+		imagefilename += _T("\"");
+
+		// get the destination folder (in quotes)
+		CString newimagefilename = _T("\"");
+		newimagefilename += destdir;
+
+		// add a backslash if we need one
+		if (newimagefilename.Right(1) != _T("\\"))
+			newimagefilename += _T("\\");
+
+		// add the filename
+		newimagefilename += imagefinder.GetFileName();
+		newimagefilename.Replace(_T(".mbm"), _T(".bmp"));
+		newimagefilename += _T("\"");
+		imagefinder.Close();
+
+		// remove dest file if it already exists
+		if(imagefinder.FindFile(newimagefilename, 0))
+		{
+			imagefinder.Close();
+			DeleteFile(newimagefilename);
+		}
+
+		imagefilename.Remove('\"');
+		newimagefilename.Remove('\"');
+
+		if (bWriteToFile)
+		{
+			pLogFile->Set(CONVERTINGIMAGE, imagefilename.GetBuffer(0));
+			pLogFile->Set(TO, newimagefilename.GetBuffer(0));
+		}
+		else
+			pLogFile->Set(READINGIMAGE, imagefilename.GetBuffer(0));
+
+		// convert the bitmap
+		int errorcode = LoadBitmap(imagefilename);
+		if (errorcode != ITS_OK)
+			return pLogFile->Set(E_BITMAPLOADFAILED, pLogFile->Text(errorcode));
+
+		if ((errorcode = SaveBitmap(newimagefilename)) != ITS_OK)
+			return pLogFile->Set(E_BITMAPSAVEFAILED, pLogFile->Text(errorcode));
+
+		DeleteFile(imagefilename);	//delete original .mbm image
+
+		// success
+		mbmdirectory = newimagefilename;
+
+		// log a message that desktop STAT can use to display bitmap
+		pLogFile->Set(SCREENSHOT_CONVERSION_OK, mbmdirectory, false, true);
+
+		return ITS_OK;
+	}
+
+	return pLogFile->Set(E_NOIMAGESTOCONVERT, searchpattern);
+}
+
+//----------------------------------------------------------------------------
+int CSTATDataFormatConverter::LoadBitmap(CString &file)
+{
+	// reset structures
+	memset(&iPbmHeader, 0xff, sizeof(iPbmHeader));
+	if (pPbmBits)
+	{
+		delete [] pPbmBits;
+		pPbmBits = NULL;
+	}
+
+	// open file
+	HANDLE infile;
+	if (INVALID_HANDLE_VALUE != (infile = CreateFile(file, 
+										   GENERIC_READ,
+										   FILE_SHARE_READ, 
+										   NULL, 
+										   OPEN_EXISTING,
+										   FILE_ATTRIBUTE_NORMAL,
+										   0)))
+	{
+		long int iBuffer;
+		DWORD dwBytesRead = 0;
+
+		// read the header to ensure it is a valid file
+		if (!ReadFile(infile, (LPVOID *)&iBuffer, 4, &dwBytesRead, NULL) ||
+			dwBytesRead != 4 || iBuffer != KWriteOnceFileStoreUid)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		if (!ReadFile(infile, (LPVOID *)&iBuffer, 4, &dwBytesRead, NULL) ||
+			dwBytesRead != 4 || iBuffer != KMultiBitmapFileImageUid)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		if (!ReadFile(infile, (LPVOID *)&iBuffer, 4, &dwBytesRead, NULL) ||
+			dwBytesRead != 4 || iBuffer != 0)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		if (!ReadFile(infile, (LPVOID *)&iBuffer, 4, &dwBytesRead, NULL) ||
+			dwBytesRead != 4 || iBuffer != KMultiBitmapFileImageChecksum)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		if (!ReadFile(infile, (LPVOID *)&iBuffer, 4, &dwBytesRead, NULL) ||
+			dwBytesRead != 4)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		// go back to offset from the beginning
+		if (SetFilePointer(infile, iBuffer, NULL, FILE_BEGIN) == 0xFFFFFFFF)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		// read the number of sources (in our case it will always be one)
+		if (!ReadFile(infile, (LPVOID *)&iBuffer, 4, &dwBytesRead, NULL) ||
+			dwBytesRead != 4)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		// read offset from the beginning of this bitmap
+		if (!ReadFile(infile, (LPVOID *)&iBuffer, 4, &dwBytesRead, NULL) ||
+			dwBytesRead != 4)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		// go back to offset from the beginning
+		if (SetFilePointer(infile, iBuffer, NULL, FILE_BEGIN) == 0xFFFFFFFF)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		// read in the header
+		DWORD dwSize = sizeof(SEpocBitmapHeader);
+		if (!ReadFile(infile, (LPVOID *)&iPbmHeader, dwSize, &dwBytesRead, NULL) || dwBytesRead != dwSize)
+		{
+			CloseHandle(infile);
+			return E_BADFORMAT;
+		}
+
+		dwSize = iPbmHeader.iBitmapSize - iPbmHeader.iStructSize;
+
+		// now read in the bitmap matrix
+		pPbmBits = new char[dwSize];
+		if (pPbmBits)
+		{
+			memset(pPbmBits, 0xff, dwSize);
+			if (!ReadFile(infile, (LPVOID *)pPbmBits, dwSize, &dwBytesRead, NULL) || dwBytesRead != dwSize)
+			{
+				CloseHandle(infile);
+				return E_BADFORMAT;
+			}
+
+			if (iPbmHeader.iCompression != ENoBitmapCompression)
+			{
+				int byteWidth = ByteWidth(iPbmHeader.iWidthInPixels, iPbmHeader.iBitsPerPixel);
+				int expandedsize = byteWidth * iPbmHeader.iHeightInPixels;
+				char* newbits = new char[expandedsize];
+				if (newbits)
+				{
+					memset(newbits,0xff,expandedsize);
+					int ret = ITS_OK;
+
+					switch (iPbmHeader.iCompression)
+					{
+						case EByteRLECompression:
+							ret = ExpandByteRLEData(newbits,expandedsize,pPbmBits, dwSize);
+							break;
+						case ETwelveBitRLECompression:
+							ret = ExpandTwelveBitRLEData(newbits,expandedsize,pPbmBits, dwSize);
+							break;
+						case ESixteenBitRLECompression:
+							ret = ExpandSixteenBitRLEData(newbits,expandedsize,pPbmBits, dwSize);
+							break;
+						case ETwentyFourBitRLECompression:
+							ret = ExpandTwentyFourBitRLEData(newbits,expandedsize,pPbmBits, dwSize);
+							break;
+						default:
+							delete [] pPbmBits;
+							return E_BADCOMPRESSION;
+							break;
+					}
+
+					delete [] pPbmBits;
+					pPbmBits = newbits;
+					iPbmHeader.iCompression = ENoBitmapCompression;
+					iPbmHeader.iBitmapSize += expandedsize - dwSize;
+				}
+				else
+				{
+					CloseHandle(infile);
+					return E_OUTOFMEM;
+				}
+			}
+
+			CloseHandle(infile);
+		}
+		else
+		{
+			CloseHandle(infile);
+			return E_OUTOFMEM;
+		}
+	}
+	else
+		return E_FILE_OPEN_READ_FAILED;
+
+	return ITS_OK;
+}
+
+bool
+CSTATDataFormatConverter::ExpandByteRLEData(char* aDest,int aDestSize,char* aSrce,int aSrceSize)
+{
+	char* srcelimit=aSrce+aSrceSize;
+	char* destlimit=aDest+aDestSize;
+	while(aSrce<srcelimit && aDest<destlimit)
+		{
+		char count=*aSrce++;
+		if (count<0)
+			{
+			int runLength=-count;
+			memcpy(aDest,aSrce,runLength);
+			aSrce+=runLength;
+			aDest+=runLength;
+			}
+		else
+			{
+			char value=*aSrce++;
+			while(count>=0)
+				{
+				*aDest++=value;
+				count--;
+				}
+			}
+		}
+	if (aSrce!=srcelimit || aDest!=destlimit)
+		return false;
+
+	return true;
+}
+
+bool
+CSTATDataFormatConverter::ExpandTwelveBitRLEData(char* aDest,int aDestSizeInBytes,char* aSrce,int aSrceSizeInBytes)
+{
+	unsigned short* srcePtr = (unsigned short*)aSrce;
+	unsigned short* destPtr = (unsigned short*)aDest;
+	unsigned short* srcePtrLimit = srcePtr + (aSrceSizeInBytes / 2);
+	unsigned short* destPtrLimit = destPtr + (aDestSizeInBytes / 2);
+
+	while (srcePtr < srcePtrLimit && destPtr < destPtrLimit)
+		{
+		unsigned short value = *srcePtr++;
+		int runLength = (value >> 12) + 1;
+		value &= 0x0fff;
+
+		for (;runLength > 0;runLength--)
+			*destPtr++ = value;
+		}
+
+	if (srcePtr != srcePtrLimit || destPtr != destPtrLimit)
+		return false;
+
+	return true;
+}
+
+bool
+CSTATDataFormatConverter::ExpandSixteenBitRLEData(char* aDest,int aDestSizeInBytes,char* aSrce,int aSrceSizeInBytes)
+{
+	char* srcePtrLimit = aSrce + aSrceSizeInBytes;
+	unsigned short* destPtr = (unsigned short*)aDest;
+	unsigned short* destPtrLimit = destPtr + (aDestSizeInBytes / 2);
+
+	while (aSrce < srcePtrLimit && destPtr < destPtrLimit)
+		{
+		int runLength = *aSrce++;
+
+		if (runLength >= 0)
+			{
+			unsigned short value = *((unsigned short*)(aSrce));
+			aSrce += 2;
+			for (runLength++; runLength > 0; runLength--)
+				*destPtr++ = value;
+			}
+		else
+			{
+			runLength = -runLength;
+			int byteLength = runLength * 2;
+			memcpy(destPtr,aSrce,byteLength);
+			aSrce += byteLength;
+			destPtr += runLength;
+			}
+		}
+
+	if (aSrce != srcePtrLimit || destPtr != destPtrLimit)
+		return false;
+
+	return true;
+}
+
+bool
+CSTATDataFormatConverter::ExpandTwentyFourBitRLEData(char* aDest,int aDestSizeInBytes,char* aSrce,int aSrceSizeInBytes)
+{
+	char* srcePtrLimit = aSrce + aSrceSizeInBytes;
+	char* destPtrLimit = aDest + aDestSizeInBytes;
+
+	while (aSrce < srcePtrLimit && aDest < destPtrLimit)
+		{
+		int runLength = *aSrce++;
+
+		if (runLength >= 0)
+			{
+			char component1 = *aSrce++;
+			char component2 = *aSrce++;
+			char component3 = *aSrce++;
+			for (runLength++; runLength > 0; runLength--)
+				{
+				*aDest++ = component1;
+				*aDest++ = component2;
+				*aDest++ = component3;
+				}
+			}
+		else
+			{
+			runLength = -runLength;
+			int byteLength = runLength * 3;
+			memcpy(aDest,aSrce,byteLength);
+			aSrce += byteLength;
+			aDest += byteLength;
+			}
+		}
+
+	if (aSrce != srcePtrLimit || aDest != destPtrLimit)
+		return false;
+
+	return true;
+}
+
+int
+CSTATDataFormatConverter::SaveBitmap(CString &newfilename)
+{
+	// reset structures
+	memset(&fileheader, 0xff, sizeof(fileheader));
+	memset(&bmpHeader, 0xff, sizeof(bmpHeader));
+	if (bmpBits)
+	{
+		delete [] bmpBits;
+		bmpBits = NULL;
+	}
+	lDataSize = 0;
+
+	// copy header info into BMP structures
+	bmpHeader.biSize = sizeof(TBitmapInfoHeader);
+	bmpHeader.biWidth = iPbmHeader.iWidthInPixels;
+	bmpHeader.biHeight = iPbmHeader.iHeightInPixels;
+	bmpHeader.biPlanes = 1;
+	bmpHeader.biBitCount = 24;
+	bmpHeader.biCompression = 0;
+	bmpHeader.biSizeImage = 0;
+	bmpHeader.biXPelsPerMeter = 0;
+	bmpHeader.biYPelsPerMeter = 0;
+	bmpHeader.biClrUsed = 0;
+	bmpHeader.biClrImportant = 0;
+
+	long byteWidth = ((bmpHeader.biWidth * 3) + 3) & ~3;
+	lDataSize = bmpHeader.biHeight * byteWidth;
+
+	fileheader.bfType = 'B'+('M'<<8);
+	fileheader.bfSize = sizeof(TBitmapFileHeader)+sizeof(TBitmapInfoHeader) + lDataSize;
+	fileheader.bfReserved1 = 0;
+	fileheader.bfReserved2 = 0;
+	fileheader.bfOffBits = sizeof(TBitmapFileHeader)+sizeof(TBitmapInfoHeader);
+
+	// copy BMP data
+	bmpBits = new char[lDataSize];
+	if (!bmpBits)
+		return E_OUTOFMEM;
+
+	memset(bmpBits,0xff,lDataSize);
+
+	for(long y=0;y<bmpHeader.biHeight;y++)
+	{
+		char* dest=&bmpBits[(bmpHeader.biHeight-y-1)*byteWidth];
+		for(long x=0;x<bmpHeader.biWidth;x++)
+		{
+			TRgb pixel=GetPixel(x,y);
+			*dest++=pixel.iBlue;
+			*dest++=pixel.iGreen;
+			*dest++=pixel.iRed;
+		}
+	}
+
+	int ret = ITS_OK;
+	if (bWriteToFile)
+	{
+		// write the whole lot out to file
+		HANDLE infile;
+		if (INVALID_HANDLE_VALUE != (infile = CreateFile(newfilename, 
+											   GENERIC_WRITE,
+											   0, 
+											   NULL, 
+											   CREATE_ALWAYS,
+											   FILE_ATTRIBUTE_NORMAL,
+											   0)))
+		{
+			DWORD dwBytesWritten = 0;
+
+			// read the header to ensure it is a valid file
+			if (WriteFile(infile, (LPVOID *)&fileheader, sizeof(TBitmapFileHeader), &dwBytesWritten, NULL) &&
+				dwBytesWritten == sizeof(TBitmapFileHeader))
+			{
+				// read the header to ensure it is a valid file
+				if (WriteFile(infile, (LPVOID *)&bmpHeader, sizeof(TBitmapInfoHeader), &dwBytesWritten, NULL) &&
+					dwBytesWritten == sizeof(TBitmapInfoHeader))
+				{
+					if (WriteFile(infile, (LPVOID *)bmpBits, lDataSize, &dwBytesWritten, NULL) &&
+						dwBytesWritten == lDataSize)
+					{
+						ret = ITS_OK;
+					}
+					else
+						ret = E_BADWRITE;
+				}
+				else
+					ret = E_BADWRITE;
+			}
+			else
+				ret = E_BADWRITE;
+
+			CloseHandle(infile);
+		}
+		else
+			ret = E_FILE_OPEN_WRITE_FAILED;
+	}
+
+	return ret;
+}
+
+TRgb
+CSTATDataFormatConverter::GetPixel(int aXCoord,int aYCoord)
+{
+	unsigned char col;
+	aXCoord%=iPbmHeader.iWidthInPixels;
+	aYCoord%=iPbmHeader.iHeightInPixels;
+	int byteWidth = ByteWidth(iPbmHeader.iWidthInPixels,iPbmHeader.iBitsPerPixel);
+	int yOffset = aYCoord * byteWidth;
+
+	switch(iPbmHeader.iBitsPerPixel)
+	{
+		case 1:
+			col = pPbmBits[yOffset + (aXCoord / 8)];
+			col >>= (aXCoord&7);
+			return TRgb::Gray2(col & 1);
+		case 2:
+			col = pPbmBits[yOffset + (aXCoord / 4)];
+			col = (unsigned char)(col>>(2*(aXCoord%4)));
+			return TRgb::Gray4(col & 3);
+		case 4:
+			col = pPbmBits[yOffset + (aXCoord / 2)];
+			if (aXCoord & 1)
+				col >>= 4;
+			col &= 0xf;
+			if (iPbmHeader.iColor==EColorBitmap)
+				return TRgb::Color16(col);
+			else
+				return TRgb::Gray16(col);
+		case 8:
+			col=pPbmBits[yOffset + aXCoord];
+			if (iPbmHeader.iColor==EColorBitmap)
+				return TRgb::Color256(col);
+			else
+				return TRgb::Gray256(col);
+		case 12:
+		case 16:
+		{
+			unsigned short* shortPtr = (unsigned short*)&pPbmBits[yOffset + (aXCoord * 2)];
+			if (iPbmHeader.iBitsPerPixel == 12)
+				return TRgb::Color4K(*shortPtr);
+			else
+				return TRgb::Color64K(*shortPtr);
+		}
+		case 24:
+		{
+			char* pixelPtr = pPbmBits + yOffset + (aXCoord * 3);
+			TRgb pixelColor;
+			pixelColor.iBlue = *pixelPtr++;
+			pixelColor.iGreen = *pixelPtr++;
+			pixelColor.iRed = *pixelPtr;
+			return pixelColor;
+		}
+		default:
+			return TRgb(0);
+	}
+}
+
+int
+CSTATDataFormatConverter::ByteWidth(int aPixelWidth,int aBitsPerPixel)
+{
+	int wordWidth = 0;
+
+	switch (aBitsPerPixel)
+	{
+	case 1:
+		wordWidth = (aPixelWidth + 31) / 32;
+		break;
+	case 2:
+		wordWidth = (aPixelWidth + 15) / 16;
+		break;
+	case 4:
+		wordWidth = (aPixelWidth + 7) / 8;
+		break;
+	case 8:
+		wordWidth = (aPixelWidth + 3) / 4;
+		break;
+	case 12:
+	case 16:
+		wordWidth = (aPixelWidth + 1) / 2;
+		break;
+	case 24:
+		wordWidth = (((aPixelWidth * 3) + 11) / 12) * 3;
+		break;
+	default:
+		break;
+	};
+
+	return wordWidth * 4;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/cstatimageverify.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,678 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include <STATCommon.h>
+#include "CSTATImageVerify.h"
+
+//----------------------------------------------------------------------------
+//standard constructor
+CSTATImageVerify::CSTATImageVerify(CSTATLogFile *pLog)
+: iImageCount(0), margin(0), lastrefimageloaded(0), pLogFile(pLog),
+  m_pDib(NULL), m_pDib2(NULL), m_pDibBits(NULL), m_pDibBits2(NULL),
+  m_pBIH(NULL), m_pBIH2(NULL), m_pPalette(NULL), m_pPalette2(NULL),
+  m_dwDibSize(0), m_dwDibSize2(0), m_nPaletteEntries(0), m_nPaletteEntries2(0)
+{
+}
+
+//----------------------------------------------------------------------------
+//destructor
+CSTATImageVerify::~CSTATImageVerify()
+{
+	if (m_pDib)
+	{
+		delete [] m_pDib;
+		m_pDib = NULL;
+	}
+
+	if (m_pDib2)
+	{
+		delete [] m_pDib2;
+		m_pDib2 = NULL;
+	}
+}
+
+//----------------------------------------------------------------------------
+
+//image verification function (loading + blitting)
+int CSTATImageVerify::VerifyImage(CString& lastscreenshot)	
+{
+	TCHAR buffer[70];
+	_stprintf(buffer, _T("User set margin of error (percentage) : %ld"), margin);
+
+	pLogFile->Set(START_VERIFICATION, buffer);
+
+	// make sure we've got at least 1 image left
+	if(ImagesRemaining())
+	{
+		if(LoadRefImage())
+			pLogFile->Set(REFIMAGELOAD_OK, refimagearray[lastrefimageloaded++].completefilenamepath);
+		else
+			return pLogFile->Set(REFIMAGELOAD_FAILURE);
+
+		Sleep(500);
+
+		if(LoadNewImage(lastscreenshot))
+			pLogFile->Set(NEWIMAGELOAD_OK);
+		else
+			return pLogFile->Set(NEWIMAGELOAD_FAILURE);
+	}
+	else
+		return pLogFile->Set(REFIMAGELOAD_FAILURE_LIMIT);	//run out of reference images
+
+	//compare images and decide if difference is greater than margin value set earlier
+
+	// If we have not data we can't draw.
+	if (!m_pDib2)
+		return pLogFile->Set(VERIFICATION_FAILURE);
+
+	//set width and height of images
+	int nWidth = m_pBIH2 -> biWidth;
+	int nHeight = m_pBIH2 -> biHeight;
+
+	HDC hdc, hMaskDC, hImageDC;
+	HBITMAP hMaskBitmap, hImageBitmap;
+
+	hdc = GetDC(NULL);
+
+	//---------------------
+
+	hMaskDC = CreateCompatibleDC(hdc);
+	hImageDC = CreateCompatibleDC(hdc);
+	
+	hMaskBitmap = CreateCompatibleBitmap(hdc, nWidth, nHeight);
+	
+	SelectObject(hMaskDC, hMaskBitmap);
+	SetTextColor(hMaskDC, RGB(0, 0, 255)); 
+
+	//---------------------
+
+	hImageBitmap = CreateCompatibleBitmap(hdc, nWidth, nHeight);
+
+	// release the object now we're finished with it
+	ReleaseDC(NULL, hdc);
+
+	SelectObject(hImageDC, hImageBitmap);
+	SetTextColor(hImageDC, RGB(0, 0, 255)); 
+
+	//---------------------
+
+	//set MaskBitmap pixel data to that of the original DIB
+	SetDIBits(hMaskDC, hMaskBitmap, 0L, nHeight, m_pDibBits, (BITMAPINFO *)m_pBIH, (DWORD)DIB_RGB_COLORS);
+	
+	//create a new DIB using second image data
+	SetDIBits(hImageDC, hImageBitmap, 0L, nHeight, m_pDibBits2, (BITMAPINFO *)m_pBIH2, (DWORD)DIB_RGB_COLORS);
+
+	//XOR new image with original image (so new pic on top of pic 2)
+	BitBlt(hMaskDC, 0, 0, nWidth, nHeight, hImageDC, 0, 0, SRCINVERT);
+
+	//***************************************************
+
+	//now work on percentage difference in images
+
+	//need to use 'new' otherwise you get a stack overflow with anything big like this (1MB+)
+	COLORREF (*pixelcoord) [480];
+	pixelcoord = new COLORREF [640][480];
+	if (!pixelcoord)
+		return pLogFile->Set(VERIFICATION_FAILURE);
+
+	int x, y, myheight, mywidth;
+	float totalpixelarea;
+
+	x = 0;
+	y = 0;
+	int difference = 0;
+	float finalpercentage = 0;
+	totalpixelarea = 0;
+	myheight = 0;
+	mywidth = 0;
+
+	mywidth = m_pBIH -> biWidth;
+	myheight = m_pBIH -> biHeight;
+
+	// convert total to float for later % calculation
+	totalpixelarea = (float)(mywidth * myheight);
+
+	//initialisation
+	for(y = 0; y < 480; y++)
+	{
+		//go across picture left to right at each line
+		for(x = 0; x < 640; x++)
+		{
+			//get colorref value from coordinates
+			pixelcoord[x][y] = 0;
+		}
+	}
+
+	//check pixels - start at line 0
+	for(y = 0; y < myheight; y++)
+	{
+		//go across picture left to right at each line
+		for(x = 0; x < mywidth; x++)
+		{
+			//get colorref value from coordinates
+			pixelcoord[x][y] = GetPixel(hMaskDC, x, y);
+
+			//if not a  black pixel then increment counter
+			if(pixelcoord[x][y] != 0)
+			{
+				difference++;
+			}
+		}
+	}
+
+	// release resources
+	delete [] pixelcoord;
+	DeleteDC(hMaskDC);
+	DeleteDC(hImageDC);
+	DeleteObject(hMaskBitmap);
+	DeleteObject(hImageBitmap);
+
+	if (m_pDib)
+	{
+		delete [] m_pDib;
+		m_pDib = NULL;
+	}
+
+	if (m_pDib2)
+	{
+		delete [] m_pDib2;
+		m_pDib2 = NULL;
+	}
+
+	//now calculate percentage of pic that is not black
+	finalpercentage = ((difference / totalpixelarea) * 100);
+
+	// write conversion info to file
+
+
+	CString cBuffer;
+	cBuffer.Format(_T("Margin %ld : Difference %f"), margin, finalpercentage);
+	pLogFile->Set(cBuffer);
+
+	if(finalpercentage > margin)
+		return pLogFile->Set(VERIFICATION_FAILURE);
+
+	return pLogFile->Set(VERIFICATION_PASS);
+}
+
+
+//----------------------------------------------------------------------------
+//image loading for current new image
+bool CSTATImageVerify::LoadNewImage(CString& newimage)
+{
+	CFile cf;
+
+	// Attempt to open the Dib file for reading.
+	if(!cf.Open(newimage, CFile::modeRead))
+		return false;
+
+	// Get the size of the file and store
+	// in a local variable. Subtract the
+	// size of the BITMAPFILEHEADER structure
+	// since we won't keep that in memory.
+	DWORD dwDibSize;
+	dwDibSize = cf.GetLength() - sizeof( BITMAPFILEHEADER );
+
+	// Attempt to allocate the Dib memory.
+	unsigned char *pDib;
+	pDib = new unsigned char [dwDibSize];
+	if(!pDib)
+	{
+		cf.Close();
+		return false;
+	}
+
+	BITMAPFILEHEADER BFH;
+
+	// Read in the Dib header and data.
+	try
+	{
+		// Did we read in the entire BITMAPFILEHEADER?
+		if( cf.Read( &BFH, sizeof( BITMAPFILEHEADER ) )
+			!= sizeof( BITMAPFILEHEADER ) ||
+
+			// Is the type 'MB'?
+			BFH.bfType != 'MB' ||
+
+			// Did we read in the remaining data?
+			cf.Read( pDib, dwDibSize ) != dwDibSize )
+		{
+
+			// Delete the memory if we had any
+			// errors and return FALSE.
+			delete [] pDib;
+			cf.Close();
+			return false;
+			}
+		}
+
+	// If we catch an exception, delete the
+	// exception, the temporary Dib memory,
+	// and return FALSE.
+	catch( CFileException *e )
+	{
+		e->Delete();
+		delete [] pDib;
+		cf.Close();
+		return( FALSE );
+	}
+	
+	// If we got to this point, the Dib has been
+	// loaded. If a Dib was already loaded into
+	// this class, we must now delete it.
+	if (m_pDib2)
+	{
+		delete [] m_pDib2;
+		m_pDib2 = NULL;
+	}
+
+	// Store the local Dib data pointer and
+	// Dib size variables in the class member
+	// variables.
+	m_pDib2 = pDib;
+	m_dwDibSize2 = dwDibSize;
+
+	// Pointer our BITMAPINFOHEADER and RGBQUAD
+	// variables to the correct place in the Dib data.
+	m_pBIH2 = (BITMAPINFOHEADER *) m_pDib2;
+	m_pPalette2 =
+		(RGBQUAD *) &m_pDib2[sizeof(BITMAPINFOHEADER)];
+
+	// Calculate the number of palette entries.
+	m_nPaletteEntries = 1 << m_pBIH2->biBitCount;
+	if( m_pBIH2->biBitCount > 8 )
+		m_nPaletteEntries = 0;
+	else if( m_pBIH2->biClrUsed != 0 )
+		m_nPaletteEntries = m_pBIH2->biClrUsed;
+
+	// Point m_pDib2Bits to the actual Dib bits data.
+	m_pDibBits2 =
+		&m_pDib2[sizeof(BITMAPINFOHEADER)+
+			m_nPaletteEntries*sizeof(RGBQUAD)];
+
+	// If we have a valid palette, delete it.
+	if( m_Palette.GetSafeHandle() != NULL )
+		m_Palette.DeleteObject();
+
+	// If there are palette entries, we'll need
+	// to create a LOGPALETTE then create the
+	// CPalette palette.
+	if( m_nPaletteEntries != 0 )
+	{
+		// Allocate the LOGPALETTE structure.
+		LOGPALETTE *pLogPal = (LOGPALETTE *) new char [sizeof(LOGPALETTE) + m_nPaletteEntries*sizeof(PALETTEENTRY)];
+		if (pLogPal)
+		{
+			// Set the LOGPALETTE to version 0x300
+			// and store the number of palette
+			// entries.
+			pLogPal->palVersion = 0x300;
+			pLogPal->palNumEntries = (WORD)m_nPaletteEntries;
+
+			// Store the RGB values into each
+			// PALETTEENTRY element.
+			for( int i=0; i<m_nPaletteEntries; i++ )
+			{
+				pLogPal->palPalEntry[i].peRed =
+					m_pPalette2[i].rgbRed;
+				pLogPal->palPalEntry[i].peGreen =
+					m_pPalette2[i].rgbGreen;
+				pLogPal->palPalEntry[i].peBlue =
+					m_pPalette2[i].rgbBlue;
+			}
+
+			// Create the CPalette object and
+			// delete the LOGPALETTE memory.
+			m_Palette.CreatePalette( pLogPal );
+			delete [] pLogPal;
+		}
+		else
+			return false;
+	}
+
+	cf.Close();
+
+	return true;
+}
+
+//----------------------------------------------------------------------------
+//image loading for current reference image
+bool CSTATImageVerify::LoadRefImage()
+{
+	CFile cf;
+	if( !cf.Open(refimagearray[lastrefimageloaded].completefilenamepath, CFile::modeRead ) )
+		return false;
+
+	// Get the size of the file and store
+	// in a local variable. Subtract the
+	// size of the BITMAPFILEHEADER structure
+	// since we won't keep that in memory.
+	DWORD dwDibSize;
+	dwDibSize = cf.GetLength() - sizeof( BITMAPFILEHEADER );
+
+	// Attempt to allocate the Dib memory.
+	unsigned char *pDib;
+	pDib = new unsigned char [dwDibSize];
+	if(!pDib)
+	{
+		cf.Close();
+		return false;
+	}
+
+	BITMAPFILEHEADER BFH;
+
+	// Read in the Dib header and data.
+	try
+	{
+
+		// Did we read in the entire BITMAPFILEHEADER?
+		if( cf.Read( &BFH, sizeof( BITMAPFILEHEADER ) )
+			!= sizeof( BITMAPFILEHEADER ) ||
+
+			// Is the type 'MB'?
+			BFH.bfType != 'MB' ||
+
+			// Did we read in the remaining data?
+			cf.Read( pDib, dwDibSize ) != dwDibSize )
+		{
+
+			// Delete the memory if we had any
+			// errors and return FALSE.
+			delete [] pDib;
+			cf.Close();
+			return false;
+		}
+	}
+
+	// If we catch an exception, delete the
+	// exception, the temporary Dib memory,
+	// and return FALSE.
+	catch( CFileException *e )
+	{
+		e->Delete();
+		delete [] pDib;
+		cf.Close();
+		return false;
+	}
+	
+	// If we got to this point, the Dib has been
+	// loaded. If a Dib was already loaded into
+	// this class, we must now delete it.
+	if(m_pDib)
+	{
+		delete m_pDib;
+		m_pDib = NULL;
+	}
+
+	// Store the local Dib data pointer and
+	// Dib size variables in the class member
+	// variables.
+	m_pDib = pDib;
+	m_dwDibSize = dwDibSize;
+
+	// Pointer our BITMAPINFOHEADER and RGBQUAD
+	// variables to the correct place in the Dib data.
+	m_pBIH = (BITMAPINFOHEADER *) m_pDib;
+	m_pPalette =
+		(RGBQUAD *) &m_pDib[sizeof(BITMAPINFOHEADER)];
+
+	// Calculate the number of palette entries.
+	m_nPaletteEntries = 1 << m_pBIH->biBitCount;
+	if( m_pBIH->biBitCount > 8 )
+		m_nPaletteEntries = 0;
+	else if( m_pBIH->biClrUsed != 0 )
+		m_nPaletteEntries = m_pBIH->biClrUsed;
+
+	// Point m_pDibBits to the actual Dib bits data.
+	m_pDibBits =
+		&m_pDib[sizeof(BITMAPINFOHEADER)+
+			m_nPaletteEntries*sizeof(RGBQUAD)];
+
+	// If we have a valid palette, delete it.
+	if (m_Palette.GetSafeHandle())
+		m_Palette.DeleteObject();
+
+	// If there are palette entries, we'll need
+	// to create a LOGPALETTE then create the
+	// CPalette palette.
+	if( m_nPaletteEntries != 0 )
+	{
+		// Allocate the LOGPALETTE structure.
+		LOGPALETTE *pLogPal = (LOGPALETTE *) new char
+				[sizeof(LOGPALETTE)+
+				m_nPaletteEntries*sizeof(PALETTEENTRY)];
+
+		if(pLogPal)
+		{
+
+			// Set the LOGPALETTE to version 0x300
+			// and store the number of palette
+			// entries.
+			pLogPal->palVersion = 0x300;
+			pLogPal->palNumEntries = (WORD)m_nPaletteEntries;
+
+			// Store the RGB values into each
+			// PALETTEENTRY element.
+			for( int i=0; i<m_nPaletteEntries; i++ )
+			{
+				pLogPal->palPalEntry[i].peRed =
+					m_pPalette[i].rgbRed;
+				pLogPal->palPalEntry[i].peGreen =
+					m_pPalette[i].rgbGreen;
+				pLogPal->palPalEntry[i].peBlue =
+					m_pPalette[i].rgbBlue;
+			}
+
+			// Create the CPalette object and
+			// delete the LOGPALETTE memory.
+			m_Palette.CreatePalette( pLogPal );
+			delete [] pLogPal;
+		}
+		else
+			return false;
+	}
+
+	cf.Close();
+
+	return true;
+}
+
+//----------------------------------------------------------------------------
+int CSTATImageVerify::EnableVerification(int fudge)
+{
+	// temp variable
+	FILETIME creationtime;
+	creationtime.dwLowDateTime = 0;
+	creationtime.dwHighDateTime = 0;
+
+	// initialise settings
+	iImageCount = 0;
+	lastrefimageloaded = 0;
+	margin = fudge;
+
+	// check limits
+	if (margin < 0)
+		margin = 0;
+	if (margin > 100)
+		margin = 100;
+
+	// populate our array with images
+	CFileFind refimagefinder;
+	if (refimagefinder.FindFile(referenceimagedir + _T("\\*.bmp"), 0))
+	{
+		int i = 0;
+		int iMoreFiles = true;
+		for (i=0;i<VERIFY_MAX_IMAGES;i++)
+		{
+			if (iMoreFiles)
+			{
+				iMoreFiles = refimagefinder.FindNextFile();
+  				refimagearray[i].completefilenamepath = refimagefinder.GetFilePath();	//store filename into array string variable
+				refimagefinder.GetLastWriteTime(&creationtime);		//store corresponding modification time
+				refimagearray[i].lCreationTime = (((ULONGLONG) creationtime.dwHighDateTime) << 32) + creationtime.dwLowDateTime;
+				iImageCount++;
+			}
+			else
+			{
+				refimagearray[i].completefilenamepath = _T("");
+				refimagearray[i].lCreationTime = 0;
+			}
+		}
+
+		refimagefinder.Close();
+	}
+	
+	// now sort into date/time order
+	if (iImageCount)
+	{
+		CSTATReferenceImages temp;
+		bool bNotFinished = true;
+		int i = 0;
+		while (bNotFinished)
+		{
+			bNotFinished = false;
+			for (i=0;i<iImageCount;i++)
+			{
+				if ((i + 1) < iImageCount &&
+					refimagearray[i+1].lCreationTime < refimagearray[i].lCreationTime)
+				{
+					temp = refimagearray[i];
+					refimagearray[i]= refimagearray[i+1];
+					refimagearray[i+1]= temp;
+					bNotFinished = true;
+				}
+			}
+		}
+	}
+
+	return iImageCount;
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Get the local reference image directory from the registry
+int CSTATImageVerify::Initialise(const CString& path)
+{
+	int ret = ERROR_REGISTRY;
+	TCHAR szFullPath[256 + 1];
+
+
+	_tcsncpy(szFullPath, path.operator LPCTSTR(), path.GetLength() + 1);
+	
+	//append ref images directory to the stat installation directory as found in registry
+	_tcscat(szFullPath, _T("\\Reference Images"));
+	referenceimagedir = szFullPath;
+
+	// try to create in case it doesn't exist
+	CreateDirectory(referenceimagedir, NULL);
+
+	// there may be old files to delete...
+	_tcscat(szFullPath, _T("\\*.*"));
+	CFileFind finder;
+	if (finder.FindFile(szFullPath, 0))
+	{
+		int iWorking = 1;
+		int filecount = 0;
+		while (iWorking)
+		{
+			iWorking = finder.FindNextFile();
+
+			// skip . and .. files
+			if (finder.IsDots())
+				continue;
+
+			filecount++;
+		}
+
+		finder.Close();
+
+		if (filecount)
+			ret = REFDIR_FOUND;
+		else
+			ret = ITS_OK;
+	}
+	else
+		ret = LOG_DIR_CREATE_FAILURE;
+	
+	
+	
+	return ret;
+}
+
+//----------------------------------------------------------------------------
+//reference images copied over to local machine
+int CSTATImageVerify::CopyReferenceImages(LPTSTR refimagelocation)
+{
+	int ret = GENERAL_FAILURE;
+
+	// need to copy into null terminated string to have 2 nulls at end as required
+	TCHAR szFrom[MAX_PATH + 1] = {0};
+	_tcscpy(szFrom, refimagelocation);
+	_tcscat(szFrom, _T("\\*.bmp"));
+
+	// need to copy into null terminated string to have 2 nulls at end as required
+	TCHAR szTo[MAX_PATH + 1] = {0};
+	_tcscpy(szTo, referenceimagedir);
+
+	//new file structure for copying files
+	SHFILEOPSTRUCT fo = {0};
+	fo.wFunc = FO_COPY;
+	fo.pFrom = szFrom;
+	fo.pTo = szTo;
+	fo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT;
+
+	//copy new images across
+	if(::SHFileOperation(&fo) != 0) //if fail file operation
+		return ERR_FILE_COPY_FAILED;
+
+	// check that at least 1 bitmap image got copied across
+	_tcscat(szTo, _T("\\*.bmp"));
+	CFileFind finder;
+	ret = finder.FindFile(szTo, 0);
+	finder.Close();
+	if (!ret)
+		return NO_BITMAPS;
+
+	return ITS_OK;
+}
+
+//----------------------------------------------------------------------------
+//local reference images deleted from local machine
+int CSTATImageVerify::DeleteReferenceImages()
+{
+	// need to copy into null terminated string to have 2 nulls at end as required
+	TCHAR szImages[MAX_PATH + 1] = {0};
+	_tcscpy(szImages, referenceimagedir);
+	_tcscat(szImages, _T("\\*.*"));
+	
+	//new file structure for deleting files
+	SHFILEOPSTRUCT fo2 = {0};
+	fo2.wFunc = FO_DELETE;
+	fo2.pFrom = szImages;
+	fo2.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_FILESONLY | FOF_NOERRORUI;
+
+	//delete
+	if(::SHFileOperation(&fo2) != 0) //if fail file deletion
+		return DELETEIMAGES_FAILURE;
+
+	return ITS_OK;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/cstatlogfile.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,387 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "CSTATLogFile.h"
+#include <statcommon.h>
+
+//----------------------------------------------------------------------------
+// our thread-safe mechanism - this must be defined, initialised and destroyed by
+// the code using CSTATEngine.  See STATExp.cpp for an example
+extern CRITICAL_SECTION CriticalSection;
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+//standard constructor
+CSTATLogFile::CSTATLogFile()
+: bMessageBox(false), bMessage(false), bWriteToScreen(false), bWriteToFile(false), bScreenshot(false),
+	iMessageReporter(NULL)
+{
+	message = _T("");
+	text = _T("");
+	*(szLogPrefix) = (char)0;
+}
+
+//----------------------------------------------------------------------------
+//destructor
+CSTATLogFile::~CSTATLogFile()
+{
+	CloseLogFile();
+}
+
+
+//----------------------------------------------------------------------------
+// opens (creates) logfile
+int CSTATLogFile::CreateLogFile(const CString& newlogfilename,const CString& defaultPath, const char* prefix, bool append, bool bMessages, bool bFile)
+{
+	// set flags to write to dialog screen/file
+	bWriteToScreen = bMessages;
+	bWriteToFile = bFile;
+
+	// construct our log file
+	if (bWriteToFile)
+	{
+		EnterCriticalSection(&CriticalSection);
+
+		// in case it's already open
+		CloseLogFile();
+
+		int position;
+		UINT openFlags = CFile::modeCreate | CFile::modeWrite | CFile::shareDenyNone;
+
+		// if newlogfilename contains a path, use it otherwise get the default log directory
+		position = newlogfilename.ReverseFind('\\');
+		if (position != -1)
+		{
+			Logfilename = newlogfilename;
+			CreateDirectory(Logfilename.Left(position), NULL); // try to create directory just in case
+		}
+		else
+		{
+			Logfilename=defaultPath;
+			if (Logfilename[Logfilename.GetLength() - 1] != _T('\\'))
+				Logfilename += _T("\\");
+
+			Logfilename += newlogfilename;
+			CreateDirectory(Logfilename, NULL); // try to create directory just in case
+		}
+
+		// just path supplied, add a filename
+		if (Logfilename[Logfilename.GetLength() - 1] == _T('\\'))
+		{
+			char FormattedDate[12] = {0};
+			Logfilename += _T("STAT");
+			Logfilename += _strdate(FormattedDate);		// ...\\filename is now 'STATmm/dd/yy'
+			Logfilename.Remove('/');					// ...\\filename is now 'STATmmddyy'
+		}
+
+		// add extension if not supplied
+		if(Logfilename.ReverseFind('.') == -1)
+			Logfilename += _T(".log");
+
+		// if not append, create a new file every time, renaming with (1),(2)...(n) as needed
+		CFileFind finder;
+		if (!append)
+		{
+			CString tempLogfile, tempLogstart, tempLogend;
+			char szCopycount[15] = {0};
+			int iCopycount = 1;
+
+			// save various bits
+			tempLogfile = Logfilename;
+			position = tempLogfile.ReverseFind('.');
+			tempLogstart = tempLogfile.Left(position);
+			tempLogend = Logfilename.Right(Logfilename.GetLength() - position);
+
+			while (finder.FindFile(tempLogfile, 0))
+			{
+				if (position > 0)
+				{
+					tempLogfile = tempLogstart;
+					tempLogfile += "(";
+					tempLogfile += itoa(iCopycount++, szCopycount, 10);
+					tempLogfile += ")";
+					tempLogfile += tempLogend;
+				}
+				finder.Close();
+			}					
+
+			// assign new filename
+			Logfilename = tempLogfile;
+		}
+		else
+		{
+			// if it already exists, open simple in case other handles are open on it
+			if (finder.FindFile(Logfilename, 0))
+			{
+				openFlags = CFile::modeWrite | CFile::shareDenyNone;
+				finder.Close();
+			}
+		}
+
+		// open the file
+		int valid = logfile.Open(Logfilename, openFlags);
+		if (valid)
+		{
+			logfile.SeekToEnd();
+			if (prefix && *prefix)
+			{
+				strcpy(szLogPrefix, "  ");
+				strcat(szLogPrefix, prefix);
+			}
+		}
+
+		LeaveCriticalSection(&CriticalSection);
+
+		if (!valid)
+			return LOG_FILE_FAILURE;
+	}
+
+	return LOG_FILE_OK;
+}
+
+//----------------------------------------------------------------------------
+// Specifies the message handler.
+void CSTATLogFile::SetMessageReporter(MessageReporter *const messageReporter)
+{
+	iMessageReporter =	messageReporter;
+}
+
+//----------------------------------------------------------------------------
+// sets a log message
+void
+CSTATLogFile::WriteTimeToLog()
+{
+	if (logfile.m_hFile != CFile::hFileNull)
+	{
+		EnterCriticalSection(&CriticalSection);
+
+		// get the time
+		time_t aclock;
+		time(&aclock);
+		CString cBuf = asctime(localtime(&aclock));
+		int position = cBuf.Find(_T('\n')); // remove the carriage return from the end
+		if (position != -1)
+			cBuf.SetAt(position, 0);
+
+		Write("--------------------------------------------------\r\n");
+		Write(FormatText(cBuf));
+
+		logfile.Flush();
+
+		LeaveCriticalSection(&CriticalSection);
+	}
+}
+
+
+//----------------------------------------------------------------------------
+// writes CString directly to the log file
+void
+CSTATLogFile::Write(CString cBuf)
+{
+	Write(FormatText(cBuf));
+}
+
+
+//----------------------------------------------------------------------------
+//writes basic text directly to the log file
+void CSTATLogFile::Write(char *szText, ...)
+{
+	if (logfile.m_hFile != CFile::hFileNull)
+	{
+		EnterCriticalSection(&CriticalSection);
+
+		static char szMessage[MAX_LOG_MSG_LEN + 1];
+		static time_t curTime;
+
+		logfile.SeekToEnd();
+		logfile.Write(szLogPrefix, strlen(szLogPrefix));
+
+		// write the date/time
+		time ( &curTime );
+		strftime ( szMessage, 
+					sizeof ( szMessage ), 
+					"%d/%m %H:%M:%S ",
+					localtime ( &curTime ) );
+		logfile.Write(szMessage, strlen(szMessage));
+
+		// write the message
+		memset(&szMessage, 0, sizeof(szMessage));
+		va_list pCurrent = (va_list)0;
+		va_start (pCurrent, szText);
+		vsprintf (szMessage, szText, pCurrent);
+		va_end (pCurrent);
+		logfile.Write(szMessage, strlen(szMessage));
+
+		// add a CRLF if there isn't one already
+		if (strlen(szMessage) > 2)
+			if (strcmp(szMessage + strlen(szMessage) - 2, "\r\n") != 0)
+				logfile.Write("\r\n", 2);
+
+		logfile.Flush();
+
+		LeaveCriticalSection(&CriticalSection);
+	}
+}
+
+
+//----------------------------------------------------------------------------
+// sets a log message (same as Write() but subject to waiting for previous
+// message to be processed before returning (if multi-threaded write to screen
+// is enabled)
+int
+CSTATLogFile::Set(const char* newtext)
+{
+	Set(-1, newtext, false, false);
+	return ITS_OK;
+}
+
+//----------------------------------------------------------------------------
+// sets a log message (same as Write() but subject to waiting for previous
+// message to be processed before returning (if multi-threaded write to screen
+// is enabled)
+int
+CSTATLogFile::Set(int iMsgCode, const char* newtext, bool bMsgBox, bool bScrshot)
+{
+	// write to screen
+	if (bWriteToScreen && (NULL != iMessageReporter))
+	{
+		// set contents
+		if (iMsgCode != -1)
+		{
+			message = ReturnCodes.GetRetMsg(iMsgCode);
+		}
+		else
+		{
+			message.Empty( );
+		}
+
+		if ((newtext != NULL) && (*newtext != '\0'))
+		{
+			text = newtext;
+		}
+
+		iMessageReporter->OnMessage( message.operator LPCTSTR(), text.operator LPCTSTR(),
+										bMsgBox, bScrshot );
+	}
+
+	// write to file
+	if (bWriteToFile)
+	{
+		EnterCriticalSection(&CriticalSection);
+
+		if (iMsgCode != -1)
+			Write(FormatText(ReturnCodes.GetRetMsg(iMsgCode)));
+
+		if ((newtext != NULL) && (*newtext != '\0'))
+			Write(FormatText(newtext));
+
+		LeaveCriticalSection(&CriticalSection);
+	}
+
+	return iMsgCode;
+}
+
+//----------------------------------------------------------------------------
+//closes the active logfile
+void CSTATLogFile::CloseLogFile()
+{
+	EnterCriticalSection(&CriticalSection);
+
+	if (logfile.m_hFile != CFile::hFileNull)
+		logfile.Abort();
+
+	LeaveCriticalSection(&CriticalSection);
+}
+
+
+//----------------------------------------------------------------------------
+// PRIVATE METHODS
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+//removes spacing between data when writing to file
+char* CSTATLogFile::FormatText(const char* message)
+{
+	int newlen = 0;
+	static char szBuffer[MAX_LOG_MSG_LEN + 3];
+	int maxlen = strlen(message);
+
+	if (maxlen > MAX_LOG_MSG_LEN)
+		maxlen = MAX_LOG_MSG_LEN;
+
+	(*szBuffer) = (char)0;
+	newlen = ToAnsi(message, szBuffer, maxlen);
+
+	// add CR-LF and null-terminate, even if an empty string
+	*(szBuffer + newlen) = (char)0;
+	strcat(szBuffer, "\r\n");
+
+	return szBuffer;
+}
+
+
+//----------------------------------------------------------------------------
+//function to convert unicode to ansi - for logging
+int CSTATLogFile::ToAnsi(LPCTSTR szUnicode, LPSTR szBuffer, int nBufLen)
+{
+#ifdef UNICODE
+	return (WideCharToMultiByte(CP_ACP,						// conversion type
+								0,							// flags
+								szUnicode,					// source
+								nBufLen,					// length
+								szBuffer,					// dest
+								nBufLen,					// length
+								NULL,
+								NULL));
+#else
+	strncpy(szBuffer, szUnicode, nBufLen);
+	*(szBuffer + nBufLen) = (char)0;
+	return strlen(szBuffer);
+#endif
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Converts a char * to it's Unicode equivalent
+//
+LPCTSTR
+CSTATLogFile::ToUnicode(const char *string)
+{
+#ifdef UNICODE
+	static TCHAR szBuffer[MAX_LOG_MSG_LEN + 1] = {0};
+	szBuffer[0] = (TCHAR)0;
+
+    // Convert to UNICODE.
+    if (!MultiByteToWideChar(CP_ACP,					// conversion type
+							 0,							// flags
+							 string,					// source
+							 -1,						// length
+							 szBuffer,					// dest
+							 MAX_LOG_MSG_LEN))			// length
+    {
+        return _T("Unable to convert ansi to unicode");
+    }
+
+    return szBuffer;
+#else
+	return string;
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/cstatreturncodes.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "CSTATReturnCodes.h"
+
+static char *messages[] = 
+{
+	"General Failure.",															// 0
+	"This version of STAT has expired, please contact Symbian Ltd.",
+	"Unable to initialise time delay for the chosen platform.",
+	"DLL initialisation failure.",
+	"Interpreting STAT commands...",
+	"Unable to convert commands to 8-bit.",
+	"Unable to initialise Command Decoder.",
+	"Unable to initialise Data Format Converter.",
+	"Unable to initialise Directory Manager.",
+	"Unable to initialise Return Codes.",
+	"Unable to initialise COM library.",										// 10
+	"Copying...",
+	"Old images currently exist on the local machine.\r\n\r\nSelect YES to replace the images, NO to use the existing images, or CANCEL to stop.",
+	"The script completed successfully",
+	"Time delay set ok.",
+	"ALMOST THERE...",
+	"Error accessing registry.",
+	"Error with logfile directory.",
+	"Logfile directory found.",
+	"Logfile name found, but it is not a directory!  Please remove/rename.",
+	"Error in logfile registry key value - directory cannot be created.",		// 20
+	"Cannot create directory.",
+	"Logfile directory is :",
+	"Error with log file registry entry value.",
+	"Error with log file creation.",
+	"Log file created ok.",
+	"Script opened ok.",
+	"Unable to open script.",
+	"Error with cleanup.",
+	"NO END COMMAND FOUND IN SCRIPT FILE",
+	"End of script file.",														// 30
+	"Missing <B> or <E> command in script file",
+	"Please Connect first!",
+	"Unable to allocate memory for connection.",
+	"Connected.",
+	"Invalid # command.",
+	"New image directory...",
+	"Standard image directory created.",
+	"Cannot find trailing comment syntax.",
+	"Comment...",
+	"Invalid '/' found.",														// 40
+	"Unable to initialise log file class.",
+	"Pause...",
+	"Device information received.",
+	"Trying for device info...",
+	"Cannot retrieve device info.",
+	"Machine information received.",
+	"Trying for machine info...",
+	"Cannot retrieve machine info.",
+	"Key data...",
+	"Key data sent.",															// 50
+	"Key data sending failure.",
+	"System key data...",
+	"System key data sent.",
+	"System key data sending failure.",
+	"Combination key data...",
+	"Combination key data sent.",
+	"Combination key data sending failure.",
+	"Invalid script combination key data.",
+	"Application startup...",
+	"Application data sent.",													// 60
+	"Application data sending failure.",
+	"File opening...",
+	"File data sent.",
+	"File data sending failure.",
+	"File transfer...",
+	"File transfer ok.",
+	"File transfer failure.",
+	"A Symbian Connect session could not be instantiated.",
+	"File retrieval (move)...",
+	"File retrieval ok.",														// 70
+	"File retrieval failure.",
+	"Touch screen...",
+	"Touch screen ok.",
+	"Touch screen failure.",
+	"Attempting to close application...",
+	"Closed application ok.",
+	"Could not close application.",
+	"Starting EShell...",
+	"Started EShell ok.",
+	"Starting EShell failure.",													// 80
+	"Stopping EShell...",
+	"Stopped EShell ok.",
+	"Stopping EShell failure.",
+	"Attempting to take screenshot...",
+	"Screenshot taken ok.",
+	"Screenshot failure.",
+	"Attempting to move screenshot to PC...",
+	"Screenshot moved.",
+	"Screenshot moving failure.",
+	"Screenshot conversion failure.",											// 90
+	"Screenshot converted ok.",
+	"Unable to initialise Image Verifier.",
+	"Unable to delete reference images.",
+	"Reference image loaded ok.",
+	"Reference image loading failure.",
+	"No more reference images left for verification.",
+	"New image loaded OK",
+	"New image loading failure.",
+	"Image verification passed.",
+	"Image verification failed.",												// 100
+	"Attempting image verification...",
+	"Unable to create new image directory.",
+	"No reference images!  Verification disabled.",
+	"Invalid touch screen command.",
+	"Key hold command...",
+	"Key hold ok.",
+	"Key hold failure.",
+	"Invalid keyhold command.",
+	"Keyhold command string is too long.",
+	"Invalid image directory.",													// 110
+	"File copy operation failed.",
+	"An invalid platform was specified.",
+	"An external COM file system interface could not be obtained.",
+	"An external COM request interface could not be obtained.",
+	"A Symbian Connect session could not be initialised.",
+	"A COM request object could not be instantiated.",
+	"Remote device could not be initialised.  Check STAT support DLLs exist.",
+	"No reference images could be located",
+	"Deleting file...",
+	"File delete operation ok.",												// 120
+	"File delete operation failed.",
+	"Creating folder...",
+	"Create folder operation ok.",
+	"Create folder operation failed.",
+	"Removing folder...",
+	"Remove folder operation ok.",
+	"Remove folder operation failed.",
+	"The requested operation is not supported",
+	"Script cancelled at user's request",
+	"Out of memory",															// 130
+	"Invalid command format",
+	"Messaging initialisation failure",
+	"The file format is invalid",
+	"Could not open Symbian OS file to read",
+	"Image folder (PC side) does not exist for conversion",
+	"No images to convert",
+	"The bitmap could not be loaded prior to conversion",
+	"The converted bitmap could not be saved",
+	"The file write operation failed",
+	"Could not open bitmap file to write",										// 140
+	"Unknown data compression type",
+	"A leftover .mbm file could not be removed prior to bitmap conversion",
+	"Converting bitmap image from:",
+	"To:",
+	"File retrieval (copy)...",
+	"Invalid command syntax",
+	"Reading bitmap image into memory...",
+	"Screenshot read into memory successfully.",
+	"Command could not be sent...Retrying...",
+	"Retries exhausted.  Command failed.",										// 150
+	"A connection could not be established",
+	"Write to port failed",
+	"Read from port failed",
+	"No data read from port",
+	"Maximum time limit exceeded on single command",
+	"Maximum error limit exceeded on single command",
+	"Command ID of this type was not expected",
+	"Bad file name or file does not exist",
+	"Incorrect number of bytes read or written",
+	"Insufficient memory or connection type not supported",						// 160
+	"Retrieving file to:",
+	"Invalid command type",
+	"Communication needs to resynchronise",
+	"No data to save to file",
+	"Windows Socket Server could not be started",
+	"Socket could not be created",
+	"Socket connection failed",
+	"Socket could not be bound to this port",
+	"Socket could not listen on this port",
+	"Host name could not be obtained",											// 170
+	"Socket send failed",
+	"Socket receive failed",
+	"Script task terminated at user's request",
+	"Socket could not be closed",
+	"Windows Server shutdown failed",
+	"Using existing images",
+	"No connection specified",
+	NULL
+};
+
+CSTATReturnCodes::CSTATReturnCodes()
+: iMaxCodes(0)
+{
+	// determine the maximum error code possible
+	while(messages[iMaxCodes])
+		iMaxCodes++;
+}
+
+const char*
+CSTATReturnCodes::GetRetMsg(const DWORD codenum)
+{
+	static CString retval;
+	if (codenum < iMaxCodes)
+		retval = messages[(int)codenum];
+	else
+		retval = _T("No error text associated with this code");
+
+	return retval.operator LPCTSTR( );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statbitmap.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+#include "CSTATDataFormatConverter.h"
+#include "statbitmap.h"
+
+extern TRgb* color256Palette;
+extern char* color256InversePalette;
+
+TRgb* color256Palette = NULL;
+char* color256InversePalette = NULL;
+
+TRgb::TRgb()
+	: iRed(255),iGreen(255),iBlue(255),iSpare(0)
+	{}
+
+TRgb::TRgb(long unsigned int val)
+	: iRed((unsigned char)(val&0xff)),iGreen((unsigned char)((val>>8)&0xff)),iBlue((unsigned char)((val>>16)&0xff)),iSpare(0)
+	{}
+
+TRgb::TRgb(int r,int g,int b)
+	: iRed((unsigned char)r),iGreen((unsigned char)g),iBlue((unsigned char)b),iSpare(0)
+	{}
+
+TRgb &TRgb::operator=(const TRgb &col)
+	{
+	iRed=col.iRed;
+	iGreen=col.iGreen;
+	iBlue=col.iBlue;
+	return(*this);
+	}
+
+int TRgb::operator==(const TRgb &col)
+	{
+	return(iRed==col.iRed && iGreen==col.iGreen && iBlue==col.iBlue);
+	}
+
+int TRgb::Difference(const TRgb& col) const
+	{
+	return abs(iRed-col.iRed) + abs(iGreen-col.iGreen) + abs(iBlue-col.iBlue);
+	}
+
+int TRgb::Gray2() const
+	{
+	return Gray256() / 128;
+	}
+
+int TRgb::Gray4() const
+	{
+	return Gray256() / 64;
+	}
+
+int TRgb::Gray16() const
+	{
+	return Gray256() / 16;
+	}
+
+int TRgb::Gray256() const
+	{
+	return((2*iRed+5*iGreen+iBlue)/8);
+	}
+
+int TRgb::Color16() const
+	{
+	int index = (iRed >> 5) & 0x007;
+	index |= (iGreen  >> 2) & 0x038;
+	index |= (iBlue << 1) & 0x1c0;
+	return color16inverse[index];
+	}
+
+int TRgb::Color256() const
+	{
+	int index = (iRed >> 4) & 0x00f;
+	index |= iGreen & 0x0f0;
+	index |= (iBlue << 4) & 0xf00;
+
+	if (color256InversePalette)
+		return color256InversePalette[index];
+	else
+		return color256inverse[index];
+	}
+
+int TRgb::Color4K() const
+	{
+	return(((iRed&0xf0)<<4)|(iGreen&0xf0)|((iBlue&0xf0)>>4));
+	}
+
+int TRgb::Color64K() const
+	{
+	return(((iRed&0xf8)<<8)|((iGreen&0xfc)<<3)|((iBlue&0xf8)>>3));
+	}
+
+long int TRgb::Color16M() const
+	{
+	return((iRed<<16)|(iGreen<<8)|iBlue);
+	}
+
+TRgb TRgb::Gray2(int aGray2)
+	{
+	aGray2 *= 255;
+	return TRgb(aGray2,aGray2,aGray2);
+	}
+
+TRgb TRgb::Gray4(int aGray4)
+	{
+	aGray4 *= 85;
+	return TRgb(aGray4,aGray4,aGray4);
+	}
+
+TRgb TRgb::Gray16(int aGray16)
+	{
+	aGray16 *= 17;
+	return TRgb(aGray16,aGray16,aGray16);
+	}
+
+TRgb TRgb::Gray256(int aGray256)
+	{
+	return TRgb(aGray256,aGray256,aGray256);
+	}
+
+TRgb TRgb::Color16(int aColor16)
+	{
+	return TRgb(color16array[aColor16&0xf]);
+	}
+
+TRgb TRgb::Color256(int aColor256)
+	{
+	if (color256Palette)
+		return color256Palette[aColor256&0xff];
+	else
+		return TRgb(color256array[aColor256&0xff]);
+	}
+
+TRgb TRgb::Color4K(int aColor4K)
+	{
+	return TRgb(((aColor4K>>8)&0xf)*17,((aColor4K>>4)&0xf)*17,(aColor4K&0xf)*17);
+	}
+
+TRgb TRgb::Color64K(int aColor64K)
+	{
+	return TRgb(((aColor64K>>11)&0x1f)*255/31,((aColor64K>>5)&0x3f)*255/63,(aColor64K&0x1f)*255/31);
+	}
+
+TRgb TRgb::Color16M(long int aColor16M)
+	{
+	return TRgb(((aColor16M>>16)&0xff),(aColor16M>>8)&0xff,aColor16M&0xff);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statcomms.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "STATComms.h"
+#include "statserial.h"
+#include "statsocket_block.h"
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Constructor
+STATComms::STATComms()
+: pTransport(NULL)
+{
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Destructor
+STATComms::~STATComms()
+{
+	if (pTransport)
+	{
+		pTransport->Disconnect();
+		pTransport->Release();
+
+		delete pTransport; 
+		pTransport = NULL;
+	}
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int STATComms::SetTransport(const STATCONNECTTYPE eConnect)
+{
+	// additional transports may be added here as needed...
+	switch(eConnect)
+	{
+		case SymbianSocket:
+			pTransport = new CSTATSocket;
+			break;
+		case SymbianSerial:
+			pTransport = new CSTATSerial(eConnect);
+			break;
+		case SymbianInfrared:
+			pTransport = new CSTATSerial(eConnect);
+			break;
+		case SymbianBluetooth:
+			pTransport = new CSTATSerial(eConnect);
+			break;
+		case SymbianUsb:
+			pTransport = NULL;
+			break;
+	};
+
+	if (!pTransport)
+ 		return E_OUTOFMEMNOTSUPPORTED;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Initialise
+int STATComms::Initialise(void)
+{
+	if (!pTransport)
+ 		return E_OUTOFMEMNOTSUPPORTED;
+
+	return pTransport->Initialise();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Connect
+int STATComms::Connect(const char *pAddress)
+{
+	if (!pTransport)
+ 		return E_OUTOFMEMNOTSUPPORTED;
+
+	return pTransport->Connect(pAddress);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Send
+int STATComms::Send(const char cIdentifier, const char *pData, const unsigned long ulLength)
+{
+	if (!pTransport)
+ 		return E_OUTOFMEMNOTSUPPORTED;
+
+	return pTransport->Send(cIdentifier, pData, ulLength);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Receive
+int STATComms::Receive(char *cIdentifier, char **ppData, unsigned long *pLength)
+{
+	if (!pTransport)
+ 		return E_OUTOFMEMNOTSUPPORTED;
+
+	return pTransport->Receive(cIdentifier, ppData, pLength);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Disconnect
+int STATComms::Disconnect(void)
+{
+	if (!pTransport)
+ 		return E_OUTOFMEMNOTSUPPORTED;
+
+	return pTransport->Disconnect();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Release
+int STATComms::Release(void)
+{
+	if (!pTransport)
+ 		return E_OUTOFMEMNOTSUPPORTED;
+
+	return pTransport->Release();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Return error text
+char * STATComms::Error(void)
+{
+	if (!pTransport)
+ 		return NULL;
+
+	return pTransport->Error();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statengine.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1580 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "STATEngine.h"
+#include "STATCommon.h"
+#include "INI.h"
+
+#include <string>
+
+//----------------------------------------------------------------------------
+// Constructor
+CSTATEngine::CSTATEngine()
+: pImageVerify(NULL), pConverter(NULL), pComms(NULL), pDecoder(NULL), pLog(NULL),
+  minimumdelay(100), maximumdelay(30000), eStopProcessing(STAT_RUN), iCurrentCommand(0), bMultithreaded(false),
+  eConnectType(SymbianInvalid), pDeviceInfo(NULL), iDeviceCode(0), iMaxTimeLimit(STAT_MAXTIME), dataSocket(NULL), settingSocket(true), iTEFSharedData(NULL)
+{	
+	memset(&szAddress, 0, sizeof(szAddress));
+	statIniFile.SetIniFileName(STAT_INI_NAME);
+}
+
+
+//----------------------------------------------------------------------------
+// Destructor
+CSTATEngine::~CSTATEngine()
+{
+	Release();
+}
+
+
+//----------------------------------------------------------------------------
+// Set things up
+int
+CSTATEngine::Initialise(const STATCONNECTTYPE eConnect, const char *pAddress)
+{
+	iDelay = minimumdelay;
+
+
+
+
+	// logging - should be the first to be created for all other classes that depend on it
+	pLog = new CSTATLogFile;
+ 	if (!pLog)
+ 		return E_OUTOFMEM;
+
+	int ret = SetScreenshotDefaultDirectory();
+	if (ret != ITS_OK)
+		return ret;
+
+	// image verification
+ 	pImageVerify = new CSTATImageVerify(pLog);
+ 	if (!pImageVerify)
+ 		return E_OUTOFMEM;
+
+	// bitmap conversion
+	pConverter = new CSTATDataFormatConverter(pLog);
+ 	if (!pConverter)
+ 		return E_OUTOFMEM;
+
+	// script decoder
+	pDecoder = new CSTATScriptDecoder(pLog);
+ 	if (!pDecoder)
+ 		return E_OUTOFMEM;
+
+	// communications
+	pComms = new STATComms();
+ 	if (!pComms)
+ 		return E_OUTOFMEM;
+	else
+	{
+		EnterCriticalSection(&CriticalSection);
+
+		ret = pComms->SetTransport(eConnect);
+		if (ret == ITS_OK)
+		{
+			ret = pComms->Initialise();
+
+			if (ret == ITS_OK)
+				ret = pComms->Connect(pAddress);
+
+			if (ret == ITS_OK)
+			{
+				strcpy(szAddress, pAddress);	// save port in case of restart after error
+				eConnectType = eConnect;
+			}
+		}
+
+		LeaveCriticalSection(&CriticalSection);
+	}
+	return ret;
+}
+
+
+
+//----------------------------------------------------------------------------
+// Release resources
+int
+CSTATEngine::Release(void)
+{
+	if (pImageVerify)
+	{
+		delete pImageVerify;
+		pImageVerify = NULL;
+	}
+
+	if (pConverter)
+	{
+		delete pConverter;
+		pConverter = NULL;
+	}
+
+	if (pDecoder)
+	{
+		delete pDecoder;
+		pDecoder = NULL;
+	}
+
+	if (pDeviceInfo)
+	{
+		delete [] pDeviceInfo;
+		pDeviceInfo = NULL;
+	}
+
+	if (iTEFSharedData)
+	{
+		delete [] iTEFSharedData;
+		iTEFSharedData = NULL;
+	}
+	
+	EnterCriticalSection(&CriticalSection);
+
+	if (pComms)
+	{
+		delete pComms;
+		pComms = NULL;
+	}
+
+	// release this one last in case other objects are using it...
+	if (pLog)
+	{
+		pLog->CloseLogFile();
+		delete pLog;
+		pLog = NULL;
+	}
+
+	LeaveCriticalSection(&CriticalSection);
+	return ITS_OK;
+}
+
+
+//----------------------------------------------------------------------------
+// Sets up log file
+int
+CSTATEngine::SetLogging(const CString& logfilename, const char* prefix, bool append, bool bMessages, bool bFile,
+	MessageReporter *const aMessageReporter)
+{
+	EnterCriticalSection(&CriticalSection);
+	//set default logging path
+	CString defaultDirectory=STAT_LOGFILEPATH_VALUE;
+	//read from inifile if entry exists
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+		CString setting;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_LOGFILEPATH,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			defaultDirectory = setting;
+	}
+	int ret = pLog->CreateLogFile(logfilename,defaultDirectory, prefix, append, bMessages, bFile);
+
+	pLog->SetMessageReporter(aMessageReporter);
+
+	// in case our transport was initialised before logging was
+	// display the initialisation message if there is one
+	if (ret == LOG_FILE_OK)
+		Message(pComms->Error());
+
+	LeaveCriticalSection(&CriticalSection);
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Sets up log file
+void
+CSTATEngine::SetCommandDelay(int iMillisecondDelay)
+{
+	iDelay = iMillisecondDelay;
+
+	// set some limits
+	if (iDelay < 100)
+		iDelay = minimumdelay;
+
+	if (iDelay > 30000)
+		iDelay = maximumdelay;
+}
+
+
+//----------------------------------------------------------------------------
+// Open, read and count the amount of commands on this script
+int
+CSTATEngine::GetCommandCount(CString file, int *pCount)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int ret = pDecoder->Initialise(file, true);
+	if (ret != ITS_OK)
+		ret = pDecoder->Initialise(file, false);
+
+	if (ret == ITS_OK)
+	{
+		CSTATScriptCommand *pSendCommand;
+		int iCount = 0;
+		
+		// get a command from the script
+		while (pDecoder->GetNextCommand(&pSendCommand) && ret == ITS_OK)
+		{
+			iCount++;
+			if (pSendCommand->cCommandID == STAT_END)
+				break;
+		}
+
+		// set the count
+		if (ret == ITS_OK)
+			(*pCount) = iCount;
+	}
+
+	pDecoder->Release();
+
+	LeaveCriticalSection(&CriticalSection);
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Open and read a script file's contents
+int
+CSTATEngine::OpenScriptFile(CString file, bool bIsFile)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int ret = pDecoder->Initialise(file, bIsFile);
+
+	LeaveCriticalSection(&CriticalSection);
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Execute a script file
+int
+CSTATEngine::RunScript(ScriptProgressMonitor *const monitor)
+{
+	int ret = ITS_OK;
+	iCurrentCommand = 0;
+	eStopProcessing = STAT_RUN;
+	iDeviceCode = 0;
+
+	// anything smaller can cause problems and doesn't make sense anyway!
+	if (iMaxTimeLimit < 1000)
+		iMaxTimeLimit = 1000;
+
+	// pointers to our command structures
+	CSTATScriptCommand *pSendCommand;
+	CSTATScriptCommand *pRecvCommand;
+
+	char lastCommand = NULL;
+
+	receivedData.Empty( );
+	
+	
+
+	// get a command from the script
+	while (pDecoder->GetNextCommand(&pSendCommand) && ret == ITS_OK)
+	{
+		iCurrentCommand++;
+
+		if (StopProcessing())
+		{
+			pComms->Send(STAT_RESYNCID);
+			ret = E_USERCANCEL;
+			break;
+		}
+
+		if (lastCommand == STAT_REBOOT)
+		{
+			ret = ITS_OK;
+			break;
+		}
+
+		switch(pSendCommand->cCommandID)
+		{
+			case 'P':
+				Message(pSendCommand->Command());
+				Sleep(atol(pSendCommand->Command()));
+				break;
+			case '/':
+				Message(pSendCommand->Command());
+				break;
+			case '#':
+				{
+					Message(pSendCommand->Command());
+					cScreenshotDirectory = pSendCommand->Command();
+					if(cScreenshotDirectory.Right(1) != _T("\\"))
+						cScreenshotDirectory += _T("\\");
+					CreateAllDirectories(cScreenshotDirectory);
+				}
+				break;
+			
+			default:
+				{
+
+					// send the command and retrieve a response
+					int iResyncErrors = 0;
+					while ((ret = SendCommand(pSendCommand, &pRecvCommand)) == E_RESYNCCOMMAND)
+					{
+						Sleep(STAT_RETRYDELAY);
+						iResyncErrors++;
+						if (iResyncErrors > STAT_MAXERRORS)
+						{
+							Message("Too many resync errors - stopping");
+							ret = E_COMMANDFAILED;
+							break;
+						}
+						
+					}
+
+					if (ret == ITS_OK)
+					{
+						// perform special operations for these commands
+						switch(pSendCommand->cCommandID)
+						{
+							case 'D':
+								StoreData(pRecvCommand->Command(), pRecvCommand->Length(), pDeviceInfo);
+								AppendCommandToSTATLog("*** DEVICE INFORMATION ***", pRecvCommand->Command(), pRecvCommand->Length());
+								break;
+							case 'S':
+							{
+								// convert and save the data returned in the response
+								CString image = pSendCommand->Command();
+								ret = ConvertAndSaveScreeenshot(image, pRecvCommand->Command(), pRecvCommand->Length());
+
+								// imave verification
+								if (ret == ITS_OK)
+								{
+									if (pImageVerify->IsActive() && pConverter->bWriteToFile)
+									{
+										ret = pImageVerify->VerifyImage(image);
+										if (ret == VERIFICATION_PASS)
+											ret = ITS_OK;
+									}
+								}
+								break;
+							}
+						
+							case 'T':
+							{
+								
+								if(dataSocket==NULL)
+								{
+
+									// filename has been sent, now send the file itself
+									CSTATScriptCommand oSendCommand;
+									oSendCommand.cCommandID = pRecvCommand->cCommandID;
+									
+										// read and send the file contents
+									if ((ret = ReadTransferFile(pSendCommand->Command(), &oSendCommand)) == ITS_OK)
+									{
+										int iResyncErrors = 0;
+										while ((ret = SendCommand(&oSendCommand, &pRecvCommand)) == E_RESYNCCOMMAND)
+										{
+											Sleep(STAT_RETRYDELAY);
+											iResyncErrors++;
+											if (iResyncErrors > STAT_MAXERRORS)
+											{
+												Message("Too many resync errors - stopping");
+												ret = E_COMMANDFAILED;
+												break;
+											}
+										}
+									}
+									
+								}
+								else
+								{
+									//release the socket
+									ret = ReleaseSocket();
+									
+								}
+								
+
+								break;
+							}
+							case 'R':
+							case 'X':
+							{	
+								if(dataSocket==NULL)
+								{
+									// save the file contents
+									ret = SaveTransferFile(pSendCommand->Command(), pRecvCommand->Command(), pRecvCommand->Length());
+								}
+								else
+								{
+									//release the socket
+									ret = ReleaseSocket();
+								}
+								break;
+							}
+							case 'G':
+							{
+								// upload the device log file and write to STAT log file
+								AppendCommandToSTATLog("*** DEVICE LOG ***", pRecvCommand->Command(), pRecvCommand->Length());
+								break;
+							}
+							case STAT_REFRESH:
+							case STAT_END:
+							{
+								ret = END_SCRIPT;
+								break;
+							}
+							case 'N':
+							{
+								// Retrieve the TEF shared data
+								StoreData(pRecvCommand->Command(), pRecvCommand->Length(), iTEFSharedData);
+								AppendCommandToSTATLog("*** RETRIEVE TEF SHARED DATA ***", pRecvCommand->Command(), pRecvCommand->Length());
+							}
+							break;
+							default:
+							{
+								Sleep(iDelay);
+								break;
+							}
+						}
+					}
+
+					if (ret == ITS_OK)
+					{
+						// Data received from certain of the commands is stored
+						// for retreival later.
+						switch(pSendCommand->cCommandID)
+						{
+							case 'W':
+							case 'V':
+							//execute returns pid
+							case 'J':
+							//poll returns 0 1
+							case '3':
+								receivedData += oRecvCommand.Command();
+								break;
+							default:
+								break;
+						}
+					}
+				}
+				break;
+		}
+
+		lastCommand = pSendCommand->cCommandID;
+
+		if(monitor)
+		{
+			monitor->OnCompleteCommand( iCurrentCommand );
+		}
+	}
+
+	pDecoder->Release();
+
+	return ret;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Converts a char * to it's Unicode equivalent
+//
+LPTSTR
+CSTATEngine::ToUnicode(const char *string)
+{
+#ifdef UNICODE
+	static TCHAR szBuffer[MAX_UNICODE_LEN + 1] = {0};
+	szBuffer[0] = (TCHAR)0;
+
+    // Convert to UNICODE.
+    if (!MultiByteToWideChar(CP_ACP,					// conversion type
+							 0,							// flags
+							 string,					// source
+							 -1,						// length
+							 szBuffer,					// dest
+							 MAX_UNICODE_LEN))			// length
+    {
+        return _T("Could not convert");
+    }
+    return szBuffer;
+#else
+	return (LPTSTR)string;
+#endif
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Converts a Unicode to it's char * equivalent
+//
+char *
+CSTATEngine::ToAnsi(LPCTSTR string)
+{
+#ifdef UNICODE
+	static char szBuffer[MAX_UNICODE_LEN + 1] = {0};
+	szBuffer[0] = (char)0;
+
+    // Convert to ANSI.
+    if (!WideCharToMultiByte(CP_ACP,					// conversion type
+							 0,							// flags
+							 string,					// source
+							 -1,						// length
+							 szBuffer,					// dest
+							 MAX_UNICODE_LEN,			// length
+							 NULL,
+							 NULL ))
+    {
+        return "Could not convert";
+    }
+    return szBuffer;
+#else
+	return (char *)string;
+#endif
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// PRIVATE METHODS
+//////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// sets screenshot image directory
+int CSTATEngine::SetScreenshotDefaultDirectory(void)
+{
+	//Set default logfile path
+	CString path = ST_LOGFILEPATH_VALUE;
+	//read from inifile if entry exists
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+		CString setting;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_LOGFILEPATH,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			path = setting;
+	}
+
+	
+	cScreenshotDirectory = path;
+
+	// add a backslash
+	if (cScreenshotDirectory.Right(1) != _T('\\'))
+		cScreenshotDirectory += _T('\\');
+
+	cScreenshotDirectory += _T("Images\\");
+
+	return ITS_OK;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Execute a complete command
+//
+// Sends a command, breaking it up into separate commands if required
+//
+// When sending, if larger than our buffer , break it up into correctly sized
+// pieces and send these.  The first will be an empty one containing the total
+// size, followed by buffer-sized pieces.  The last will be an empty command.
+//
+
+//////////////////////////////////////////////////////////////////////////////////////
+int CSTATEngine::SendCommand(CSTATScriptCommand *pSendCommand, CSTATScriptCommand **ppRecvCommand)
+{
+	int ret = GENERAL_FAILURE;
+	CSTATScriptCommand tempCommand;
+	tempCommand.cCommandID = pSendCommand->cCommandID;
+
+
+	// the first instance of a 'R' or 'T' command, it could set a data socket instead of a file
+	if(pSendCommand->cCommandID=='T' || pSendCommand->cCommandID=='R')
+	{
+		if(dataSocket==NULL && settingSocket && pSendCommand->Command()!=NULL)
+		{
+
+			char *comma = strchr(pSendCommand->Command(),',');
+			
+			if(!(comma > pSendCommand->Command() + pSendCommand->Length()))
+			{
+	
+				switch(pSendCommand->cCommandID)
+				{
+				case 'R':
+					{
+						char *colon = strchr(comma,':');
+						
+						if(colon==NULL)
+							break;
+	
+						comma += 1;
+						std::string ipAdd( comma, colon - comma );
+						colon += 1;
+						std::string ipPort( colon );
+	
+						ret = SetSocket(ipAdd.c_str() , atoi( ipPort.c_str() ));
+
+						if(ret!=ITS_OK)
+						{
+							return ret;
+						}
+	
+						break;
+					}
+	
+				case 'T':
+					{
+						char *colon = strchr( pSendCommand->Command() , ':' );
+	
+						if(colon==NULL)
+							break;
+	
+						std::string ipAdd( pSendCommand->Command() , colon - pSendCommand->Command() );
+						colon += 1;
+						
+						if(comma < colon)
+							break;
+	
+						std::string ipPort( colon , comma - colon );
+	
+						ret = SetSocket(ipAdd.c_str() , atoi(ipPort.c_str()));
+						
+						if(ret!=ITS_OK)
+						{
+							return ret;
+						}
+
+						break;
+					}
+				}
+			}
+		}
+
+		settingSocket=false;
+	}
+	
+	
+	
+	// send the first command
+	if ((ret = SendSingleCommand(pSendCommand, ppRecvCommand)) == ITS_OK)
+	{
+		// check our response - if Serial/Infra-red, need to break it down
+		if (pComms->GetMaxPacketSize() != 0)
+		{
+
+			
+			// break up the command into buffer-sized chunks
+			if (pSendCommand->Length() > pComms->GetMaxPacketSize() || (dataSocket!=NULL && pSendCommand->cCommandID=='T'))
+			{
+				int i = 0;
+				unsigned long offset = 0;
+				unsigned long ulTotalWritten = 0;
+				unsigned long AmountToWrite = pComms->GetMaxPacketSize();
+				unsigned long OriginalLength = pSendCommand->Length();
+				
+				if(dataSocket==NULL)
+				{
+					
+					int iWrites = pSendCommand->Length() / pComms->GetMaxPacketSize() + 1;
+
+					Message("Writing %d bytes of data in %d separate writes...", OriginalLength, iWrites);
+					for (i=0;i<iWrites;i++)
+					{
+						offset = i * pComms->GetMaxPacketSize();
+
+						if ((pSendCommand->Length() - offset) < pComms->GetMaxPacketSize())
+							AmountToWrite = (pSendCommand->Length() - offset);
+
+						if (AmountToWrite)
+						{
+							//Sleep(100);		// pause a bit for slower machines - probably doesn't need it but it can't hurt...
+
+							// now send the command
+							Message("Writing %d bytes from offset %d", AmountToWrite, offset);
+							tempCommand.SetData(pSendCommand->Command() + ulTotalWritten, AmountToWrite);
+							if ((ret = SendSingleCommand(&tempCommand, ppRecvCommand)) == ITS_OK)
+							{
+								//Message("%d bytes successfully written", AmountToWrite);
+							}
+							else
+								return ret;
+
+							ulTotalWritten += AmountToWrite;
+						}
+					}
+					
+				}
+				else
+				{
+
+					//uses socket transmission
+
+					char *pData = new char[AmountToWrite];
+					
+					tempCommand.ulLength = (unsigned long) -1;
+					
+					if((ret = SendSingleCommand(&tempCommand, ppRecvCommand)) != ITS_OK)
+					{	
+						delete [] pData;
+						return ret;
+					}
+
+					while(true){
+
+
+						int AmountToWrite = pComms->GetMaxPacketSize();
+						
+						ReadFromSocket(pData, &AmountToWrite );
+											
+						if(AmountToWrite>=0)
+						{
+							Message("Writing %d bytes", AmountToWrite);
+							tempCommand.SetData(pData , AmountToWrite);
+						
+							if ((ret = SendSingleCommand(&tempCommand, ppRecvCommand)) == ITS_OK)
+							{
+							//Message("%d bytes successfully written", AmountToWrite);
+							}
+							else
+							{
+								settingSocket=true;
+								delete [] pData;
+								return ret;
+							}
+
+							ulTotalWritten +=AmountToWrite;
+						}
+						else
+						{
+							eStopProcessing = STAT_PAUSE;
+							break;
+						}
+						
+						if(AmountToWrite==0)
+						{
+							break;
+						}
+						
+					}
+
+					delete [] pData;
+				
+				}
+			
+				// once completely sent, send an empty command to show that we've finished
+				
+				
+				if(dataSocket == NULL )
+				{
+					if (ulTotalWritten == OriginalLength)
+					{
+						// send the command that signals the end of our transmission
+						Message("Sending completion command %c", tempCommand.cCommandID);
+						tempCommand.SetData(NULL, 0);
+						if ((ret = SendSingleCommand(&tempCommand, ppRecvCommand)) == ITS_OK)
+						{
+							//Message("Completion command successfully written");
+						}
+					}
+					else
+					{
+						Message("Incorrect number of bytes written - expected %ld got %ld", ulTotalWritten, OriginalLength);
+						ret = E_BADNUMBERBYTES;
+					}
+				}
+			}
+		}
+	}
+
+	if (ret == ITS_OK)
+	{
+		// check our response - if Serial/Infra-red, need to break it down
+		// if < STAT_BUFFERSIZE, nothing more to do
+		// if not, we need to read in as many times as it takes to
+		// assemble our complete command response
+		if (pComms->GetMaxPacketSize() != 0)
+		{
+			if (ppRecvCommand && (*ppRecvCommand)->Length() > pComms->GetMaxPacketSize())
+			{
+				unsigned long TotalLength = (*ppRecvCommand)->Length();
+
+				Message("%s: About to read %d bytes of data", GetConnection(eConnectType), TotalLength);
+
+				// allocate memory to hold entire command
+				char *pTemp = new char [TotalLength];
+				if (pTemp)
+				{
+					unsigned long ulTotalRead = 0;
+
+					// empty packets
+					tempCommand.SetData(NULL, 0);
+
+					// now read data until we get an empty packet
+					while((*ppRecvCommand)->Length())
+					{
+						//Sleep(100);		// pause a bit for slower machines - probably doesn't need it but it can't hurt...
+
+						//Message("Sending continuation command %c", tempCommand.cCommandID);
+						if ((ret = SendSingleCommand(&tempCommand, ppRecvCommand)) == ITS_OK)
+						{
+							if ((*ppRecvCommand)->Length())
+							{
+								Message("%s to offset %d", pComms->Error(), ulTotalRead);
+								
+								//copy the data into the buffer
+								memcpy(pTemp + ulTotalRead, (*ppRecvCommand)->Command(), (*ppRecvCommand)->Length());
+								
+								if(dataSocket!=NULL)
+								{
+									int bytesSent = (int)(*ppRecvCommand)->Length();
+								
+									WriteToSocket((*ppRecvCommand)->Command() , &bytesSent);
+									
+									if(bytesSent <= 0)
+									{
+										eStopProcessing = STAT_PAUSE;
+									}
+								}
+								
+								
+
+								//increment the pointer to the end of the first chunk received
+								ulTotalRead += (*ppRecvCommand)->Length();
+							}
+						}
+						else
+						{
+							settingSocket=true;
+							delete [] pTemp;
+							return ret;
+						}
+					}
+
+					// make sure we got what we expected
+					if (ulTotalRead == TotalLength)
+					{
+						// set our final response to the complete data transmission
+						(*ppRecvCommand)->SetData(pTemp, ulTotalRead);
+						//Message("Received successfully %ld bytes", ulTotalRead);
+					}
+					else
+					{
+						Message("Incorrect number of bytes read - expected %ld got %ld", ulTotalRead, TotalLength);
+						ret = E_BADNUMBERBYTES;
+					}
+
+					// finished with it
+					delete [] pTemp;
+				}
+				else
+				{
+					Message("Could not allocate %d bytes of memory", TotalLength);
+					ret = E_OUTOFMEM;
+				}
+			}
+			else if(dataSocket!=NULL && pSendCommand->cCommandID=='R')
+			{
+				int bytesSent = (int)(*ppRecvCommand)->Length();
+				WriteToSocket((*ppRecvCommand)->Command(), &bytesSent);
+			}
+		}
+	}
+
+	
+
+	return ret;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Execute a single command
+//
+// Once the command is sent, wait for a response.  If received and of the correct
+// ID, save the contents (if any) and quit.  If no response, send RESYNC commands
+// every few seconds to get response from other end.  On receipt of a RESYNC
+// command, resend the previous command.  After no response for a minute or so, quit.
+//////////////////////////////////////////////////////////////////////////////////////
+int CSTATEngine::SendSingleCommand(CSTATScriptCommand *pSendCommand, CSTATScriptCommand **ppRecvCommand)
+{
+	int iTotalCommandTime = 0;
+	int ret = GENERAL_FAILURE;
+
+	LogDetails("Send", pSendCommand);
+
+	// send the command
+	EnterCriticalSection(&CriticalSection);
+	ret = pComms->Send(pSendCommand->cCommandID, pSendCommand->Command(), pSendCommand->Length());
+	LeaveCriticalSection(&CriticalSection);
+	if (ret != ITS_OK)
+	{
+		Message(pComms->Error());
+		return ret;
+	}
+
+	// The refresh command will not return anything due to the transport getting restarted.
+	// So, don't wait for a response.
+	if( (ret == ITS_OK) && (pSendCommand->cCommandID == STAT_REFRESH || pSendCommand->cCommandID == STAT_REBOOT)  )
+	{
+		return ret;
+	}
+
+	// wait for a response
+	unsigned long ulLength = 0;
+	char *pData = NULL;
+	while(iTotalCommandTime < iMaxTimeLimit)
+	{
+		if (StopProcessing())
+		{
+			pComms->Send(STAT_RESYNCID);
+			ret = E_USERCANCEL;
+			break;
+		}
+
+		EnterCriticalSection(&CriticalSection);
+		ret = pComms->Receive(&oRecvCommand.cCommandID, &pData, &ulLength);
+		LeaveCriticalSection(&CriticalSection);
+		
+		if (ret == ITS_OK)
+		{
+			if (oRecvCommand.SetData(pData, ulLength))
+			{
+				oRecvCommand.ulLength = ulLength;
+				*ppRecvCommand = &oRecvCommand;
+
+				// invalid response received
+				if (pSendCommand->cCommandID != oRecvCommand.cCommandID)
+				{
+					// need to resync back to start of this command
+					if (oRecvCommand.cCommandID == STAT_RESYNCID)
+					{
+						Message("RESYNC response received - retrying command...");
+						ret = E_RESYNCCOMMAND;
+					}
+					else
+					{
+						if (oRecvCommand.cCommandID == STAT_FAILURE)
+						{
+							if (oRecvCommand.Command() && oRecvCommand.Length())
+							{
+								Message("Command failed with error code %s",
+										oRecvCommand.Command());
+								iDeviceCode = atoi(oRecvCommand.Command());
+							}
+						}
+						else
+							Message("Invalid response received - expected %c received %c",
+									pSendCommand->cCommandID, oRecvCommand.cCommandID);
+						ret = GENERAL_FAILURE;
+					}
+				}
+				else
+					LogDetails("Receive", *ppRecvCommand);
+			}
+			else
+				ret = E_OUTOFMEM;
+
+			// at this point we have received something whether it's what we were expecting or not so exit loop
+			break;
+		}
+		else if (ret == NO_DATA_AT_PORT)
+		{
+//			Message("Waiting for response");
+			Sleep(STAT_RETRYDELAY);
+			iTotalCommandTime += STAT_RETRYDELAY;
+			ret = E_TOOMUCHTIME;
+		}
+		else
+		{
+			Message(pComms->Error());
+			break;
+		}
+	}
+
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Write command details to log
+void CSTATEngine::LogDetails(const char *prefix, CSTATScriptCommand *pCommand)
+{
+	if (pCommand->Length() && (pCommand->Length() < MAX_LOG_MSG_LEN) && 
+		pCommand->cCommandID != 'D' && pCommand->cCommandID != 'T' && pCommand->cCommandID != 'R' && pCommand->cCommandID != 'X' && pCommand->cCommandID != 'G')
+	{
+		char szContents[MAX_LOG_MSG_LEN + 1];
+		unsigned long actuallen = MAX_LOG_MSG_LEN - 30 - strlen(prefix) - 6;  // max actual message length
+		if (pCommand->Length() < actuallen)
+			actuallen = pCommand->Length();
+
+		strncpy(szContents, pCommand->Command(), actuallen);
+		*(szContents + actuallen) = (char)0;
+		Message("%s: ID: %c Contents: [%s] Length: [%lu]", prefix, pCommand->cCommandID, szContents, pCommand->Length());
+	}
+	else
+		Message("%s: ID: %c Length: [%lu]", prefix, pCommand->cCommandID, pCommand->Length());
+}
+
+
+//----------------------------------------------------------------------------
+// Read in a file's contents
+//
+// pFile will contain "pc path,device path" of which we want the 'pc path' part
+int CSTATEngine::ReadTransferFile(const char *pFile, CSTATScriptCommand *pCommand)
+{
+	int ret = E_BADFILENAME;
+
+	// get the default file location
+	CString path = ST_WORKINGPATH_VALUE;
+	//read from inifile if entry exists
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+		CString setting;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_WORKINGPATH,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			path = setting;
+	}
+
+	// add a backslash
+	if (path.Right(1) != _T('\\'))
+		path += _T('\\');
+
+	// get the name of the file
+	CString filename = pFile;
+	int index = filename.ReverseFind(_T(','));
+	if (index == -1)
+		return E_BADFILENAME;
+
+	// add the name
+	path += filename.Left(index);
+
+	Message("Opening file [%s]", ToAnsi(path));
+
+	EnterCriticalSection(&CriticalSection);
+
+	CFile script_file;
+	if (script_file.Open(path, CFile::modeRead))
+	{
+		try
+		{
+			char *pData = new char [script_file.GetLength()];
+			if (pData)
+			{
+				script_file.Read(pData, script_file.GetLength());
+
+				if(pCommand->SetData(pData, script_file.GetLength()))
+					ret = ITS_OK;
+				else
+					ret = E_OUTOFMEM;
+
+				delete [] pData;
+			}
+			else
+				ret = E_OUTOFMEM;
+		}
+		catch(CFileException *e)
+		{
+			e->Delete();
+			ret = GENERAL_FAILURE;
+		}
+
+		script_file.Abort();
+	}
+
+	LeaveCriticalSection(&CriticalSection);
+	return ret;
+}
+
+
+
+
+
+
+
+//----------------------------------------------------------------------------
+// Save a data stream to file
+//
+// pFile will contain "device path,pc folder" of which we want the 'pc folder' part
+int CSTATEngine::SaveTransferFile(const char *pFile, char *pContents, unsigned long ulLength)
+{
+	int ret = E_BADFILENAME;
+
+	CString path = ST_WORKINGPATH_VALUE;
+	//read from inifile if entry exists
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+		CString setting;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_WORKINGPATH,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			path = setting;
+	}
+	// add a backslash
+	if (path.Right(1) != _T('\\'))
+		path += _T('\\');
+
+	// get any additional sub folders
+	CString folder = pFile;
+	int index = folder.Find(_T(','));
+	if (index == -1)
+		return E_BADFILENAME;
+	// if the comma is the last char there are no folders to add
+	if (folder.Right(1) != _T(','))
+	{
+		path += folder.Mid(index + 1);
+
+		// add a backslash
+		if (path.Right(1) != _T('\\'))
+			path += _T('\\');
+	}
+
+	if (bMultithreaded)
+	{
+		// add a sub-folder for the connection type
+		path += GetConnection(eConnectType);
+		path += _T(".");
+		path += szAddress;
+		path += _T('\\');
+	}
+
+	// now extract the filename from the first argument
+	CString filename = folder.Left(index);
+	index = filename.ReverseFind(_T('\\'));
+	if (index == -1)
+		path += filename;
+	else
+		path += filename.Mid(index + 1);
+
+	Message("Saving file [%s]", ToAnsi(path));
+
+	ret = SaveTheFile(path, pContents, ulLength);
+	if (ret != ITS_OK)
+		Message("Error saving [%s] (%d)", ToAnsi(path), GetLastError());
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Convert and save a screenshot
+int CSTATEngine::ConvertAndSaveScreeenshot(CString &file, const char *pContents, const unsigned long ulLength)
+{
+	int ret = E_BADFILENAME;
+
+	// clean out any previous mbm files lying around
+	if (!RemoveLeftoverMBMFiles())
+		return E_SCREENSHOT_LEFTOVERFILES;
+
+	// get the destination screenshot name
+	CString destfile = file;
+	if (destfile.IsEmpty())
+	{
+		// construct a filename from date/time
+		char szName[20] = {0};
+		time_t curTime;
+		time (&curTime);
+		strftime (szName, 
+					sizeof (szName),
+					"%Y%m%d%H%M%S",
+					localtime (&curTime));
+
+		destfile = szName;
+	}
+
+	// get the full name of the source image
+	CString SrcPath = cScreenshotDirectory;
+
+	if (bMultithreaded)
+	{
+		// add a sub-folder for the connection type
+		SrcPath += GetConnection(eConnectType);
+		SrcPath += _T(".");
+		SrcPath += szAddress;
+		SrcPath += _T('\\');
+	}
+
+	// attach the filename
+	CString path = SrcPath;
+
+	path += destfile;
+	path += _T(".mbm");
+
+//	Message("Saving screenshot [%s]", ToAnsi(path));
+
+	// save bitmap data to file
+	if ((ret = SaveTheFile(path, pContents, ulLength)) == ITS_OK)
+		ret = pConverter->ConvertScreenShot(SrcPath, SrcPath);
+
+	// save the full path to the converted image
+	if (ret == ITS_OK)
+		file = SrcPath;
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Save data to file
+int CSTATEngine::SaveTheFile(CString path, const char *pContents, const unsigned long ulLength)
+{
+	int ret = E_BADFILENAME;
+
+	EnterCriticalSection(&CriticalSection);
+
+	// ensure the path exists
+	CreateAllDirectories(path);
+
+	DeleteFile(path);
+
+	CFile script_file;
+	if (script_file.Open(path, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite))
+	{
+		try
+		{
+			// might be a zero-length file
+			if (pContents && ulLength)
+				script_file.Write(pContents, ulLength);
+
+			ret = ITS_OK;
+		}
+		catch(CFileException *e)
+		{
+			e->Delete();
+			ret = GENERAL_FAILURE;
+		}
+
+		script_file.Abort();
+	}
+
+	LeaveCriticalSection(&CriticalSection);
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Write a message to the log
+void CSTATEngine::Message(const char *pMsg, ...)
+{
+	char szMessage[MAX_LOG_MSG_LEN + 1];
+
+	if (pMsg)
+	{
+		memset(&szMessage, 0, sizeof(szMessage));
+		va_list pCurrent = (va_list)0;
+		va_start (pCurrent, pMsg);
+		vsprintf (szMessage, pMsg, pCurrent);
+		va_end (pCurrent);
+	}
+	else
+		strcpy(szMessage, "No message associated with this error");
+
+	EnterCriticalSection(&CriticalSection);
+	pLog->Set(szMessage);
+	LeaveCriticalSection(&CriticalSection);
+}
+
+//----------------------------------------------------------------------------
+// Try to create all directories within a supplied path
+void CSTATEngine::CreateAllDirectories(CString &fullpath)
+{
+	CString path;
+	int index = fullpath.Find(_T('\\'));
+	while (index != -1)
+	{
+		path = fullpath.Left(index);
+		CreateDirectory(path, NULL);
+
+		index = fullpath.Find(_T('\\'), index + 1);
+	}
+}
+
+//----------------------------------------------------------------------------
+// check if we want to quit
+bool CSTATEngine::StopProcessing()
+{
+	// check if instructed to stop processing (will only happen on Desktop version)
+	if (eStopProcessing == STAT_PAUSE)
+	{
+		eStopProcessing = STAT_STOP;
+		return true;
+	}
+
+	return false;
+}
+
+//----------------------------------------------------------------------------
+//Remove any leftover .mbm files prior to retrieving a screenshot
+bool CSTATEngine::RemoveLeftoverMBMFiles()
+{
+	CFileFind imagefinder;
+	CString imagedir = cScreenshotDirectory;
+	bool valid = true;
+
+	// add the search pattern
+	if (imagedir.Right(1) != _T('\\'))
+		imagedir += _T("\\");
+
+	// now add a folder for the connection type
+	if (bMultithreaded)
+	{
+		imagedir += GetConnection(eConnectType);
+		imagedir += _T(".");
+		imagedir += szAddress;
+		imagedir += _T('\\');
+	}
+
+	imagedir += _T("*.mbm");
+
+//	Message("Searching for [%s]", ToAnsi(imagedir));
+
+	EnterCriticalSection(&CriticalSection);
+
+	// locate files
+	int iLeftFiles = imagefinder.FindFile(imagedir, 0);
+	while (iLeftFiles)
+	{
+		iLeftFiles = imagefinder.FindNextFile();
+//		Message("Deleting file [%s]", ToAnsi(imagefinder.GetFilePath()));
+
+		if (!DeleteFile(imagefinder.GetFilePath()))
+		{
+			valid = false;
+			break;
+		}
+	}
+
+	imagefinder.Close();
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+
+//----------------------------------------------------------------------------
+// Append the device log to the end of the STAT log
+void CSTATEngine::AppendCommandToSTATLog(char *heading, char *log, unsigned long length)
+{
+	if (length && log)
+	{
+		EnterCriticalSection(&CriticalSection);
+		Message(DOTTED_LINE);
+		Message(heading);
+
+		char *start = log;
+		char *eol = log;
+		unsigned long count = 0;
+
+		*(log + length) = (char)0;
+
+		while (count < length - 1)
+		{
+			// find the end of the line
+			while ((count < length - 1) && (*eol != '\r') && (*eol != '\n'))
+			{
+				count++;
+				eol++;
+			}
+
+			// null it
+			if (count < length - 1)
+			{
+				*eol = (char)0;
+				count++;
+				eol++;
+			}
+
+			if (start && *start)
+				Message("%s", start);
+
+			// step over newline
+			while ((count < length - 1) && (*eol == '\r') || (*eol == '\n'))
+			{
+				count++;
+				eol++;
+			}
+
+			if (count < length - 1)
+				start = eol;
+		}
+
+		Message(DOTTED_LINE);
+		LeaveCriticalSection(&CriticalSection);
+	}
+	else
+		Message("No information returned from device");
+}
+
+//----------------------------------------------------------------------------
+// Store some data in a public defined char* pointer
+//  (currently iTEFSharedData and pDeviceInfo)
+void CSTATEngine::StoreData( char* aData, unsigned long aLength, char*& aOutputPtr )
+{
+
+	receivedData.Empty();
+	receivedData = aData;
+
+	if( aOutputPtr )
+	{
+		delete [] aOutputPtr;
+		aOutputPtr = NULL;
+	}
+
+	if( aData && aLength )
+	{
+		aOutputPtr = new char[aLength + 1];
+		if( aOutputPtr )
+		{
+			// skip over leading CR/LF's
+			char *p = aData;
+			while (p && (*p) && (*p == '\r') || (*p == '\n'))
+				p++;
+			strcpy(aOutputPtr, p);
+		}
+	}
+}
+
+//----------------------------------------------------------------------------
+// Translate a connection type to a string
+CString CSTATEngine::GetConnection(STATCONNECTTYPE eConnectType)
+{
+	CString connection;
+
+	switch(eConnectType)
+	{
+	case SymbianSocket:
+		connection = _T("SymbianSocket");
+		break;
+	case SymbianSerial:
+		connection = _T("SymbianSerial");
+		break;
+	case SymbianInfrared:
+		connection = _T("SymbianInfrared");
+		break;
+	case SymbianBluetooth:
+		connection = _T("SymbianBluetooth");
+		break;
+	case SymbianUsb:
+		connection = _T("SymbianUsb");
+		break;
+	default:
+		connection = _T("SymbianInvalid");
+		break;
+	};
+
+	return connection;
+}
+
+
+//----------------------------------------------------------------------------
+//  Sets a data socket to read/write file streams
+//
+int CSTATEngine::SetSocket(const char *ip, const int port)
+{
+
+	//initialise winsock
+	WSAStartup( MAKEWORD(2,2), &wsaData );
+	
+	dataSocket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
+
+    if ( dataSocket == INVALID_SOCKET ) 
+	{
+        dataSocket=NULL;
+		return E_SOCKETCREATE; 
+    }
+
+	// Connect to a server.
+    sockaddr_in clientService;
+
+    clientService.sin_family = AF_INET;
+    clientService.sin_addr.s_addr = inet_addr( ip );
+    clientService.sin_port = htons( port );
+
+    if ( connect( dataSocket, (SOCKADDR*) &clientService, sizeof(clientService) ) == SOCKET_ERROR) 
+	{
+        ReleaseSocket();
+		return E_SOCKETCONNECT;
+    }
+	else
+	{
+		return ITS_OK;
+	}
+
+
+	
+}
+
+int CSTATEngine::ReleaseSocket()
+{
+	int ret = ITS_OK;
+
+	//release the socket
+	if( closesocket(dataSocket) == SOCKET_ERROR)
+	{
+		ret = E_SOCKETCLOSE;
+	}
+
+
+	//cleanup winsock
+	WSACleanup();
+
+	dataSocket=NULL;
+
+	return ret;
+	
+}
+
+
+//----------------------------------------------------------------------------
+// Read from the board and write to the data socket
+//
+
+void CSTATEngine::WriteToSocket(const char *data, int *length)
+{
+	// Send data.
+   	*length = send( dataSocket, data, *length , 0 );
+}
+
+
+
+//----------------------------------------------------------------------------
+// Read from the data socket and send to the board
+//
+void CSTATEngine::ReadFromSocket(char *data, int *length)
+{
+	int bufferSize = 0xFF;
+
+	if(*length >= bufferSize)
+	{
+	
+		int packetLength = *length;
+		
+		int totalRead = 0;
+		int iterRead = 0;
+
+		// Receive data to fill a packet
+		while(totalRead <= packetLength - bufferSize)
+		{
+			iterRead = recv( dataSocket, data + totalRead, bufferSize, 0 );
+			if(iterRead == 0)
+				break;
+			totalRead += iterRead;
+		}
+
+		*length = totalRead;
+	}
+	else
+	{
+		*length = recv( dataSocket, data, *length, 0 );
+	}
+}
+
+
+
+
+
+
+
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statexp.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,402 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "statexp.h"
+#include "statlist.h"
+
+//////////////////////////////////////////////////////////////////////////
+// our thread-safe mechanism for list manipulation and back-end processing
+CRITICAL_SECTION CriticalSection;
+//////////////////////////////////////////////////////////////////////////
+
+// get the version
+STAT_EXPORT const char * __cdecl Version()
+{
+	return aList.Version();
+}
+
+// set logging for main STAT connection interface
+STAT_EXPORT int __cdecl SetConnectionLogging(const char *pszLogPath)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int valid = aList.SetLogging(pszLogPath);
+
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+// set logging for main STAT connection interface
+STAT_EXPORT void __cdecl CloseConnectionLogging()
+{
+	EnterCriticalSection(&CriticalSection);
+
+	aList.StopLogging();
+
+	LeaveCriticalSection(&CriticalSection);
+}
+
+// connect to the remote target
+STAT_EXPORT int __cdecl Connect(const STATCONNECTTYPE iConnectType, const char *pszPlatformType, void *Reserved1, void *Reserved2)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int valid = false;
+
+	// unused parameters
+	(void)Reserved1;
+	(void)Reserved2;
+
+	if (iConnectType && pszPlatformType && (*pszPlatformType))
+		valid = aList.CreateListMember(iConnectType, pszPlatformType);
+	else
+		strcpy(aList.szErrorText, "Invalid or missing parameter(s)");
+
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+STAT_EXPORT int __cdecl ConnectMT(const STATCONNECTTYPE iConnectType, const char *pszPlatformType)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int valid = Connect(iConnectType, pszPlatformType);
+	if (valid)
+	{
+		aList.Member(valid)->SetMultithreaded();
+	}
+
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+// set the delay between executed commands
+STAT_EXPORT int __cdecl SetCommandDelay(const int handle, const unsigned int iMillisecondDelay)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int valid = false;
+
+	if (handle && aList.ListExists())
+		valid = aList.Member(handle)->SetCommandDelay(iMillisecondDelay);
+	else
+		strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+// set logging for individual STAT connection command processing
+STAT_EXPORT int __cdecl SetCommandLogging(const int handle,
+						   const char *pszLogPath,
+						   MessageReporter *const aMessageReporter,
+						   const STATLOGLEVEL iLevel,
+					       const bool bAppend,
+						   void* Reserved1,
+						   void* Reserved2)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int valid = false;
+
+	// unused parameters
+	(void)iLevel;
+	(void)Reserved1;
+	(void)Reserved2;
+
+	if (handle && aList.ListExists())
+		valid = aList.Member(handle)->SetLogging(STATDLLMember::ToUnicode(pszLogPath), bAppend, aMessageReporter);
+	else
+		strcpy(aList.szErrorText, "Invalid handle or connection does not exist");
+
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+// set image verification settings
+STAT_EXPORT int __cdecl SetImageVerification(const int handle, const char * pszRefDir, const bool bRemoveOldImages, const int iFactor)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int valid = false;
+
+	if (handle && aList.ListExists())
+		valid = aList.Member(handle)->SetImageVerification(STATDLLMember::ToUnicode(pszRefDir), bRemoveOldImages, iFactor);
+	else
+		strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+// open a script file within the member
+STAT_EXPORT int __cdecl OpenScriptFile(const int handle, const char *pszText, bool bIsFile)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->OpenScriptFile(STATDLLMember::ToUnicode(pszText), bIsFile);
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// run a command in the script engine
+STAT_EXPORT int __cdecl RunScript(const int handle, ScriptProgressMonitor *const monitor)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->RunScript(monitor);
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// send a command to the remote target
+STAT_EXPORT int __cdecl SendRawCommand(const int handle, const char *pszText, ScriptProgressMonitor *const monitor)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->SendRawCommand(STATDLLMember::ToUnicode(pszText), monitor);
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// send a command to the remote target
+STAT_EXPORT int __cdecl SendCommandFile(const int handle, const char *pszText, ScriptProgressMonitor *const monitor)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->SendCommandFile(STATDLLMember::ToUnicode(pszText), monitor);
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// get the number of commands in the current script
+STAT_EXPORT int __cdecl GetCommandCount(const int handle, const char *pszFile, int *commandCount)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->GetCommandCount(pszFile, commandCount);
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// get the number of current command
+STAT_EXPORT int __cdecl GetCurrentCommandNumber(const int handle, int *commandNumber)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->GetCurrentCommandNumber(commandNumber);
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// get the text received by the last command
+STAT_EXPORT const char* __cdecl GetReceivedData(const int handle)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->GetReceivedData();
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return NULL;
+}
+
+// stop processing the current command on the remote target
+STAT_EXPORT int __cdecl StopProcessing(int handle)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->StopProcessing();
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// get a bitmap snapshot of the remote target
+STAT_EXPORT int __cdecl GetSnapshot(const int handle, TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->GetSnapshot(ppFile, ppBitmap, ppData, pSize);
+
+	strcpy(aList.szErrorText, "Invalid parameter(s) or connection does not exist");
+	return false;
+}
+
+// disconnect from the remote target
+STAT_EXPORT int __cdecl Disconnect(const int handle)
+{
+	EnterCriticalSection(&CriticalSection);
+
+	int valid = false;
+
+	if (handle && aList.ListExists())
+		valid = aList.RemoveListMember(handle);
+	else
+		strcpy(aList.szErrorText, "Invalid handle or connection does not exist");
+
+	LeaveCriticalSection(&CriticalSection);
+	return valid;
+}
+
+// get the last error thrown
+STAT_EXPORT const char * __cdecl GetError(const int handle)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->GetErrorText();
+
+	return aList.szErrorText;
+}
+
+// get the error text for a particular error code
+STAT_EXPORT const char * __cdecl GetErrorText(const int handle, int errorCode)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->GetErrorText(errorCode);
+
+	return aList.szErrorText;
+}
+
+// get the TEF Shared Data
+STAT_EXPORT const char * __cdecl GetTEFSharedData(const int handle)
+{
+	if (handle && aList.ListExists())
+		return aList.Member(handle)->GetTEFSharedData();
+
+	return NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////
+// STD CALL ENTRYPOINTS
+///////////////////////////////////////////////////////////////////////////////////////
+
+STAT_EXPORT const char * __stdcall StdVersion()
+{
+	return Version();
+}
+
+STAT_EXPORT const char * __stdcall StdGetError(const int handle)
+{
+	return GetError(handle);
+}
+
+STAT_EXPORT const char * __stdcall StdGetErrorText(const int handle, int errorCode)
+{
+	return GetErrorText(handle, errorCode);
+}
+
+STAT_EXPORT const char * __stdcall StdGetTEFSharedData(const int handle)
+{
+	return GetTEFSharedData(handle);
+}
+
+STAT_EXPORT int __stdcall StdSetConnectionLogging(const char *filename)
+{
+	return (SetConnectionLogging(filename));
+}
+
+STAT_EXPORT void __stdcall StdCloseConnectionLogging()
+{
+	CloseConnectionLogging();
+}
+
+STAT_EXPORT int __stdcall StdConnect(const STATCONNECTTYPE iConnectType, const char *pszPlatformType, void *Reserved1, void *Reserved2)
+{
+	return (Connect(iConnectType, pszPlatformType, Reserved1, Reserved2));
+}
+
+STAT_EXPORT int __stdcall StdConnectMT(const STATCONNECTTYPE iConnectType, const char *pszPlatformType)
+{
+	return (ConnectMT(iConnectType, pszPlatformType));
+}
+
+STAT_EXPORT int __stdcall StdDisconnect(const int handle)
+{
+	return Disconnect(handle);
+}
+
+STAT_EXPORT int __stdcall StdSetCommandDelay(const int handle, const unsigned int iMillisecondDelay)
+{
+	return SetCommandDelay(handle, iMillisecondDelay);
+}
+
+STAT_EXPORT int __stdcall StdSetCommandLogging(const int handle, 
+											const char *pszLogPath,
+											MessageReporter *const aMessageReporter,
+											const STATLOGLEVEL iLevel,
+											const bool bAppend,
+											void* Reserved1,
+											void* Reserved2)
+{ 
+	return SetCommandLogging(handle,
+							pszLogPath,
+							aMessageReporter,
+							iLevel,
+							bAppend,
+							Reserved1,
+							Reserved2);
+}
+
+STAT_EXPORT int __stdcall StdSetImageVerification(const int handle, const char *pszRefDir, const bool bRemoveOldImages, const int iFactor)
+{
+	return SetImageVerification(handle, pszRefDir, bRemoveOldImages, iFactor);
+}
+
+STAT_EXPORT int __stdcall StdOpenScriptFile(const int handle, LPCTSTR pszText, bool bIsFile)
+{
+	return OpenScriptFile(handle, pszText, bIsFile);
+}
+
+STAT_EXPORT int __stdcall StdRunScript(const int handle, ScriptProgressMonitor *const monitor)
+{
+	return RunScript(handle, monitor);
+}
+
+STAT_EXPORT int __stdcall StdSendRawCommand(const int handle, const char *pszText, ScriptProgressMonitor *const monitor)
+{
+	return SendRawCommand(handle, pszText, monitor);
+}
+
+STAT_EXPORT int __stdcall StdSendCommandFile(const int handle, const char *pszFile, ScriptProgressMonitor *const monitor)
+{
+	return SendCommandFile(handle, pszFile, monitor);
+}
+
+STAT_EXPORT int __stdcall StdGetCommandCount(const int handle, const char *pszFile, int *commandCount)
+{
+	return GetCommandCount(handle, pszFile, commandCount);
+}
+
+STAT_EXPORT int __stdcall StdGetCurrentCommandNumber(const int handle, int *commandNumber)
+{
+	return GetCurrentCommandNumber(handle, commandNumber);
+}
+
+STAT_EXPORT const char* __stdcall StdGetReceivedData(const int handle)
+{
+	return GetReceivedData(handle);
+}
+
+STAT_EXPORT int __stdcall StdStopProcessing(int handle)
+{
+	return StopProcessing(handle);
+}
+
+STAT_EXPORT int __stdcall StdGetSnapshot(int handle, TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize)
+{
+	return GetSnapshot(handle, ppFile, ppBitmap, ppData, pSize);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statlist.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,249 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "statlist.h"
+
+////////////////////////////////////////////////////////////////////////////////////////
+// The one and only connection list
+STATDLLList aList;
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Constructor
+STATDLLList::STATDLLList()
+: ListStart(0)
+{
+	InitializeCriticalSection(&CriticalSection);
+
+	memset(szVersion, 0, sizeof(szVersion));
+	sprintf(szVersion, "%s.%s.%s", STAT_VERSION_MAJOR, STAT_VERSION_MINOR, STAT_VERSION_PATCH);
+
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Destructor
+//
+STATDLLList::~STATDLLList()
+{
+	// release list members (passing 0 will return the last member in the list)
+	STATDLLMember* pMember = Member(0);
+	while(pMember)
+	{
+		RemoveListMember((DWORD)pMember);
+		pMember = Member(0);
+	}
+
+	StopLogging();
+	DeleteCriticalSection(&CriticalSection);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Turns on logging for STAT multiple connection management.
+//
+int
+STATDLLList::SetLogging(const char *path)
+{
+	bool valid = false;
+	if (!oRep.active())
+	{
+		// split path into folder/file
+		char folder[MAX_PATH + 1] = {0};
+		strcpy(folder, path);
+		char *ptr = strrchr(folder, '\\');
+		if (ptr)
+		{
+			char file[MAX_PATH + 1] = {0};
+			strcpy(file, ptr + 1);
+			(*ptr) = (char)0;
+
+			if (*file)
+			{
+				if (oRep.init(STAT_APPNAME, RPT_ALL, RPT_FILE, folder, file))
+				{
+					oRep.dash();
+					oRep.header("%s", STAT_APPNAME);
+					valid = true;
+				}
+				else
+					strcpy(szErrorText, "Connection logging failed (file system error).");
+			}
+			else
+				strcpy(szErrorText, "Connection logging failed (invalid filename).");
+		}
+		else
+			strcpy(szErrorText, "Connection logging failed (invalid path).");
+	}
+	else
+		strcpy(szErrorText, "Connection logging is already initialised.");
+
+	return valid;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Turns off logging
+//
+void
+STATDLLList::StopLogging()
+{
+	if (oRep.active())
+		oRep.kill();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Open a connection with a new list member
+//
+DWORD
+STATDLLList::CreateListMember(const STATCONNECTTYPE iConnectType, const char *pszPlatformType)
+{
+	bool valid = false;
+
+	(*szErrorText) = (char)0;
+	oRep.info("Creating new list member (%d : %s)...", iConnectType, pszPlatformType);
+
+	STATDLLMember *ptr = new STATDLLMember(iConnectType, pszPlatformType, &oRep);
+	if (ptr)
+	{
+		if (ptr->GetErrorCode() == ITS_OK)
+		{
+			// add to list
+			if (ListStart)
+			{
+				ptr->lPrevConnection = Member(0);				// returns last member in list
+				ptr->lPrevConnection->lNextConnection = ptr;
+				ptr->lNextConnection = NULL;
+			}
+			else
+			{
+				ListStart = ptr;
+			}
+
+//			WalkList();
+
+			oRep.info("Member %ld (%d : %s) created", ptr, iConnectType, pszPlatformType);
+			valid = true;
+		}
+		else
+		{
+			// save the error thrown
+			strcpy(szErrorText, ptr->GetErrorText());
+			delete ptr;
+			ptr = NULL;
+		}
+	}
+
+	if (!ptr || !valid)
+		oRep.error("ERROR: Could not create new member");
+
+	return (DWORD)ptr;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Find and return a member connection
+// If 0 or bad pointer is passed, will return the last position in the list
+// If nothing in list, will return NULL
+//
+STATDLLMember*
+STATDLLList::Member(const DWORD dwHandle)
+{
+	STATDLLMember *current = 0, *next = 0;
+	next = ListStart;
+	while (next)
+	{
+		current = next;
+		if (current == (STATDLLMember *)dwHandle)
+			break;
+
+		next = current->lNextConnection;
+	}
+
+	return current;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Close a member connection
+//
+bool
+STATDLLList::RemoveListMember(const DWORD dwHandle)
+{
+	STATDLLMember *current = Member(dwHandle);
+	oRep.info("Removing list member %ld...", dwHandle);
+	bool valid = false;
+
+	// remove from list
+	if (current)
+	{
+		// something before
+		if (current->lPrevConnection)
+			current->lPrevConnection->lNextConnection = current->lNextConnection;
+		else
+			ListStart = current->lNextConnection;
+
+		// something after
+		if (current->lNextConnection)
+			current->lNextConnection->lPrevConnection = current->lPrevConnection;
+
+		delete current;
+		oRep.info("Member removed");
+
+//		WalkList();
+
+		valid = true;
+	}
+	else
+		oRep.error("ERROR: Could not remove");
+
+	return valid;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Private Methods
+//////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// walks the list for debug purposes
+//
+void
+STATDLLList::WalkList()
+{
+	if (ListStart)
+		oRep.dash();
+
+	STATDLLMember *current = 0, *next = 0;
+	next = ListStart;
+	while (next)
+	{
+		current = next;
+
+		oRep.info("Member details: Previous:%ld this:%ld Next:%ld",
+			current->lPrevConnection, current, current->lNextConnection);
+
+		next = current->lNextConnection;
+	}
+
+	if (ListStart)
+		oRep.dash();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statmember.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,635 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "statmember.h"
+#include <stdio.h>
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Construct and initialise a STAT object and check it hasn't passed it's expiry date.
+//
+STATDLLMember::STATDLLMember(const STATCONNECTTYPE iConnectType, const char *pszPlatformType, Reporter *theRep)
+: pRep(theRep), 
+  iConnectionType(iConnectType), 
+  iErrorCode(GENERAL_FAILURE), 
+  lNextConnection((STATDLLMember*)0), 
+  lPrevConnection((STATDLLMember*)0),
+  pEngine(NULL)
+{
+	CString lPrefix="";
+
+	pszAddress = NULL;
+	iErrorCode = GENERAL_FAILURE;
+	strcpy(szErrorText, "An unknown error has occured");
+
+	// set logging identifier
+	lPrefix.Format(LPCTSTR("[%d:%s] "), iConnectType, pszPlatformType);
+ 	const char *lPrefixPtr=(const char *)lPrefix.GetBuffer(lPrefix.GetLength());
+	strncpy(szPrefix, lPrefixPtr, MAX_ID_PREFIX);
+
+	pEngine = new CSTATEngine;
+	if (pEngine)
+	{
+		if ((iErrorCode = pEngine->Initialise(iConnectType, pszPlatformType)) != ITS_OK)
+		{
+			ErrorMessage("Could not initialise new connection object");
+			delete pEngine;
+			pEngine = NULL;
+		}
+		else
+		{
+			pszAddress = new char[strlen(pszPlatformType) + 1];
+			if (pszAddress)
+				strcpy(pszAddress, pszPlatformType);
+		}
+	}
+	else
+		ErrorMessage("Could not create new connection object");
+
+	// did we make it?
+	if (iErrorCode == ITS_OK)
+		Message("Connection initialised successfully");
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Release any STAT resources.
+//
+STATDLLMember::~STATDLLMember()
+{
+	if (pEngine)
+	{
+		Message("Releasing member resources");
+		pEngine->Release();
+		delete pEngine;
+	}
+
+	if (pszAddress)
+		delete [] pszAddress;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Do all the preparations in one go
+//
+bool
+STATDLLMember::Prepare(int iMillisecondDelay, LPTSTR pszLogPath, bool bAppend, MessageReporter *const aMessageReporter, LPTSTR pszRefDir, const bool bRemoveOldImages, const int iFactor, bool bState)
+{
+	if (pEngine)
+	{
+		pEngine->SetMultithreaded(bState);
+	}
+
+	if (!SetCommandDelay(iMillisecondDelay))
+		return false;
+
+	if (pszLogPath && (*pszLogPath) && !SetLogging(pszLogPath, bAppend, aMessageReporter))
+		return false;
+
+	if (pszRefDir && (*pszRefDir) && !SetImageVerification(pszRefDir, bRemoveOldImages, iFactor))
+		return false;
+
+	return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Set the delay time between commands
+//
+int
+STATDLLMember::SetCommandDelay(int iMillisecondDelay)
+{
+	if (pEngine)
+	{
+		pEngine->SetCommandDelay(iMillisecondDelay);
+		Message("Command delay set");
+		iErrorCode = ITS_OK;
+		return true;
+	}
+
+	iErrorCode = GENERAL_FAILURE;
+	ErrorMessage("Command delay could not be set");
+	return false;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Set logging of STAT commands.
+//
+int
+STATDLLMember::SetLogging(LPTSTR pszLogPath, bool bAppend, MessageReporter *const aMessageReporter)
+{
+	iErrorCode = GENERAL_FAILURE;
+	CString logpath = pszLogPath;
+
+	if (pEngine)
+	{
+		if (LOG_FILE_OK == (iErrorCode = pEngine->SetLogging(logpath, szPrefix, bAppend, 
+				(aMessageReporter != NULL), true, aMessageReporter)))
+		{
+			Message("Logging set");
+			return LOG_FILE_OK;
+		}
+	}
+
+	ErrorMessage("Logging could not be set");
+	return GENERAL_FAILURE;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Send a string of STAT commands through to the STAT object.
+//
+int
+STATDLLMember::SendRawCommand(LPCTSTR pszText, ScriptProgressMonitor *const monitor)
+{
+	iErrorCode = GENERAL_FAILURE;
+	CString file = pszText;
+
+	if (pEngine)
+	{
+		{
+		CString msg;
+		msg.Format( "Sending raw command...%s", pszText );
+		Message(msg.operator LPCTSTR());
+		}
+		if ((iErrorCode = pEngine->OpenScriptFile(file, false)) == ITS_OK)
+			if ((iErrorCode = pEngine->RunScript(monitor)) == END_SCRIPT)
+				return ITS_OK;
+	}
+
+	ErrorMessage("Command text could not be processed successfully");
+	return iErrorCode;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Open a script file or text block in the engine.
+//
+int
+STATDLLMember::OpenScriptFile(LPCTSTR pszText, bool bIsFile)
+{
+	iErrorCode = GENERAL_FAILURE;
+	CString file = pszText;
+
+	if (pEngine)
+	{
+		{
+		CString msg;
+		msg.Format( "Opening script file...%s", pszText );
+		Message(msg.operator LPCTSTR());
+		}
+		if ((iErrorCode = pEngine->OpenScriptFile(pszText, bIsFile)) == ITS_OK)
+				return iErrorCode;
+	}
+
+	ErrorMessage("Open script file could not be processed successfully");
+	return iErrorCode;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Runs the script in the engine.
+//
+int
+STATDLLMember::RunScript(ScriptProgressMonitor *const monitor)
+{
+	iErrorCode = GENERAL_FAILURE;
+
+	if (pEngine)
+	{
+		{
+		CString msg;
+		msg.Format( "Running script..." );
+		Message(msg.operator LPCTSTR());
+		}
+
+		iErrorCode = pEngine->RunScript(monitor);
+	}
+
+	if( iErrorCode != END_SCRIPT )
+	{
+		ErrorMessage("Run script could not be processed successfully");
+	}
+
+	if(monitor)
+	{
+		monitor->OnCompleteScript( iErrorCode );
+	}
+
+	return iErrorCode;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Send a command file containing a string of STAT commands through to the STAT object.
+// Checks that it is actually an accessible file before accepting it.
+//
+int
+STATDLLMember::SendCommandFile(LPCTSTR pszFile, ScriptProgressMonitor *const monitor)
+{
+	iErrorCode = GENERAL_FAILURE;
+	CString file = pszFile;
+
+	if (pEngine)
+	{
+		Message("Sending command file...");
+		if ((iErrorCode = pEngine->OpenScriptFile(file, true)) == ITS_OK)
+			if ((iErrorCode = pEngine->RunScript(monitor)) == END_SCRIPT)
+				return true;
+	}
+
+	ErrorMessage("Script file could not be processed successfully");
+	return false;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Stops processing the current command.
+//
+int
+STATDLLMember::StopProcessing(void)
+{
+	iErrorCode = GENERAL_FAILURE;
+
+	if (pEngine)
+	{
+		Message("Stopping processing...");
+		pEngine->eStopProcessing = STAT_PAUSE;
+		return true;
+	}
+
+	ErrorMessage("Stopping the process could not be processed successfully");
+	return false;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Returns the number of commands in the current script.
+//
+int
+STATDLLMember::GetCommandCount(LPCTSTR pszFile, int* commandCount)
+{
+	iErrorCode = GENERAL_FAILURE;
+
+	if (pEngine)
+	{
+		Message("Sending command file...");
+		if ((iErrorCode = pEngine->GetCommandCount(pszFile, commandCount)) == ITS_OK)
+				return ITS_OK;
+	}
+
+	ErrorMessage("Getting the command count could not be processed successfully");
+	return GENERAL_FAILURE;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Returns the number of the current command.
+//
+int
+STATDLLMember::GetCurrentCommandNumber( int* commandNumber )
+{
+	iErrorCode = GENERAL_FAILURE;
+
+	if (pEngine)
+	{
+		Message("Getting current command number...");
+		*commandNumber =	pEngine->iCurrentCommand;
+		iErrorCode = ITS_OK;
+			return iErrorCode;
+	}
+
+	ErrorMessage("Getting the current command number could not be processed successfully");
+	return iErrorCode;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Returns the text recevied by the commands.
+//
+const char *
+STATDLLMember::GetReceivedData(void)
+{
+	if (pEngine)
+	{
+		Message("Getting data received by commands...");
+		return ( pEngine->GetReceivedData() );
+	}
+
+	return ( "Getting the error text could not be processed successfully" );
+}
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Returns the text associated with an error value.
+//
+const char *
+STATDLLMember::GetErrorText( int errorCode )
+{
+	if (pEngine)
+	{
+		Message("Getting current command number...");
+		return ( pEngine->GetErrorText(errorCode) );
+	}
+
+	return ( "Getting the error text could not be processed successfully" );
+}
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Sets image verification with supplied reference directory, and will remove existing
+// images if specified.  Also sets the 'fudge' factor for the verification itself.
+//
+int
+STATDLLMember::SetImageVerification(LPTSTR pszRefDir, const bool bRemoveOldImages, const int iFactor)
+{
+	iErrorCode = GENERAL_FAILURE;
+	Message("Setting image verification Dir [%s] Remove Old %d Factor %d...", ToAnsi(pszRefDir), bRemoveOldImages, iFactor);
+
+	if (pEngine && pEngine->pImageVerify)
+	{
+		//set default logging path
+		CString defaultDirectory=STAT_LOGFILEPATH_VALUE;
+		//read from inifile if entry exists
+		if(statIniFile.SectionExists(ST_TEST_KEY) )
+		{
+			CString setting;
+			setting.Empty();
+			setting=statIniFile.GetKeyValue(ST_LOGFILEPATH,ST_TEST_KEY);
+			if(!setting.IsEmpty())
+				defaultDirectory = setting;
+		}
+		iErrorCode = pEngine->pImageVerify->Initialise(defaultDirectory);
+		if(iErrorCode == ERROR_REGISTRY)
+		{
+			ErrorMessage("Config file failure");
+		}
+		else if(iErrorCode == REFDIR_FOUND)
+		{
+			if (bRemoveOldImages)
+			{
+				Message("Removing old images...");
+				iErrorCode = pEngine->pImageVerify->DeleteReferenceImages();
+			}
+			else
+				Message("Old reference images exist");
+		}
+
+		// if preparations went OK...
+		if(iErrorCode == ITS_OK)
+		{
+			Message("Copying new images from [%s]...", ToAnsi(pszRefDir));
+			iErrorCode = pEngine->pImageVerify->CopyReferenceImages(pszRefDir);
+			if(iErrorCode != ITS_OK)
+				ErrorMessage("Images could not be copied");
+		}
+
+		// success?
+		if(iErrorCode == ITS_OK || iErrorCode == REFDIR_FOUND)
+		{
+			if (pEngine->pImageVerify->EnableVerification(iFactor) > 0)
+			{
+				Message("Image verification set");
+				return true;
+			}
+			else
+			{
+				iErrorCode = GENERAL_FAILURE;
+				ErrorMessage("No images available for verification");
+			}
+		}
+
+		// disable on error
+		pEngine->pImageVerify->DisableVerification();
+	}
+
+	ErrorMessage("Image verification could not be set");
+	return false;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Gets a 'snapshot' of the screen of the remote target and returns the information
+// and data in the supplied parameters. Only stores the most recent snapshot.
+//
+STATDLLMember::GetSnapshot(TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize)
+{
+	// basic screenshot command
+	CString file = "<B><S><E>";
+
+	iErrorCode = GENERAL_FAILURE;
+	*ppFile = NULL;
+	*ppBitmap = NULL;
+	*ppData = NULL;
+	*pSize = NULL;
+
+	if (pEngine)
+	{
+		Message("Sending snapshot command...");
+		if ((iErrorCode = pEngine->OpenScriptFile(file, false)) == ITS_OK)
+		{
+			pEngine->pConverter->bWriteToFile = false;
+			if ((iErrorCode = pEngine->RunScript(NULL)) == END_SCRIPT)
+			{
+				Message("Accessing bitmap data...");
+				pEngine->pConverter->GetScreenshotData(ppFile, ppBitmap, ppData, pSize);
+			}
+			pEngine->pConverter->bWriteToFile = true;
+		}
+	}
+
+	// success
+	if (ppFile && (*ppFile) && ppBitmap && (*ppBitmap) && ppData && (*ppData) && pSize && (*pSize))
+	{
+		Message("Bitmap data retrieved successfully");
+		return true;
+	}
+
+	ErrorMessage("Snapshot could not be taken");
+	return false;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Converts a char * to it's Unicode equivalent
+//
+LPTSTR
+STATDLLMember::ToUnicode(const char *string)
+{
+#ifdef UNICODE
+	static TCHAR szBuffer[MAX_UNICODE_LEN + 1] = {0};
+	szBuffer[0] = (TCHAR)0;
+
+    // Convert to UNICODE.
+    if (!MultiByteToWideChar(CP_ACP,					// conversion type
+							 0,							// flags
+							 string,					// source
+							 -1,						// length
+							 szBuffer,					// dest
+							 MAX_UNICODE_LEN))			// length
+    {
+        return _T("Could not convert");
+    }
+
+    return szBuffer;
+#else
+	return (LPTSTR)string;
+#endif
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Converts a Unicode to it's char * equivalent
+//
+const char *
+STATDLLMember::ToAnsi(LPCTSTR string)
+{
+#ifdef UNICODE
+	static char szBuffer[MAX_UNICODE_LEN + 1] = {0};
+	szBuffer[0] = (char)0;
+
+    // Convert to ANSI.
+    if (!WideCharToMultiByte(CP_ACP,					// conversion type
+							 0,							// flags
+							 string,					// source
+							 -1,						// length
+							 szBuffer,					// dest
+							 MAX_UNICODE_LEN,			// length
+							 NULL,
+							 NULL ))
+    {
+        return "Could not convert";
+    }
+
+    return szBuffer;
+#else
+	return (char *)string;
+#endif
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Split a connection registry entry into its respective parts
+void
+STATDLLMember::ParseConnection(char *pConnection, STATCONNECTTYPE *pType, char **ppAddress)
+{
+	(*pType) = SymbianInvalid;
+	(*ppAddress) = NULL;
+
+	static char szConnection[256];
+	memset(szConnection, 0, sizeof(szConnection));
+	strcpy(szConnection, pConnection);
+
+	char *p = strchr(szConnection, ':');
+	if (p)
+	{
+		(*p) = (char)0;
+		(*ppAddress) = p + 1;
+
+		if (stricmp(szConnection, "SymbianSocket") == 0)
+		{
+			(*pType) = SymbianSocket;
+		}
+		else if (stricmp(szConnection, "SymbianSerial") == 0)
+		{
+			(*pType) = SymbianSerial;
+		}
+		else if (stricmp(szConnection, "SymbianInfrared") == 0)
+		{
+			(*pType) = SymbianInfrared;
+		}
+		else if (stricmp(szConnection, "SymbianBluetooth") == 0)
+		{
+			(*pType) = SymbianBluetooth;
+		}
+
+		(*p) = ':';
+	}
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// PRIVATE METHODS
+//////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Writes a message to file
+//
+void
+STATDLLMember::Message(const char * message, ...)
+{
+	if (pRep)
+	{
+		char szText[MAX_ERROR_MSG_LEN * 2] = {0};
+		va_list pMsg;
+
+		strcpy(szText, szPrefix);
+
+		va_start (pMsg, message);
+		vsprintf (szText + strlen(szText), message, pMsg);
+		va_end (pMsg);
+
+		pRep->info(szText);
+	}
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Writes an error message to file
+//
+void
+STATDLLMember::ErrorMessage(const char * message, ...)
+{
+	if (pRep)
+	{
+		va_list pMsg;
+		char szErrorMsg[MAX_ERROR_MSG_LEN + 1] = {0};
+
+		// get the API error
+		va_start (pMsg, message);
+		vsprintf (szErrorMsg, message, pMsg);
+		va_end (pMsg);
+
+		// save the complete error
+		if (pEngine)
+		{
+			if (pEngine->GetDeviceReturnCode() != 0)
+			{
+				sprintf(szErrorText, "%s (%d : %s - Device return code %d)", 
+										szErrorMsg, 
+										iErrorCode, 
+										ToAnsi(pEngine->GetErrorText(iErrorCode)),
+										pEngine->GetDeviceReturnCode());
+			}
+			else
+			{
+				sprintf(szErrorText, "%s (%d : %s)", 
+										szErrorMsg, 
+										iErrorCode, 
+										ToAnsi(pEngine->GetErrorText(iErrorCode)));
+			}
+		}
+		else
+			strcpy(szErrorText, "(STAT Engine not initialised)");
+
+		// construct a full log message
+		char szLogError[MAX_ERROR_MSG_LEN * 2] = {0};
+		sprintf(szLogError, "%sERROR: %s", szPrefix, szErrorText);
+		pRep->error(szLogError);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statscriptdecoder.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,353 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "statscriptdecoder.h"
+
+//----------------------------------------------------------------------------
+// Contructor
+CSTATScriptCommand::CSTATScriptCommand()
+: cCommandID(0), pCommand(NULL), ulLength(0)
+{
+}
+
+//----------------------------------------------------------------------------
+// Destructor
+CSTATScriptCommand::~CSTATScriptCommand()
+{
+	Reset();
+}
+
+
+//----------------------------------------------------------------------------
+// Set command data
+bool CSTATScriptCommand::SetData(const char *pData, const unsigned long theLength)
+{
+	Reset();
+
+	if (pData && theLength)
+	{
+		pCommand = new char[theLength + 1];
+		if (!pCommand)
+			return false;
+
+		memcpy(pCommand, pData, theLength);
+		*(pCommand + theLength) = (char)0;
+		ulLength = theLength;
+	}
+
+	return true;
+}
+
+
+//----------------------------------------------------------------------------
+// Destructor
+void CSTATScriptCommand::Reset()
+{
+	if (pCommand)
+	{
+		delete [] pCommand;
+		pCommand = NULL;
+	}
+
+	ulLength = 0;
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Script Decoder class
+////////////////////////////////////////////////////////////////////////////////////////
+
+//----------------------------------------------------------------------------
+// Constructor
+CSTATScriptDecoder::CSTATScriptDecoder(CSTATLogFile *theLog)
+: lFileLength(0), iCounter(0),
+  lpBuffer(NULL)
+{
+	pLog = theLog;
+}
+
+
+//----------------------------------------------------------------------------
+// Destructor
+CSTATScriptDecoder::~CSTATScriptDecoder()
+{
+	Release();
+}
+
+
+//----------------------------------------------------------------------------
+// Read the script into memory
+int
+CSTATScriptDecoder::Initialise(const CString& file, bool bIsFile)
+{
+	lpBuffer = NULL;
+	int ret = OPEN_SCRIPT_FILE_COMPLETE_FAILURE;
+
+	// read the commands into memory
+	if (bIsFile)
+	{
+		CFile script_file;
+		if (script_file.Open(file, CFile::modeRead))
+		{
+			ret = ReadFileIntoMemory(script_file);
+			script_file.Abort();
+		}
+	}
+	else
+		ret = ReadDataIntoMemory(file);
+
+	// make sure we have valid start/end points in the script
+	if (ret == ITS_OK)
+		ret = ValidateScript();
+
+	if (ret == ITS_OK)
+	{
+		pLog->WriteTimeToLog();
+
+		if(bIsFile)
+		{
+			CString cBuffer = _T("Script file is : ");
+			cBuffer += file;
+			pLog->Write(cBuffer);
+		}
+		else
+			pLog->Write(_T("Interpreting command script..."));
+
+		ret = ITS_OK;
+	}
+	else
+		Release();
+
+	return ret;
+}
+
+
+//----------------------------------------------------------------------------
+// Release resources
+void CSTATScriptDecoder::Release()
+{
+	LastCommand.Reset();
+
+	// release the script
+	if (lpBuffer && lFileLength)
+	{
+		delete [] lpBuffer;
+		lpBuffer = NULL;
+		lFileLength = iCounter = 0;
+	}
+}
+
+
+//----------------------------------------------------------------------------
+// get the contents of a single command
+int
+CSTATScriptDecoder::GetNextCommand(CSTATScriptCommand **ppCommand)
+{
+	// get to the start of the command
+	while (lpBuffer[iCounter] != '<')
+	{
+		// comment
+		if (lpBuffer[iCounter] == '/' && lpBuffer[iCounter + 1] == '*')
+		{
+			if (ExtractComment())
+			{
+				*ppCommand = &LastCommand;
+				return LastCommand.cCommandID;
+			}
+
+			return 0;
+		}
+
+		if (!IncrementCounter())
+			return 0;
+	}
+
+	// step over the '<'
+	if (!IncrementCounter())
+		return 0;
+
+	// save the command ID
+	LastCommand.cCommandID = (char)toupper(lpBuffer[iCounter]);
+	if (!IncrementCounter())
+		return 0;
+
+	// need to step over 'image' with '#image' command
+	if (LastCommand.cCommandID == '#')
+	{
+		while (lpBuffer[iCounter] != ' ')
+			if (!IncrementCounter())
+				return 0;
+
+		// step over the space
+		if (!IncrementCounter())
+			return 0;
+	}
+
+	int iBeginning = iCounter;
+
+	// extract the command
+	while (lpBuffer[iCounter] != '>')
+		if (!IncrementCounter())
+			return 0;
+
+	// save our command
+	LastCommand.SetData(lpBuffer + iBeginning, iCounter - iBeginning);
+
+	// step over the '>'
+	IncrementCounter();
+
+	// set pointer to the command
+	*ppCommand = &LastCommand;
+	return LastCommand.cCommandID;
+}
+
+
+//----------------------------------------------------------------------------
+// PRIVATE METHODS
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+//reads string data into memory so that it can be decoded
+int CSTATScriptDecoder::ReadDataIntoMemory(const CString& commands)
+{
+	// Convert CString to char *
+	lFileLength = commands.GetLength();		//set length
+	lpBuffer = new char [lFileLength + 1];		//allocate temporary buffer
+	if (lpBuffer)
+	{
+		if (!pLog->ToAnsi(commands, 
+								  lpBuffer, 
+								  lFileLength))
+		{
+			return INTERPRET_COMMANDS_FAILURE;		//unable to convert to 8-bit
+		}
+
+		lpBuffer[lFileLength] = 0;
+		return ITS_OK;
+	}
+
+	return E_OUTOFMEM;
+}
+//----------------------------------------------------------------------------
+//reads file data into memory so that it can be decoded
+int CSTATScriptDecoder::ReadFileIntoMemory(CFile& scriptdata)
+{
+	try
+	{
+		lFileLength = scriptdata.GetLength();		//file length
+		lpBuffer = new char [lFileLength + 1];		//allocate temporary buffer
+		if (lpBuffer)
+		{
+			scriptdata.Read(lpBuffer, lFileLength);	//read in from the file and store in the buffer
+			lpBuffer[lFileLength] = 0;
+			return ITS_OK;
+		}
+	}
+	catch(CFileException *e)
+	{
+		e -> Delete();
+		return OPEN_SCRIPT_FILE_COMPLETE_FAILURE;
+	}
+
+	return E_OUTOFMEM;
+}
+
+
+//----------------------------------------------------------------------------
+// checks that start and end codes exist in the script
+// on success, iCounter will be left ready for the first STAT command
+int CSTATScriptDecoder::ValidateScript()
+{
+	CSTATScriptCommand *pCommand;
+	bool bFound = false;
+
+	// reset
+	iCounter = 0;
+
+	// look for end
+	while (GetNextCommand(&pCommand))
+	{
+		if (pCommand->cCommandID == 'E')
+		{
+			bFound = true;
+			break;
+		}
+	}
+
+	if (bFound)
+	{
+		// reset
+		iCounter = 0;
+		bFound = false;
+
+		// look for begin
+		while (GetNextCommand(&pCommand))
+		{
+			if (pCommand->cCommandID == 'B')
+			{
+				bFound = true;
+				iCounter -= 3;	// step back so this is the first command sent
+				break;
+			}
+		}
+	}
+
+	if (!bFound)
+		return BEGIN_COMMAND_FAILURE;
+
+	return ITS_OK;
+}
+
+
+//----------------------------------------------------------------------------
+// get a comment
+int
+CSTATScriptDecoder::ExtractComment()
+{
+	int iBeginning = iCounter;
+
+	LastCommand.cCommandID = lpBuffer[iCounter];
+	iCounter += 2;
+
+	while (((iCounter + 1) < lFileLength) &&
+		   !(lpBuffer[iCounter] == '*' && lpBuffer[iCounter + 1] == '/') )
+	{
+		if (!IncrementCounter())
+			return 0;
+	}
+
+	// get the last bit of the comment '*/'
+	if ((iCounter + 1) < lFileLength)
+		iCounter += 2;
+
+	// save our comment
+	LastCommand.SetData(lpBuffer + iBeginning, iCounter - iBeginning);
+	return LastCommand.cCommandID;
+}
+
+
+//----------------------------------------------------------------------------
+// increment counter but make sure we don't go over the end of the script
+bool CSTATScriptDecoder::IncrementCounter(void)
+{
+	return (++iCounter < lFileLength);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statserial.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,391 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// STATSerial.cpp
+// Implementation of the serial comms transport
+////////////////////////////////////////////////////////////////////////////////////////
+#include "stdafx.h"
+#include "statserial.h"
+#include "assert.h"
+#include "../../../../Common/inc/SerialPacketSize.h"
+
+#define SP_COMMANDSIZE	4
+#define SP_LENGTHSIZE	4
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Constructor
+CSTATSerial::CSTATSerial(STATCONNECTTYPE eConnect)
+: hComPort((HANDLE)0), 	pBuffer(NULL), iBufferLength(0), iMaxPacketSize(0)
+{
+	switch(eConnect)
+	{
+		case SymbianSerial:
+		case SymbianInfrared:
+			iMaxPacketSize = KMaxPacketSize;
+			break;
+		case SymbianBluetooth:
+			iMaxPacketSize = KMaxBluetoothPacketSize;
+			break;
+		default:
+			assert(0);
+			break;
+	};
+
+	assert(0 != iMaxPacketSize);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Destructor
+CSTATSerial::~CSTATSerial()
+{
+	Disconnect();
+	Release();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Initialisation stuff
+int CSTATSerial::Initialise(void)
+{
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Open a connection
+int CSTATSerial::Connect(const char *pAddress)
+{
+	// already connected
+	if (hComPort)
+		return ITS_OK;
+
+	if (OpenComPort(pAddress))
+	{
+		SetError("Connected to port %s Speed %d Bytes %d Parity %d Stop %d",
+			pAddress, STAT_BAUDRATE, STAT_BYTESIZE, STAT_PARITY, STAT_STOPBITS);
+		return ITS_OK;
+	}
+
+	return E_CONNECTIONFAILED;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Send a command and associated data
+////////////////////////////////////////////////////////////////////////////////////////
+int CSTATSerial::Send(const char cIdentifier, const char *pCommand, const unsigned long ulLength)
+{
+	DWORD dwBytes = 0;
+	int ret = E_WRITEFAILED;
+
+	// prepare command
+	STATCOMMAND STATSendCommand;
+	memset(&STATSendCommand, 0, sizeof(STATCOMMAND));
+	STATSendCommand.cIdentifier = cIdentifier;
+	STATSendCommand.ulLength = ulLength;
+
+	int result = 0;
+	if (result = WriteFile(hComPort, (LPVOID)&STATSendCommand, sizeof(STATCOMMAND), &dwBytes, NULL))
+	{
+		if (dwBytes == sizeof(STATCOMMAND))
+		{
+			// only send data if it will fit into our buffer
+			if (pCommand && STATSendCommand.ulLength && STATSendCommand.ulLength <= iMaxPacketSize)
+			{
+				if (WriteFile(hComPort, (LPVOID)pCommand, STATSendCommand.ulLength, &dwBytes, NULL))
+				{
+					if (dwBytes == STATSendCommand.ulLength)
+					{
+						SetError("Sent successfully %ld bytes", STATSendCommand.ulLength);
+						ret = ITS_OK;
+					}
+					else
+					{
+						SetError("Incorrect number of bytes written - expected %ld sent %ld", STATSendCommand.ulLength, dwBytes);
+						ret = E_BADNUMBERBYTES;
+					}
+				}
+				else
+					SetError("Write data to port failed");
+			}
+			else
+			{
+				SetError("Sent successfully");
+				ret = ITS_OK;
+			}
+		}
+		else
+		{
+			int err = ::GetLastError();
+			SetError("Incorrect number of bytes written - expected %ld sent %ld", sizeof(STATCOMMAND), dwBytes);
+			ret = E_BADNUMBERBYTES;
+		}
+	}
+	else
+		SetError("Write command to port failed");
+
+	return ret;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Receive a command and associated data
+//
+// Tries to read a STATCOMMAND structure from the port.  If successful, the length
+// of any data following will be specified in the structure.  If extra data, try to
+// read this.  If all successful, set the pointers to point to it
+//
+////////////////////////////////////////////////////////////////////////////////////////
+int CSTATSerial::ReceiveBytes( char *buff, unsigned long size )
+{
+	int ret;
+	int err;
+	unsigned long bytes_read = 0;
+	unsigned long bytes_read_this_iteration = 0;
+
+	// make sure size > 0 otherwise the following semantics fail
+	assert( size > 0 );
+
+	// loop until either all bytes have been received or an error occurs
+	for( bytes_read = 0; bytes_read < size; bytes_read += bytes_read_this_iteration ) { 
+		ret = ReadFile( hComPort, &(buff[bytes_read]), (size - bytes_read), &bytes_read_this_iteration, NULL );
+		if( bytes_read_this_iteration == 0 ) {
+			return NO_DATA_AT_PORT;
+		}
+		if( ret == 0 ) {
+			err = ::GetLastError();
+			SetError( "Error while receiving command - %ld", err );
+			return err;
+		}
+	}
+
+	// everything is OK
+	return 0;
+}
+
+int CSTATSerial::Receive( char *cIdentifier, char **ppData, unsigned long *pLength )
+{
+	int ret;
+	unsigned long command;
+	unsigned long data_length;
+
+	// initialise parameters
+	*cIdentifier = 0;
+	*ppData = NULL;
+	*pLength = 0;
+
+	// get command
+	ret = ReceiveBytes( (char*)&command, SP_COMMANDSIZE );
+	if( ret != 0 ) {
+		return ret;
+	}
+
+	static const int MAX_COMMAND = 127;
+	if( command > MAX_COMMAND ){
+		return INVALID_COMMAND_FORMAT;
+	}
+
+	// get length
+	ret = ReceiveBytes( (char*)&data_length, SP_LENGTHSIZE );
+	if( ret != 0 ) {
+		return ret;
+	}
+
+	// put these values into the return slots
+	*cIdentifier = (char)command;
+	*pLength = data_length;
+
+	// if the length is zero then there is no more to do
+	if( data_length == 0 ) {
+		return ITS_OK;
+	}
+
+	// if the length is greater than the buffer size then this is a header packet and we are not
+	// supposed to actually read any data from it.
+	// if( data_length > SP_BUFFERSIZE ) {
+	if( data_length > iMaxPacketSize ) {
+		SetError( "Received command ID: %c successfully length %d", (*cIdentifier), (*pLength) );
+		return ITS_OK;
+	}
+
+	// Otherwise we are about to read some data. We first have to setup the memory management
+	// which is done in a pretty ugly way IMAO.
+	if( data_length > iBufferLength )
+	{
+		if( pBuffer ) {
+			delete [] pBuffer;
+			pBuffer = NULL;
+			iBufferLength = 0;
+		}
+		pBuffer = new char [data_length];
+		if( pBuffer == NULL ) {
+			SetError( "Unable to allocate %ld bytes of memory to hold data", data_length );
+			return E_OUTOFMEM;
+		}
+		iBufferLength = data_length;
+	}
+
+	// now read the data
+	ret = ReceiveBytes( pBuffer, data_length );
+	if( ret != 0 ) {
+		return ret;
+	}
+	*ppData = pBuffer;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Disconnect from the port
+int CSTATSerial::Disconnect(void)
+{
+	// release previous resources
+	if (pBuffer)
+	{
+		delete [] pBuffer;
+		pBuffer = NULL;
+		iBufferLength = 0;
+	}
+
+	// disconnect
+	if (hComPort)
+	{
+		CloseHandle(hComPort);
+		hComPort = (HANDLE)0;
+	}
+
+	SetError("Disconnected successfully");
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Release resources
+int CSTATSerial::Release(void)
+{
+	Disconnect();
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+//	PRIVATE FUNCTIONS
+////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+bool CSTATSerial::OpenComPort(const char *pAddress)
+{
+	TCHAR szAddress[256] = {0};
+
+#ifdef UNICODE
+	szAddress[0] = (TCHAR)0;
+
+    // Convert to UNICODE.
+    MultiByteToWideChar(CP_ACP,					// conversion type
+						 0,							// flags
+						 pAddress,					// source
+						 -1,						// length
+						 szAddress,					// dest
+						 256);						// length
+#else
+	strcpy(szAddress, pAddress);
+#endif
+
+	// Use device naming for COM port.
+	CString port;
+	CString address(pAddress);	// Local variable to cope with 
+								// wide UNICODE characters.
+	port.Format(_T("\\\\.\\%s"), address.operator LPCTSTR());
+
+	if (INVALID_HANDLE_VALUE == (hComPort = CreateFile(port,
+					 GENERIC_READ | GENERIC_WRITE,
+					 0,
+					 NULL,
+					 OPEN_EXISTING,
+					 FILE_FLAG_WRITE_THROUGH,
+					 NULL)))
+	{
+		SetError("Port [%s] could not be opened", pAddress);
+		int err = ::GetLastError();
+		hComPort = (HANDLE)0;
+		return false;
+	}
+
+	COMMTIMEOUTS CommTimeOuts;
+	CommTimeOuts.WriteTotalTimeoutMultiplier	= STAT_WRITETOTALTIMEOUTMULTIPLIER; 
+	CommTimeOuts.WriteTotalTimeoutConstant		= STAT_WRITETOTALTIMEOUTCONSTANT;
+	CommTimeOuts.ReadIntervalTimeout			= STAT_READINTERVALTIMEOUT;
+	CommTimeOuts.ReadTotalTimeoutMultiplier		= STAT_READTOTALTIMEOUTMULTIPLIER;
+	CommTimeOuts.ReadTotalTimeoutConstant		= STAT_READTOTALTIMEOUTCONSTANT;
+
+	if (!SetCommTimeouts(hComPort, &CommTimeOuts))
+	{
+		SetError("Comm port timeouts could not be set");
+		CloseHandle(hComPort);
+		hComPort = (HANDLE)0;
+		return false;
+	} 
+
+	// Configure the COM port 
+	DCB dcb;
+	GetCommState(hComPort, &dcb);
+	dcb.DCBlength			= sizeof(dcb); 
+	dcb.BaudRate			= STAT_BAUDRATE;
+	dcb.fBinary				= TRUE;
+	dcb.fParity				= STAT_PARITY;
+	dcb.fOutxCtsFlow		= TRUE;
+	dcb.fOutxDsrFlow		= FALSE;
+	dcb.fDtrControl			= DTR_CONTROL_ENABLE;	
+	dcb.fDsrSensitivity		= FALSE;
+	dcb.fTXContinueOnXoff	= TRUE;
+	dcb.fOutX				= FALSE;
+	dcb.fInX				= FALSE;
+	dcb.fErrorChar			= FALSE;
+	dcb.fNull				= FALSE;
+	dcb.fRtsControl			= RTS_CONTROL_HANDSHAKE;
+	dcb.fAbortOnError		= TRUE;
+	dcb.XonLim				= 4096;
+	dcb.XoffLim				= 1024;
+	dcb.ByteSize			= STAT_BYTESIZE;
+	dcb.Parity				= STAT_PARITY;
+	dcb.StopBits			= STAT_STOPBITS;
+	dcb.XonChar				= 17;
+	dcb.XoffChar			= 19;
+
+//	dcb.fRtsControl		= RTS_CONTROL_ENABLE;
+//	dcb.BaudRate		= STAT_BAUDRATE;
+//	dcb.fOutxCtsFlow	= FALSE;
+//	dcb.XonLim			= STAT_XONLIMIT;
+//	dcb.XoffLim			= STAT_XOFFLIMIT;
+	
+	if (!SetCommState(hComPort, &dcb))
+	{
+		SetError("Comm port state could not be set");
+		CloseHandle(hComPort);
+		hComPort = (HANDLE)0;
+		return false;
+	} 
+
+	return true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statserialbluetooth.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,364 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "statserialbluetooth.h"
+#include "assert.h"
+
+#define SP_COMMANDSIZE	4
+#define SP_LENGTHSIZE	4
+#define SP_BUFFERSIZE	STAT_BUFFERSIZE
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Constructor
+CSTATSerialBluetooth::CSTATSerialBluetooth()
+: hComPort((HANDLE)0), 	pTemp(NULL)
+{
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Destructor
+CSTATSerialBluetooth::~CSTATSerialBluetooth()
+{
+	Disconnect();
+	Release();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Initialisation stuff
+int CSTATSerialBluetooth::Initialise(void)
+{
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Open a connection
+int CSTATSerialBluetooth::Connect(const char *pAddress)
+{
+	// already connected
+	if (hComPort)
+		return ITS_OK;
+
+	if (OpenComPort(pAddress))
+	{
+		SetError("Connected to port %s Speed %d Bytes %d Parity %d Stop %d",
+			pAddress, STATBT_BAUDRATE, STATBT_BYTESIZE, STATBT_PARITY, STATBT_STOPBITS);
+		return ITS_OK;
+	}
+
+	return E_CONNECTIONFAILED;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Send a command and associated data
+////////////////////////////////////////////////////////////////////////////////////////
+int CSTATSerialBluetooth::Send(const char cIdentifier, const char *pCommand, const unsigned long ulLength)
+{
+	DWORD dwBytes = 0;
+	int ret = E_WRITEFAILED;
+
+	// prepare command
+	STATCOMMAND STATSendCommand;
+	memset(&STATSendCommand, 0, sizeof(STATCOMMAND));
+	STATSendCommand.cIdentifier = cIdentifier;
+	STATSendCommand.ulLength = ulLength;
+
+	if (WriteFile(hComPort, (LPVOID)&STATSendCommand, sizeof(STATCOMMAND), &dwBytes, NULL))
+	{
+		if (dwBytes == sizeof(STATCOMMAND))
+		{
+			// only send data if it will fit into our buffer
+		//	if (pCommand && STATSendCommand.ulLength && STATSendCommand.ulLength <= STAT_BUFFERSIZE)
+		//	{
+				if (WriteFile(hComPort, (LPVOID)pCommand, STATSendCommand.ulLength, &dwBytes, NULL))
+				{
+					if (dwBytes == STATSendCommand.ulLength)
+					{
+						SetError("Sent successfully %ld bytes", STATSendCommand.ulLength);
+						ret = ITS_OK;
+					}
+					else
+					{
+						SetError("Incorrect number of bytes written - expected %ld sent %ld", STATSendCommand.ulLength, dwBytes);
+						ret = E_BADNUMBERBYTES;
+					}
+				}
+				else
+					SetError("Write data to port failed");
+		///	}
+		//	else
+		//	{
+		//		SetError("Sent successfully");
+		//		ret = ITS_OK;
+		//	}
+		}
+		else
+		{
+			SetError("Incorrect number of bytes written - expected %ld sent %ld", sizeof(STATCOMMAND), dwBytes);
+			ret = E_BADNUMBERBYTES;
+		}
+	}
+	else
+		SetError("Write command to port failed");
+
+	return ret;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Receive a command and associated data
+//
+// Tries to read a STATCOMMAND structure from the port.  If successful, the length
+// of any data following will be specified in the structure.  If extra data, try to
+// read this.  If all successful, set the pointers to point to it
+//
+////////////////////////////////////////////////////////////////////////////////////////
+int CSTATSerialBluetooth::ReceiveBytes( char *buff, unsigned long size )
+{
+	int ret;
+	int err;
+	unsigned long bytes_read = 0;
+	unsigned long bytes_read_this_iteration = 0;
+
+	// make sure size > 0 otherwise the following semantics fail
+	assert( size > 0 );
+
+	// loop until either all bytes have been received or an error occurs
+	for( bytes_read = 0; bytes_read < size; bytes_read += bytes_read_this_iteration ) 
+	{ 
+		ret = ReadFile( hComPort, &(buff[bytes_read]), (size - bytes_read), &bytes_read_this_iteration, NULL );		
+		
+		if( bytes_read_this_iteration == 0 ) 
+		{
+			return NO_DATA_AT_PORT;
+		}
+
+		if( ret == 0 ) 
+		{
+			err = GetLastError();
+			SetError( "Error while receiving command - %ld", err );
+			return err;
+		}
+	}
+
+	// everything is OK
+	return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////
+int CSTATSerialBluetooth::Receive( char *cIdentifier, char **ppData, unsigned long *pLength )
+{
+	int ret;
+	unsigned long command;
+	unsigned long data_length;
+
+	// initialise parameters
+	*cIdentifier = 0;
+	*ppData = NULL;
+	*pLength = 0;
+
+	// get command
+	ret = ReceiveBytes( (char*)&command, SP_COMMANDSIZE );
+	if( ret != 0 ) {
+		return ret;
+	}
+		
+	// get length
+	ret = ReceiveBytes( (char*)&data_length, SP_LENGTHSIZE );
+	if( ret != 0 ) {
+		return ret;
+	}
+
+	// put these values into the return slots
+	*cIdentifier = (char)command;
+	*pLength = data_length;
+
+	// if the length is zero then there is no more to do
+	if( data_length == 0 ) {
+		return ITS_OK;
+	}
+
+	// if the length is greater than the buffer size then this is a header packet and we are not
+	// supposed to actually read any data from it.
+/*	if( data_length > SP_BUFFERSIZE ) {
+		SetError( "Received command ID: %c successfully length %d", (*cIdentifier), (*pLength) );
+		return ITS_OK;
+	}
+*/
+
+	SetError( "Received command ID: %c successfully length %d", (*cIdentifier), (*pLength) );
+	
+	// Otherwise we are about to read some data. We first have to setup the memory management
+	// which is done in a pretty ugly way IMAO.
+	if( pTemp ) 
+	{
+		delete [] pTemp;
+		pTemp = NULL;
+	}
+	
+	pTemp = new char [data_length];
+	
+	if( pTemp == NULL ) 
+	{
+		SetError( "Unable to allocate %ld bytes of memory to hold data", data_length );
+		return E_OUTOFMEM;
+	}
+
+	// now read the data
+	ret = ReceiveBytes( pTemp, data_length );
+	
+	if( ret != 0 ) 
+	{
+		return ret;
+	}
+
+	*ppData = pTemp;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Disconnect from the port
+int CSTATSerialBluetooth::Disconnect(void)
+{
+	// release previous resources
+	if (pTemp)
+	{
+		delete [] pTemp;
+		pTemp = NULL;
+	}
+
+	// disconnect
+	if (hComPort)
+	{
+		CloseHandle(hComPort);
+		hComPort = (HANDLE)0;
+	}
+
+	SetError("Disconnected successfully");
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Release resources
+int CSTATSerialBluetooth::Release(void)
+{
+	Disconnect();
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+//	PRIVATE FUNCTIONS
+////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+bool CSTATSerialBluetooth::OpenComPort(const char *pAddress)
+{
+	TCHAR szAddress[256] = {0};
+
+#ifdef UNICODE
+	szAddress[0] = (TCHAR)0;
+
+    // Convert to UNICODE.
+    MultiByteToWideChar(CP_ACP,					// conversion type
+						 0,							// flags
+						 pAddress,					// source
+						 -1,						// length
+						 szAddress,					// dest
+						 256);						// length
+#else
+	strcpy(szAddress, pAddress);
+#endif
+
+	if (INVALID_HANDLE_VALUE == (hComPort = CreateFile(szAddress,
+					 GENERIC_READ | GENERIC_WRITE,
+					 0,
+					 NULL,
+					 OPEN_EXISTING,
+					 FILE_FLAG_WRITE_THROUGH,
+					 NULL)))
+	{
+		SetError("Port [%s] could not be opened", pAddress);
+		return false;
+	}
+
+	COMMTIMEOUTS CommTimeOuts;
+	CommTimeOuts.WriteTotalTimeoutMultiplier	= STATBT_WRITETOTALTIMEOUTMULTIPLIER; 
+	CommTimeOuts.WriteTotalTimeoutConstant		= STATBT_WRITETOTALTIMEOUTCONSTANT;
+	CommTimeOuts.ReadIntervalTimeout			= STATBT_READINTERVALTIMEOUT;          
+    CommTimeOuts.ReadTotalTimeoutMultiplier		= STATBT_READTOTALTIMEOUTMULTIPLIER;   
+    CommTimeOuts.ReadTotalTimeoutConstant		= STATBT_READTOTALTIMEOUTCONSTANT;
+	
+	if (!SetCommTimeouts(hComPort, &CommTimeOuts))
+	{
+		SetError("Comm port timeouts could not be set");
+		CloseHandle(hComPort);
+		return false;
+	} 
+
+	// Configure the COM port 
+	DCB dcb;
+	GetCommState(hComPort, &dcb);
+	dcb.DCBlength			= sizeof(dcb); 
+	dcb.BaudRate			= STATBT_BAUDRATE;
+	dcb.fBinary				= TRUE;
+	dcb.fParity				= STATBT_PARITY;
+	dcb.fOutxCtsFlow		= TRUE;
+	dcb.fOutxDsrFlow		= FALSE;
+	dcb.fDtrControl			= DTR_CONTROL_ENABLE;	
+	dcb.fDsrSensitivity		= FALSE;
+	dcb.fTXContinueOnXoff	= TRUE;
+	dcb.fOutX				= FALSE;
+	dcb.fInX				= FALSE;
+	dcb.fErrorChar			= FALSE;
+	dcb.fNull				= FALSE;
+	dcb.fRtsControl			= RTS_CONTROL_HANDSHAKE;
+	dcb.fAbortOnError		= TRUE;
+	dcb.XonLim				= 4096;
+	dcb.XoffLim				= 1024;
+	dcb.ByteSize			= STATBT_BYTESIZE;
+	dcb.Parity				= STATBT_PARITY;
+	dcb.StopBits			= STATBT_STOPBITS;
+	dcb.XonChar				= 17;
+	dcb.XoffChar			= 19;
+
+//	dcb.fRtsControl		= RTS_CONTROL_ENABLE;
+//	dcb.BaudRate		= STAT_BAUDRATE;
+//	dcb.fOutxCtsFlow	= FALSE;
+//	dcb.XonLim			= STAT_XONLIMIT;
+//	dcb.XoffLim			= STAT_XOFFLIMIT;
+	
+	if (!SetCommState(hComPort, &dcb))
+	{
+		SetError("Comm port state could not be set");
+		CloseHandle(hComPort);
+		return false;
+	} 
+
+	return true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/statsocket_block.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "statsocket_block.h"
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Constructor
+CSTATSocket::CSTATSocket() : pBuffer(NULL), iBufferLength(0)
+{
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Destructor
+CSTATSocket::~CSTATSocket()
+{
+	Disconnect();
+	Release();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Initialise
+int CSTATSocket::Initialise(void)
+{
+	WORD version;
+	WSADATA wsaData;
+
+	// start the windows socket server
+	version = MAKEWORD( 2, 2 );
+	if (WSAStartup( version, &wsaData ))
+		return E_SOCKETSTARTUP;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Connect
+int CSTATSocket::Connect(const char *pAddress)
+{
+	int iPort = ST_DEFAULTDEVICEPORT;
+
+	// parameter will either be MACHINE_NAME:PORT_NUMBER if connecting
+	// or just PORT_NUMBER if listening
+	char *p = strrchr(pAddress, ':');
+	char *q = p;
+	if (p)
+	{
+		(*p) = (char)0;
+
+		p++;
+		if (p && *p)
+			iPort = atoi(p);
+
+		// local address
+		struct hostent *hp;
+		memset(&sin,0,sizeof(sin));
+		sin.sin_family = AF_INET;
+		sin.sin_port = htons((unsigned short)iPort);
+		hp = gethostbyname(pAddress);
+
+		// put this back to restore original string
+		*q = ':';
+
+		if (hp)
+		{
+
+			// create a client socket
+			sock = socket( AF_INET, SOCK_STREAM, 0 ) ;
+			if( sock == INVALID_SOCKET )
+				return E_SOCKETCREATE;
+
+			memcpy(&(sin.sin_addr),hp->h_addr,hp->h_length);
+
+			// connect to server
+			if (connect(sock, (struct sockaddr*)&sin, sizeof(sin)) != 0)
+				return E_SOCKETCONNECT;
+
+			// Set the socket I/O mode
+			// FIONBIO enables or disables the blocking mode for the 
+			// socket:
+			// 0   => blocking is enabled; 
+			// !=0 => non-blocking mode is enabled.
+			u_long mode = 1;
+			ioctlsocket(sock, FIONBIO, &mode);
+
+		}
+		else
+			return E_SOCKETHOSTNAME;
+	}
+	else
+	{
+		// create a listener socket
+		listener = socket(AF_INET, SOCK_STREAM, 0);
+		if( listener == INVALID_SOCKET )
+			return E_SOCKETCREATE;
+
+		iPort = atoi(pAddress);
+		if (!iPort)
+			iPort = ST_DEFAULTDEVICEPORT;
+
+		sin.sin_family = AF_INET;
+		sin.sin_port = htons((unsigned short)iPort);
+		sin.sin_addr.s_addr = INADDR_ANY;
+
+		if (bind(listener, (struct sockaddr*)&sin, sizeof(sin)) != 0)
+			return E_SOCKETBIND;
+
+		if (listen(listener, 1) != 0)
+			return E_SOCKETLISTEN;
+
+		int sin_size = sizeof(remote_sin);
+		memset((void *)&remote_sin, 0, sizeof(remote_sin));
+		sock = accept(listener, (struct sockaddr*)&remote_sin, &sin_size);
+
+		// shut down the listener now we have our connection
+		shutdown(listener, SD_SEND);
+		shutdown(listener, SD_RECEIVE);
+		closesocket(listener);
+
+		if (sock == INVALID_SOCKET)
+			return E_OUTOFMEM;
+	}
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Send
+int CSTATSocket::Send(const char cIdentifier, const char *pData, const unsigned long ulLength)
+{
+	int ret = ITS_OK;
+	unsigned long ID = htonl(cIdentifier);
+	unsigned long Length = htonl(ulLength);
+
+	// send the identifier
+	ret = send( sock, (char*)&ID, sizeof(unsigned long), 0 );
+	if (ret != sizeof(unsigned long))
+		return E_SOCKETSEND;
+
+	// send the length
+	ret = send( sock, (char*)&Length, sizeof(unsigned long), 0 );
+	if (ret != sizeof(unsigned long))
+		return E_SOCKETSEND;
+
+	if (pData && ulLength && (ulLength <= GetMaxPacketSize( )) )
+	{
+		char *pSendData = new char[ulLength + 1];
+		if (pSendData)
+		{
+			memset(pSendData, 0, ulLength + 1);
+			memcpy(pSendData, pData, ulLength);
+		}
+		else
+			return E_OUTOFMEM;
+
+		// send the length
+		ret = send( sock, pSendData, ulLength, 0 );
+
+		if (pSendData)
+			delete [] pSendData;
+
+		if (ret != (int)ulLength)
+			return E_SOCKETSEND;
+	}
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Receive
+int CSTATSocket::Receive(char *cIdentifier, char **ppData, unsigned long *pLength)
+{
+	int ret = ITS_OK;
+	unsigned long ID = 0;
+	unsigned long Length = 0;
+
+	TIMEVAL timeout;
+	timeout.tv_sec = SOCKETTIMEOUT;
+	timeout.tv_usec = 0;
+
+	FD_SET reader;
+	
+	FD_ZERO(&reader);
+	FD_SET(sock, &reader);
+
+	// receive the identifier
+
+	if(select(0, &reader, NULL, NULL, &timeout)==0)
+	{
+		return E_SOCKETRECV;
+	}
+
+	ret = recv( sock, (char*)&ID, sizeof(unsigned long), 0 );
+	if (ret != sizeof(unsigned long))
+		return E_SOCKETRECV;
+
+
+	if(select(0, &reader, NULL, NULL, &timeout)==0)
+	{
+		return E_SOCKETRECV;
+	}
+
+	// receive the length
+	ret = recv( sock, (char*)&Length, sizeof(unsigned long), 0 );
+	if (ret != sizeof(unsigned long))
+		return E_SOCKETRECV;
+
+	(*cIdentifier) = (char)ntohl(ID);
+	(*pLength) = ntohl(Length);
+
+	// if the length is zero then there is no more to do
+	if( *pLength == 0 ) {
+		return ITS_OK;
+	}
+
+	if( *pLength > GetMaxPacketSize( ) ) {
+		SetError( "Received command ID: %c successfully length %d", (*cIdentifier), *pLength );
+		return ITS_OK;
+	}
+
+	if (*pLength)
+	{
+		if( *pLength > iBufferLength )
+		{
+			if( pBuffer ) {
+				delete [] pBuffer;
+				pBuffer = NULL;
+				iBufferLength = 0;
+			}
+			pBuffer = new char [*pLength + 1];
+			if( pBuffer == NULL ) {
+				SetError( "Unable to allocate %ld bytes of memory to hold data", *pLength );
+				return E_OUTOFMEM;
+			}
+			memset(pBuffer, 0, (*pLength) + 1);
+			iBufferLength = *pLength;
+		}
+
+		char *p = pBuffer;
+
+		// receive the data
+		int iThisAmount = 0;
+		int iTotalReceived = 0;
+		while (iTotalReceived < (int)(*pLength))
+		{
+
+			if(select(0, &reader, NULL, NULL, &timeout)==0)
+			{
+				return E_SOCKETRECV;
+			}
+
+			iThisAmount = recv( sock, p, (*pLength) - iTotalReceived, 0 );
+			if (iThisAmount == SOCKET_ERROR)
+				return E_SOCKETRECV;
+
+			iTotalReceived += iThisAmount;
+			p += iThisAmount;
+			Sleep(100);
+		}
+
+		(*ppData) = pBuffer;
+	}
+
+	return ITS_OK;
+}
+	
+	
+////////////////////////////////////////////////////////////////////////////////////////
+// Disconnect
+int CSTATSocket::Disconnect(void)
+{
+	// release previous resources
+	if (pBuffer)
+	{
+		delete [] pBuffer;
+		pBuffer = NULL;
+		iBufferLength = 0;
+	}
+
+	shutdown(sock, SD_SEND);
+	shutdown(sock, SD_RECEIVE);
+
+	if (closesocket(sock) == SOCKET_ERROR)
+		return E_SOCKETCLOSE;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// 
+int CSTATSocket::Release(void)
+{
+	if (WSACleanup() == SOCKET_ERROR)
+		return E_SOCKETSHUTDOWN;
+
+	return ITS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+//	PRIVATE FUNCTIONS
+////////////////////////////////////////////////////////////////////////////////////////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/src/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/statlib.dep	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,158 @@
+# Microsoft Developer Studio Generated Dependency File, included by STATLib.mak
+
+.\src\cRepmisc.cpp : \
+	".\inc\cReporter.h"\
+	
+
+.\src\cReporter.cpp : \
+	".\inc\cReporter.h"\
+	
+
+.\src\cstatdataformatconverter.cpp : \
+	".\inc\cstatdataformatconverter.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\statcommon.h"\
+	
+
+.\src\cstatimageverify.cpp : \
+	".\inc\cstatimageverify.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\statcommon.h"\
+	
+
+.\src\cstatlogfile.cpp : \
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\statcommon.h"\
+	
+
+.\src\cstatreturncodes.cpp : \
+	".\inc\cstatreturncodes.h"\
+	
+
+..\common\src\INI.cpp : \
+	"..\common\inc\INI.h"\
+	
+
+.\src\statbitmap.cpp : \
+	".\inc\cstatdataformatconverter.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\statbitmap.h"\
+	".\inc\statcommon.h"\
+	
+
+.\src\STATComms.cpp : \
+	"..\..\..\Common\inc\SerialPacketSize.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\statcommon.h"\
+	".\inc\statcomms.h"\
+	".\inc\statserial.h"\
+	".\inc\statsocket_block.h"\
+	".\inc\stattransport.h"\
+	
+
+.\src\STATEngine.cpp : \
+	"..\common\inc\INI.h"\
+	".\inc\cstatdataformatconverter.h"\
+	".\inc\cstatimageverify.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\ScriptProgressMonitor.h"\
+	".\inc\statcommon.h"\
+	".\inc\statcomms.h"\
+	".\inc\STATEngine.h"\
+	".\inc\statscriptdecoder.h"\
+	".\inc\stattransport.h"\
+	
+
+.\src\statexp.cpp : \
+	"..\common\inc\INI.h"\
+	".\inc\cReporter.h"\
+	".\inc\cstatdataformatconverter.h"\
+	".\inc\cstatimageverify.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\ScriptProgressMonitor.h"\
+	".\inc\statcommon.h"\
+	".\inc\statcomms.h"\
+	".\inc\STATEngine.h"\
+	".\inc\statexp.h"\
+	".\inc\statlist.h"\
+	".\inc\statmember.h"\
+	".\inc\statscriptdecoder.h"\
+	".\inc\stattransport.h"\
+	
+
+.\src\statlist.cpp : \
+	"..\common\inc\INI.h"\
+	".\inc\cReporter.h"\
+	".\inc\cstatdataformatconverter.h"\
+	".\inc\cstatimageverify.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\ScriptProgressMonitor.h"\
+	".\inc\statcommon.h"\
+	".\inc\statcomms.h"\
+	".\inc\STATEngine.h"\
+	".\inc\statlist.h"\
+	".\inc\statmember.h"\
+	".\inc\statscriptdecoder.h"\
+	".\inc\stattransport.h"\
+	
+
+.\src\statmember.cpp : \
+	"..\common\inc\INI.h"\
+	".\inc\cReporter.h"\
+	".\inc\cstatdataformatconverter.h"\
+	".\inc\cstatimageverify.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\ScriptProgressMonitor.h"\
+	".\inc\statcommon.h"\
+	".\inc\statcomms.h"\
+	".\inc\STATEngine.h"\
+	".\inc\statmember.h"\
+	".\inc\statscriptdecoder.h"\
+	".\inc\stattransport.h"\
+	
+
+.\src\statscriptdecoder.cpp : \
+	".\inc\cstatdataformatconverter.h"\
+	".\inc\cstatimageverify.h"\
+	".\inc\cstatlogfile.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\MessageReporter.h"\
+	".\inc\statcommon.h"\
+	".\inc\statscriptdecoder.h"\
+	
+
+.\src\statserial.cpp : \
+	"..\..\..\Common\inc\SerialPacketSize.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\statcommon.h"\
+	".\inc\statserial.h"\
+	".\inc\stattransport.h"\
+	
+
+.\src\statsocket_block.cpp : \
+	"..\..\..\Common\inc\SerialPacketSize.h"\
+	".\inc\cstatreturncodes.h"\
+	".\inc\statcommon.h"\
+	".\inc\statsocket_block.h"\
+	".\inc\stattransport.h"\
+	
+
+.\src\StdAfx.cpp : \
+	".\inc\StdAfx.h"\
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/statlib.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,263 @@
+# Microsoft Developer Studio Project File - Name="STATLib" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=STATLib - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "STATLib.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "STATLib.mak" CFG="STATLib - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "STATLib - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "STATLib - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "STATLib"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "STATLib - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W2 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\common\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\lib\STAT.lib"
+
+!ELSEIF  "$(CFG)" == "STATLib - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 1
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\common\inc" /I ".\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\..\lib\STATd.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "STATLib - Win32 Release"
+# Name "STATLib - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\cRepmisc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\cReporter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\cstatdataformatconverter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\cstatimageverify.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\cstatlogfile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\cstatreturncodes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\src\INI.cpp
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statbitmap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\STATComms.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\STATEngine.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statexp.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\STATLib.dep
+# End Source File
+# Begin Source File
+
+SOURCE=.\STATLib.mak
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statlist.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statmember.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statscriptdecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statserial.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\statsocket_block.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\cReporter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\cstatdataformatconverter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\cstatimageverify.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\cstatlogfile.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\cstatreturncodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\inc\INI.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\MessageReporter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\messagetypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\ScriptProgressMonitor.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\inc\SerialPacketSize.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\stat.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statbitmap.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statcommon.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statcomms.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\STATEngine.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statexp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statlist.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statmember.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statscriptdecoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statserial.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\statsocket_block.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\stattransport.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\StdAfx.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/statlib.mak	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,428 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on STATLib.dsp
+!IF "$(CFG)" == ""
+CFG=STATLib - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to STATLib - Win32 Debug.
+!ENDIF 
+
+!IF "$(CFG)" != "STATLib - Win32 Release" && "$(CFG)" != "STATLib - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "STATLib.mak" CFG="STATLib - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "STATLib - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "STATLib - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+!ERROR An invalid configuration is specified.
+!ENDIF 
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "STATLib - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "..\..\lib\STAT.lib" "$(OUTDIR)\STATLib.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\cRepmisc.obj"
+	-@erase "$(INTDIR)\cRepmisc.sbr"
+	-@erase "$(INTDIR)\cReporter.obj"
+	-@erase "$(INTDIR)\cReporter.sbr"
+	-@erase "$(INTDIR)\cstatdataformatconverter.obj"
+	-@erase "$(INTDIR)\cstatdataformatconverter.sbr"
+	-@erase "$(INTDIR)\cstatimageverify.obj"
+	-@erase "$(INTDIR)\cstatimageverify.sbr"
+	-@erase "$(INTDIR)\cstatlogfile.obj"
+	-@erase "$(INTDIR)\cstatlogfile.sbr"
+	-@erase "$(INTDIR)\cstatreturncodes.obj"
+	-@erase "$(INTDIR)\cstatreturncodes.sbr"
+	-@erase "$(INTDIR)\INI.obj"
+	-@erase "$(INTDIR)\INI.sbr"
+	-@erase "$(INTDIR)\statbitmap.obj"
+	-@erase "$(INTDIR)\statbitmap.sbr"
+	-@erase "$(INTDIR)\STATComms.obj"
+	-@erase "$(INTDIR)\STATComms.sbr"
+	-@erase "$(INTDIR)\STATEngine.obj"
+	-@erase "$(INTDIR)\STATEngine.sbr"
+	-@erase "$(INTDIR)\statexp.obj"
+	-@erase "$(INTDIR)\statexp.sbr"
+	-@erase "$(INTDIR)\STATLib.pch"
+	-@erase "$(INTDIR)\statlist.obj"
+	-@erase "$(INTDIR)\statlist.sbr"
+	-@erase "$(INTDIR)\statmember.obj"
+	-@erase "$(INTDIR)\statmember.sbr"
+	-@erase "$(INTDIR)\statscriptdecoder.obj"
+	-@erase "$(INTDIR)\statscriptdecoder.sbr"
+	-@erase "$(INTDIR)\statserial.obj"
+	-@erase "$(INTDIR)\statserial.sbr"
+	-@erase "$(INTDIR)\statsocket_block.obj"
+	-@erase "$(INTDIR)\statsocket_block.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(OUTDIR)\STATLib.bsc"
+	-@erase "..\..\lib\STAT.lib"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "..\common\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATLib.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\STATLib.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\cRepmisc.sbr" \
+	"$(INTDIR)\cReporter.sbr" \
+	"$(INTDIR)\cstatdataformatconverter.sbr" \
+	"$(INTDIR)\cstatimageverify.sbr" \
+	"$(INTDIR)\cstatlogfile.sbr" \
+	"$(INTDIR)\cstatreturncodes.sbr" \
+	"$(INTDIR)\INI.sbr" \
+	"$(INTDIR)\statbitmap.sbr" \
+	"$(INTDIR)\STATComms.sbr" \
+	"$(INTDIR)\STATEngine.sbr" \
+	"$(INTDIR)\statexp.sbr" \
+	"$(INTDIR)\statlist.sbr" \
+	"$(INTDIR)\statmember.sbr" \
+	"$(INTDIR)\statscriptdecoder.sbr" \
+	"$(INTDIR)\statserial.sbr" \
+	"$(INTDIR)\statsocket_block.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\STATLib.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\..\lib\STAT.lib" 
+LIB32_OBJS= \
+	"$(INTDIR)\cRepmisc.obj" \
+	"$(INTDIR)\cReporter.obj" \
+	"$(INTDIR)\cstatdataformatconverter.obj" \
+	"$(INTDIR)\cstatimageverify.obj" \
+	"$(INTDIR)\cstatlogfile.obj" \
+	"$(INTDIR)\cstatreturncodes.obj" \
+	"$(INTDIR)\INI.obj" \
+	"$(INTDIR)\statbitmap.obj" \
+	"$(INTDIR)\STATComms.obj" \
+	"$(INTDIR)\STATEngine.obj" \
+	"$(INTDIR)\statexp.obj" \
+	"$(INTDIR)\statlist.obj" \
+	"$(INTDIR)\statmember.obj" \
+	"$(INTDIR)\statscriptdecoder.obj" \
+	"$(INTDIR)\statserial.obj" \
+	"$(INTDIR)\statsocket_block.obj" \
+	"$(INTDIR)\StdAfx.obj"
+
+"..\..\lib\STAT.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+    $(LIB32) @<<
+  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ELSEIF  "$(CFG)" == "STATLib - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "..\..\lib\STATd.lib" "$(OUTDIR)\STATLib.pch" "$(OUTDIR)\STATLib.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\cRepmisc.obj"
+	-@erase "$(INTDIR)\cRepmisc.sbr"
+	-@erase "$(INTDIR)\cReporter.obj"
+	-@erase "$(INTDIR)\cReporter.sbr"
+	-@erase "$(INTDIR)\cstatdataformatconverter.obj"
+	-@erase "$(INTDIR)\cstatdataformatconverter.sbr"
+	-@erase "$(INTDIR)\cstatimageverify.obj"
+	-@erase "$(INTDIR)\cstatimageverify.sbr"
+	-@erase "$(INTDIR)\cstatlogfile.obj"
+	-@erase "$(INTDIR)\cstatlogfile.sbr"
+	-@erase "$(INTDIR)\cstatreturncodes.obj"
+	-@erase "$(INTDIR)\cstatreturncodes.sbr"
+	-@erase "$(INTDIR)\INI.obj"
+	-@erase "$(INTDIR)\INI.sbr"
+	-@erase "$(INTDIR)\statbitmap.obj"
+	-@erase "$(INTDIR)\statbitmap.sbr"
+	-@erase "$(INTDIR)\STATComms.obj"
+	-@erase "$(INTDIR)\STATComms.sbr"
+	-@erase "$(INTDIR)\STATEngine.obj"
+	-@erase "$(INTDIR)\STATEngine.sbr"
+	-@erase "$(INTDIR)\statexp.obj"
+	-@erase "$(INTDIR)\statexp.sbr"
+	-@erase "$(INTDIR)\STATLib.pch"
+	-@erase "$(INTDIR)\statlist.obj"
+	-@erase "$(INTDIR)\statlist.sbr"
+	-@erase "$(INTDIR)\statmember.obj"
+	-@erase "$(INTDIR)\statmember.sbr"
+	-@erase "$(INTDIR)\statscriptdecoder.obj"
+	-@erase "$(INTDIR)\statscriptdecoder.sbr"
+	-@erase "$(INTDIR)\statserial.obj"
+	-@erase "$(INTDIR)\statserial.sbr"
+	-@erase "$(INTDIR)\statsocket_block.obj"
+	-@erase "$(INTDIR)\statsocket_block.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(OUTDIR)\STATLib.bsc"
+	-@erase "..\..\lib\STATd.lib"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\common\inc" /I ".\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\STATLib.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\cRepmisc.sbr" \
+	"$(INTDIR)\cReporter.sbr" \
+	"$(INTDIR)\cstatdataformatconverter.sbr" \
+	"$(INTDIR)\cstatimageverify.sbr" \
+	"$(INTDIR)\cstatlogfile.sbr" \
+	"$(INTDIR)\cstatreturncodes.sbr" \
+	"$(INTDIR)\INI.sbr" \
+	"$(INTDIR)\statbitmap.sbr" \
+	"$(INTDIR)\STATComms.sbr" \
+	"$(INTDIR)\STATEngine.sbr" \
+	"$(INTDIR)\statexp.sbr" \
+	"$(INTDIR)\statlist.sbr" \
+	"$(INTDIR)\statmember.sbr" \
+	"$(INTDIR)\statscriptdecoder.sbr" \
+	"$(INTDIR)\statserial.sbr" \
+	"$(INTDIR)\statsocket_block.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\STATLib.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\..\lib\STATd.lib" 
+LIB32_OBJS= \
+	"$(INTDIR)\cRepmisc.obj" \
+	"$(INTDIR)\cReporter.obj" \
+	"$(INTDIR)\cstatdataformatconverter.obj" \
+	"$(INTDIR)\cstatimageverify.obj" \
+	"$(INTDIR)\cstatlogfile.obj" \
+	"$(INTDIR)\cstatreturncodes.obj" \
+	"$(INTDIR)\INI.obj" \
+	"$(INTDIR)\statbitmap.obj" \
+	"$(INTDIR)\STATComms.obj" \
+	"$(INTDIR)\STATEngine.obj" \
+	"$(INTDIR)\statexp.obj" \
+	"$(INTDIR)\statlist.obj" \
+	"$(INTDIR)\statmember.obj" \
+	"$(INTDIR)\statscriptdecoder.obj" \
+	"$(INTDIR)\statserial.obj" \
+	"$(INTDIR)\statsocket_block.obj" \
+	"$(INTDIR)\StdAfx.obj"
+
+"..\..\lib\STATd.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+    $(LIB32) @<<
+  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ENDIF 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("STATLib.dep")
+!INCLUDE "STATLib.dep"
+!ELSE 
+!MESSAGE Warning: cannot find "STATLib.dep"
+!ENDIF 
+!ENDIF 
+
+
+!IF "$(CFG)" == "STATLib - Win32 Release" || "$(CFG)" == "STATLib - Win32 Debug"
+SOURCE=.\src\cRepmisc.cpp
+
+"$(INTDIR)\cRepmisc.obj"	"$(INTDIR)\cRepmisc.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\cReporter.cpp
+
+"$(INTDIR)\cReporter.obj"	"$(INTDIR)\cReporter.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\cstatdataformatconverter.cpp
+
+"$(INTDIR)\cstatdataformatconverter.obj"	"$(INTDIR)\cstatdataformatconverter.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\cstatimageverify.cpp
+
+"$(INTDIR)\cstatimageverify.obj"	"$(INTDIR)\cstatimageverify.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\cstatlogfile.cpp
+
+"$(INTDIR)\cstatlogfile.obj"	"$(INTDIR)\cstatlogfile.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\cstatreturncodes.cpp
+
+"$(INTDIR)\cstatreturncodes.obj"	"$(INTDIR)\cstatreturncodes.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\common\src\INI.cpp
+
+!IF  "$(CFG)" == "STATLib - Win32 Release"
+
+CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I "..\common\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\INI.obj"	"$(INTDIR)\INI.sbr" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "STATLib - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\common\inc" /I ".\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\INI.obj"	"$(INTDIR)\INI.sbr" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+SOURCE=.\src\statbitmap.cpp
+
+"$(INTDIR)\statbitmap.obj"	"$(INTDIR)\statbitmap.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\STATComms.cpp
+
+"$(INTDIR)\STATComms.obj"	"$(INTDIR)\STATComms.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\STATEngine.cpp
+
+"$(INTDIR)\STATEngine.obj"	"$(INTDIR)\STATEngine.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\statexp.cpp
+
+"$(INTDIR)\statexp.obj"	"$(INTDIR)\statexp.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\statlist.cpp
+
+"$(INTDIR)\statlist.obj"	"$(INTDIR)\statlist.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\statmember.cpp
+
+"$(INTDIR)\statmember.obj"	"$(INTDIR)\statmember.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\statscriptdecoder.cpp
+
+"$(INTDIR)\statscriptdecoder.obj"	"$(INTDIR)\statscriptdecoder.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\statserial.cpp
+
+"$(INTDIR)\statserial.obj"	"$(INTDIR)\statserial.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\statsocket_block.cpp
+
+"$(INTDIR)\statsocket_block.obj"	"$(INTDIR)\statsocket_block.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\STATLib.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+SOURCE=.\src\StdAfx.cpp
+
+!IF  "$(CFG)" == "STATLib - Win32 Release"
+
+CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I "..\common\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATLib.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\STATLib.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "STATLib - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\common\inc" /I ".\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\STATLib.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\STATLib.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+
+!ENDIF 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/lib/updatelib.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+@rem
+@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@@rem
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+
+rem which accompanies this distribution, and is available
+
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/perl/statapi.pm	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1874 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+package Symbian::StatAPI;
+require 5.000;
+use Win32::API;
+use Win32::TieRegistry(Delimiter=>"/");
+use IO::File;
+use File::Basename;
+use LWP::Simple;
+use LWP::UserAgent;
+use HTTP::Request;
+use HTTP::Response;
+use Exporter;
+use vars qw (@ISA @EXPORT $VERSION);
+@ISA		= qw(Exporter);
+@EXPORT		= qw(
+				&set_dll_folder
+				&set_working_folder
+				&initialise
+				&get_version
+				&set_connection_logging
+				&close_connection_logging
+				&get_device_log_file
+				&set_screenshot_dir
+				&get_last_error
+				&connect_to_target
+				&connect_to_target_multithreaded
+				&disconnect_from_target
+				&set_command_delay
+				&set_image_verification
+				&set_command_logging
+				&get_screenshot
+				&get_device_info
+				&touch_screen
+				&start_application
+				&start_program
+				&open_application
+				&close_application
+				&basic_key_sequence
+				&control_keystroke
+				&combination_keystroke
+				&pause
+				&start_eshell
+				&stop_eshell
+				&copy_commonfile_to_target
+				&copy_testfile_to_target
+				&copy_buildfile_to_target
+				&move_from_target
+				&copy_from_target
+				&remove_unwanted_file
+				&send_command_file
+				&send_raw_command
+				&hold_key
+				&remove_file
+				&create_folder
+				&remove_folder);
+
+
+##########################################################################
+# AUTO-GENERATED BLOCK - DO NOT MODIFY
+##########################################################################
+$VERSION = 3.3;
+##########################################################################
+
+
+# global variables
+my $FUNCTION;			# dll function entrypoint
+my $dllname;			# dll to call
+my $def_connection_type;	# default (global) connection type
+my $def_codetype;		# default (global) code type
+my $lasterror;			# last error thrown
+my $imagedir;			# image retrieve location
+my $logfile;			# log file to write to
+my $senddir;			# temp send directory
+my $recvdir;			# temp receive directory
+my $workdir;			# stat working directory
+my $statdir;			# stat dll location
+my $loglevel;			# internal logging level
+
+#TMS required vars
+my $httpserver;  		# http server for downloading files
+my $runno;			# needed to obtain build location to download files
+my $commondir;			# common files temp dir
+my $builddir;			# build files location
+
+
+################################################################
+# exported functions
+# Come in 2 levels: Global - apply to all connections, 
+#                   Local - apply to individual connections
+################################################################
+
+################################################################
+# GLOBAL ENTRYPOINTS
+# Apply to all connections
+################################################################
+
+################################################################
+# 	set_dll_folder(<dll folder>);
+#
+# 	Required parameters:
+#	$statdir 	e.g. "C:\epoc32\tools\STAT";
+#
+################################################################
+sub set_dll_folder
+{
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $dir = $cmdref->[0];
+
+	$statdir = $dir;
+
+	return 1;
+}
+
+
+################################################################
+# 	set_working_folder(<working folder>);
+#
+# 	Required parameters:
+#	$statdir 	e.g. "C:\apps\STAT";
+#
+################################################################
+sub set_working_folder
+{
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $dir = $cmdref->[0];
+
+	$workdir = $dir;
+
+	return 1;
+}
+
+
+################################################################
+# Must be the first function called
+# 	initialise(@ARGV);
+# 	initialise(<dll name>, <connection type>, <code type>, <log level>, <log file>, <send dir>, <recv dir>, <common dir>, <httpserver>, <runno>, <builddir>);
+#
+# 	Required parameters:
+#	$dllname 	e.g. STAT.DLL;
+#
+#	Needed only if connection/code types won't change throughout the script
+#	$def_connection_type	e.g. 2 (Symbian Serial)
+#	$def_codetype		e.g. COM2
+#
+#	Needed only for logging
+#	$loglevel 	# internal logging level:
+			# 0 = terse
+			# 1 = noraml
+			# 2 = verbose
+			# 3 = Perl output redirected to log file
+#	$logfile 	e.g. C:\Apps\Stat\LogFiles\StatPerl.log;
+#
+#	Needed only for sending/receiving files (must end in 'slash')
+#	$senddir 	e.g. auto/12267/send/
+#	$recvdir 	e.g. auto/12267/recv/
+#
+#	Needed only for sending common files to target (TMS only - must end in 'slash')
+#	$commondir 	e.g. auto/12267/common/
+
+#	Needed only for sending build files to target (TMS only)
+#	$httpserver e.g. http://lon-adminpool01:8080/AutoTest
+#	$runno	e.g. 150
+#	$builddir 	e.g. auto/12267/build/	(must end in 'slash')
+#
+################################################################
+sub initialise
+{
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	$dllname = $cmdref->[0];
+	$def_connection_type = $cmdref->[1];
+	$def_codetype = $cmdref->[2];
+	$loglevel = $cmdref->[3];
+	$logfile = $cmdref->[4];
+	$senddir = $cmdref->[5];
+	$recvdir = $cmdref->[6];
+	$commondir = $cmdref->[7];
+	$httpserver = $cmdref->[8];
+	$runno = $cmdref->[9];
+	$builddir = $cmdref->[10];
+
+	# required parameter
+	if (!$dllname)
+	{
+		$lasterror = "DLL name not supplied!";
+		Line(get_last_error());
+		return 0;
+	}
+
+	# adjust log level if necessary
+	if ($loglevel < 0)
+	{
+		$loglevel = 0;
+	}
+	if ($loglevel > 3)
+	{
+		$loglevel = 3;
+	}
+	
+	# redirect output to log file if we've supplied one, else will go to screen
+	if ($logfile and ($loglevel eq 3))
+	{
+		print "Redirecting output to [$logfile]...\n";
+		open(STDOUT, ">> $logfile");
+		open(STDERR, ">> $logfile");
+	}
+		
+	# reverse '/' to '\\' in filenames
+	$senddir =~ s/\//\\/g;
+	$recvdir =~ s/\//\\/g;
+	$commondir =~ s/\//\\/g;
+	$builddir =~ s/\//\\/g;
+
+	if (!$workdir)
+	{
+		$workdir = "C:\\apps\\stat";
+	}
+	Line("Working directory: $workdir\n");
+
+	if (!$statdir)
+	{
+		$statdir = "C:\\epoc32\\tools\\STAT";
+	}
+	Line("Stat directory: $statdir\n");
+
+	Line("Initialising STAT API:\n  DLLName [$dllname]\n  Default Connection [$def_connection_type]\n  Default Code Type [$def_codetype]\n  Log Level [$loglevel]\n  LogFile [$logfile]\n  Send [$senddir]\n  Recv [$recvdir]\n  Common [$commondir]\n  HTTPServer [$httpserver]\n  Run No [$runno]\n  Build [$builddir]\n");
+	return 1;
+}
+
+
+################################################################
+# Get the version of the dll
+################################################################
+sub get_version
+{
+	$FUNCTION = new Win32::API("$statdir/$dllname", "StdVersion", [V], P);
+	if (defined($FUNCTION))
+	{
+		$ret = $FUNCTION->Call();
+		if ($ret)
+		{
+			return $ret;
+		}
+		else
+		{
+			$lasterror = "Version could not be established\n";
+		}
+	}
+	else
+	{
+		$lasterror = "Function StdVersion not found\n";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Set logging of stat connection attempts
+# param0: logfile
+################################################################
+sub set_connection_logging
+{
+	Line("Setting connection logging...");
+	if ($loglevel and $logfile)
+	{
+		$FUNCTION = new Win32::API("$statdir/$dllname", "StdSetConnectionLogging", [P], I);
+		if (defined($FUNCTION))
+		{
+			Line("Logging to $logfile");
+			$ret = $FUNCTION->Call($logfile);
+			if ($ret)
+			{
+				return 1;
+			}
+			else
+			{
+				GetDllError(0);
+			}
+		}
+		else
+		{
+			$lasterror = "Function StdSetConnectionLogging not found\n";
+		}
+	}
+	else
+	{
+		$lasterror = "Logging disabled or logfile not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Set logging of stat connection attempts
+# param0: logfile
+################################################################
+sub close_connection_logging
+{
+	Line("Closing connection logging...");
+	if ($loglevel and $logfile)
+	{
+		$FUNCTION = new Win32::API("$statdir/$dllname", "StdCloseConnectionLogging", [], V);
+		if (defined($FUNCTION))
+		{
+			Line("Stopping logging to $logfile");
+			$FUNCTION->Call();
+			return 1;
+		}
+		else
+		{
+			$lasterror = "Function StdCloseConnectionLogging not found\n";
+		}
+	}
+	else
+	{
+		$lasterror = "Logging disabled or logfile not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Retrieve the device log file to our log and truncate it at that point on the device
+################################################################
+sub get_device_log_file
+{
+	Line("Retrieving log file...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+
+	if ($loglevel and $logfile)
+	{
+		if ($hndl)
+		{
+			if (SendCommand($hndl, "<B><G><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Handle not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Logging disabled or logfile not supplied";
+	}
+	
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Set the output directory for screenshots
+################################################################
+sub set_screenshot_dir
+{
+	Line("Setting screenshot dir...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $dir = $cmdref->[0];
+	if ($dir)
+	{
+		$imagedir = $dir;
+
+		# reverse '/' to '\\' for DOS
+		$imagedir =~ s/\//\\/g;
+		
+		Line("Directory ($imagedir)");
+		return 1;
+	}
+
+	$lasterror = "Directory not supplied";
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Get the last error that occurred
+################################################################
+sub get_last_error
+{
+	# add prefix if not one already	
+	if (!(substr($lasterror, 0, 8) =~ "ERROR : "))
+	{
+		$lasterror = "ERROR : $lasterror";
+	}
+	
+	return $lasterror;
+}
+
+
+################################################################
+# LOCAL ENTRYPOINTS
+# Apply to individual connection
+################################################################
+
+################################################################
+# Connect to the target device
+################################################################
+sub connect_to_target
+{
+	Line("Connecting to $statdir/$dllname...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $connection_type = $cmdref->[0];
+	my $codetype = $cmdref->[1];
+
+	# if we haven't supplied a connection type through here, maybe it was defined during initialise()
+	if (!$connection_type)
+	{
+		$connection_type = $def_connection_type;
+	}
+
+	# if we haven't supplied a code type through here, maybe it was defined during initialise()
+	if (!$codetype)
+	{
+		$codetype = $def_codetype;
+	}
+	
+	if ($connection_type)
+	{
+		if ($codetype)
+		{
+			$FUNCTION = new Win32::API("$statdir/$dllname", "StdConnect", [I, P, P, P], I);
+			if (defined($FUNCTION))
+			{
+				Line("Connecting ($connection_type, $codetype)...");
+				my $hndl = $FUNCTION->Call($connection_type, $codetype, 0, 0);
+				if ($hndl)
+				{
+					return $hndl;
+				}
+				else
+				{
+					GetDllError(0);
+				}
+			}
+			else
+			{
+				$lasterror = "Function StdConnect not found";
+			}
+		}
+		else
+		{
+			$lasterror = "Code type not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Connection type not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Connect to the target device in a multithreaded environment
+################################################################
+sub connect_to_target_multithreaded
+{
+	Line("Connecting to $statdir/$dllname (" . get_version() . ")...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $connection_type = $cmdref->[0];
+	my $codetype = $cmdref->[1];
+
+	# if we haven't supplied a connection type through here, maybe it was defined during initialise()
+	if (!$connection_type)
+	{
+		$connection_type = $def_connection_type;
+	}
+
+	# if we haven't supplied a code type through here, maybe it was defined during initialise()
+	if (!$codetype)
+	{
+		$codetype = $def_codetype;
+	}
+	
+	if ($connection_type)
+	{
+		if ($codetype)
+		{
+			$FUNCTION = new Win32::API("$statdir/$dllname", "StdConnectMT", [I, P], I);
+			if (defined($FUNCTION))
+			{
+				Line("Connecting ($connection_type, $codetype)...");
+				my $hndl = $FUNCTION->Call($connection_type, $codetype);
+				if ($hndl)
+				{
+					return $hndl;
+				}
+				else
+				{
+					GetDllError(0);
+				}
+			}
+			else
+			{
+				$lasterror = "Function StdConnect not found";
+			}
+		}
+		else
+		{
+			$lasterror = "Code type not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Connection type not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Disconnect from the target device
+################################################################
+sub disconnect_from_target
+{
+	Line("Disconnecting from $statdir/$dllname...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+
+	if ($hndl)
+	{
+		$FUNCTION = new Win32::API("$statdir/$dllname", "StdDisconnect", [I], I);
+		if (defined($FUNCTION))
+		{
+			Line("Disconnecting $statdir/$dllname ($hndl)...");
+			$ret = $FUNCTION->Call($hndl);
+			if ($ret)
+			{
+				return 1;
+			}
+			else
+			{
+				GetDllError($hndl);
+			}
+		}
+		else
+		{
+			$lasterror = "Function StdDisconnect not found";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Set logging of stat commands
+# param0: logfile
+# param1: log level
+# param2: append or overwrite
+# param3: reserved
+# param4: reserved
+################################################################
+sub set_command_logging
+{
+	Line("Setting command logging...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	if (($loglevel > 1) and $logfile)
+	{
+		if ($hndl)
+		{
+			if ($logfile)
+			{
+				$FUNCTION = new Win32::API("$statdir/$dllname", "StdSetCommandLogging", [I, P, P, I, I, P, P], I);
+				if (defined($FUNCTION))
+				{
+					Line("Logging to ($hndl, $logfile, $actual_level)");
+					$ret = $FUNCTION->Call($hndl, $logfile, 0, $loglevel, 0, 0, 0);
+					if ($ret)
+					{
+						return 1;
+					}
+					else
+					{
+						GetDllError($hndl);
+					}
+				}
+				else
+				{
+					$lasterror = "Function StdSetCommandLogging not found\n";
+				}
+			}
+			else
+			{
+				$lasterror = "Logfile not supplied";
+			}
+		}
+		else
+		{
+			$lasterror = "Handle not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Logging level incorrect or logfile not supplied";
+	}
+	
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Set command delay
+# param0: delay (in milliseconds).  Range 100 (default) -> 30,000
+# The delay is inserted between complete commands, not between
+# individual keystrokes.
+################################################################
+sub set_command_delay
+{
+	Line("Setting command delay...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $delay = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($delay)
+		{
+			$FUNCTION = new Win32::API("$statdir/$dllname", "StdSetCommandDelay", [I, I], I);
+			if (defined($FUNCTION))
+			{
+				Line("Delay ($hndl, $delay)");
+				$ret = $FUNCTION->Call($hndl, $delay);
+				if ($ret)
+				{
+					return 1;
+				}
+				else
+				{
+					GetDllError($hndl);
+				}
+			}
+			else
+			{
+				$lasterror = "Function StdSetCommandDelay not found\n";
+			}
+		}
+		else
+		{
+			$lasterror = "Delay not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Set image verification
+# param0: Ref Dir (string) - the directory where the reference 
+# images are located
+# param1: Remove old images (bool)
+# param2: Fudge factor - what percentage (0 -> 100%) of mismatched 
+# pixels are still considered to be a match
+################################################################
+sub set_image_verification
+{
+	Line("Setting image verification...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $refdir = $cmdref->[1];
+	my $removeImages = $cmdref->[2];
+	my $fudgeFactor = $cmdref->[3];
+	if ($hndl)
+	{
+		if ($refdir)
+		{
+			$FUNCTION = new Win32::API("$statdir/$dllname", "StdSetImageVerification", [I, P, I, I], I);
+			if (defined($FUNCTION))
+			{
+				Line("Reference Directory ($hndl, $refdir, $removeImages, $fudgeFactor)");
+				$ret = $FUNCTION->Call($hndl, $refdir, $removeImages, $fudgeFactor);
+				if ($ret)
+				{
+					return 1;
+				}
+				else
+				{
+					GetDllError($hndl);
+				}
+			}
+			else
+			{
+				$lasterror = "Function StdSetImageVerification not found\n";
+			}
+		}
+		else
+		{
+			$lasterror = "Reference Image Directory not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Get a target screenshot
+################################################################
+sub get_screenshot
+{
+	Line("Getting screenshot...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $name = $cmdref->[1];
+	my $command;
+	if ($hndl)
+	{
+		if ($name)
+		{
+			if ($imagedir)
+			{
+				$command = "<B><#image $imagedir/><S$name><E>";
+			}
+			else
+			{
+				$command = "<B><S$name><E>";
+			}
+		}	
+		else
+		{
+			if ($imagedir)
+			{
+				$command = "<B><#image $imagedir/><S><E>";
+			}
+			else
+			{
+				$command = "<B><S><E>";
+			}
+		}
+
+		if (SendCommand($hndl, $command))
+		{
+			return 1;
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Get Device Information
+################################################################
+sub get_device_info
+{
+	Line("Getting device info...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+
+	if (SendCommand($hndl, "<B><D><E>"))
+	{
+		return 1;
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# 'Touch' the screen at specified co-ordinates
+################################################################
+sub touch_screen
+{
+	Line("Touching screen...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $xx = $cmdref->[1];
+	my $yy = $cmdref->[2];
+	if ($hndl)
+	{
+		if ($xx and $yy)
+		{
+			if (SendCommand($hndl, "<B><I$xx,$yy><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "X-Y co-ordinates not specified";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Start an application and create a new file
+################################################################
+sub start_application
+{
+	Line("Starting application...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $name = $cmdref->[1];
+	my $doc = $cmdref->[2];
+	if ($hndl)
+	{
+		if ($name)
+		{
+			my $command;
+			if ($doc)
+			{
+				$command = "<B><A$name,$doc><E>";
+			}
+			else
+			{
+				$command = "<B><A$name><E>";
+			}
+	
+			if (SendCommand($hndl, $command))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Application name not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Start a program with parameters
+################################################################
+sub start_program
+{
+	Line("Starting program...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $name = $cmdref->[1];
+	my $param = $cmdref->[2];
+	if ($hndl)
+	{
+		if ($name)
+		{
+			my $command;
+			if ($param)
+			{
+				$command = "<B><J$name,$param><E>";
+			}
+			else
+			{
+				$command = "<B><J$name><E>";
+			}
+	
+			if (SendCommand($hndl, $command))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Program name not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Start an application and open an existing new file
+################################################################
+sub open_application
+{
+	Line("Opening application...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $name = $cmdref->[1];
+	my $doc = $cmdref->[2];
+	if ($hndl)
+	{
+		if ($name and $doc)
+		{
+			if (SendCommand($hndl, "<B><F$name,$doc><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Application name and file not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Close the current application
+################################################################
+sub close_application
+{
+	Line("Closing application...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	if ($hndl)
+	{
+		if (SendCommand($hndl, "<B><C><E>"))
+		{
+			return 1;
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+	
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Send a sequence of basic keystrokes
+################################################################
+sub basic_key_sequence
+{
+	Line("Sending basic key sequence...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $sequence = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($sequence)
+		{
+			if (SendCommand($hndl, "<B><K$sequence><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Key sequence not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Send a control keystroke
+################################################################
+sub control_keystroke
+{
+	Line("Sending control keystroke...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $keystroke = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($keystroke)
+		{
+			if (SendCommand($hndl, "<B><L$keystroke><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Control keystroke not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Send a combination keystroke
+################################################################
+sub combination_keystroke
+{
+	Line("Sending combination keystroke...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $combination = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($combination)
+		{
+			if (SendCommand($hndl, "<B><M$combination><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Combination keystroke not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Pause for milliseconds
+################################################################
+sub pause
+{
+	Line("Pausing...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $pause = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($pause)
+		{
+			if (SendCommand($hndl, "<B><P$pause><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Value not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Start ESHELL command interpreter
+################################################################
+sub start_eshell
+{
+	Line("Starting ESHELL...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	if ($hndl)
+	{
+		if (SendCommand($hndl, "<B><!><E>"))
+		{
+			return 1;
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Stop ESHELL command interpreter
+################################################################
+sub stop_eshell
+{
+	Line("Stopping ESHELL...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	if ($hndl)
+	{
+		if (SendCommand($hndl, "<B><!!><E>"))
+		{
+			return 1;
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Transfer (copy) common test file to target.  Copies a 'common'
+# test file to the target board.
+################################################################
+sub copy_commonfile_to_target
+{
+	Line("Copying commonfile file to target...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $source = $cmdref->[1];
+	my $dest = $cmdref->[2];
+	if ($hndl)
+	{
+		if ($source and $dest)
+		{
+			if (SendCommand($hndl, "<B><T$commondir$source,$dest><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Source and/or target names not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Transfer (copy) test file to target.  Copies a specific test 
+# file to the target board.
+################################################################
+sub copy_testfile_to_target
+{
+	Line("Copying testfile file to target...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $source = $cmdref->[1];
+	my $dest = $cmdref->[2];
+	if ($hndl)
+	{
+		if ($source and $dest)
+		{
+			if (SendCommand($hndl, "<B><T$senddir$source,$dest><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Source and/or target names not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Transfer (copy) build file to target.  Copies a file located
+# within a build image to the target board
+################################################################
+sub copy_buildfile_to_target
+{
+	Line("Copying buildfile file to target...");
+	
+	if (!$httpserver or !$runno or !builddir)
+	{
+		Line("ERROR: TMS Server, run number, or build directory not defined - Build files cannot be transfered");
+		return 0;
+	}
+
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $source = $cmdref->[1];
+	my $dest = $cmdref->[2];
+	my $codetype = $cmdref->[2];
+	if ($hndl)
+	{
+		if ($source and $dest)
+		{
+			# find the location of the build
+			$location = GetBuildLocation($codetype);
+			if ($location)
+			{		
+				# get the desired file from the TMS
+				if (DownloadAndSaveFile("$location/$source", "$workdir$builddir$source"))
+				{			
+					# send the file	to the target device
+					if (SendCommand($hndl, "<B><T$builddir$source,$dest><E>"))
+					{
+						return 1;
+					}
+				}				
+				else
+				{
+					$lasterror = "Could not download file $location/$file";
+				}
+			}
+			else
+			{
+				$lasterror = "Build location could not be obtained";
+			}
+		}
+		else
+		{
+			$lasterror = "Source and/or target names not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Retrieve (move) file from target
+################################################################
+sub move_from_target
+{
+	Line("Moving file from target...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $source = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($source)
+		{
+			if (SendCommand($hndl, "<B><X$source,$recvdir><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Source name not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Retrieve (copy) file from target
+################################################################
+sub copy_from_target
+{
+	Line("Copying file from target...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $source = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($source)
+		{
+			if (SendCommand($hndl, "<B><R$source,$recvdir><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Source name not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Delete unneeded file from target
+################################################################
+sub remove_file
+{
+	Line("Removing file...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $file = $cmdref->[1];
+	
+	if ($hndl)
+	{
+		if ($file)
+		{
+			if (SendCommand($hndl, "<B><U$file><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "File not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Creating a folder on the target
+################################################################
+sub create_folder
+{
+	Line("Creating folder...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $folder = $cmdref->[1];
+	
+	if ($hndl)
+	{
+		if ($folder)
+		{
+			if (SendCommand($hndl, "<B><N$folder><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Folder not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Delete unneeded folder from target
+################################################################
+sub remove_folder
+{
+	Line("Removing folder...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $folder = $cmdref->[1];
+	
+	if ($hndl)
+	{
+		if ($folder)
+		{
+			if (SendCommand($hndl, "<B><Z$folder><E>"))
+			{
+				return 1;
+			}
+		}
+		else
+		{
+			$lasterror = "Folder not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Hold a key down for a specified time
+################################################################
+sub hold_key
+{
+	Line("Holding key down for specified time...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $key = $cmdref->[1];
+	my $delaytime = $cmdref->[2];
+	
+	if ($hndl)
+	{
+		if ($key)
+		{
+			if ($delaytime)
+			{
+				if (SendCommand($hndl, "<B><H$key,$delaytime><E>"))
+				{
+					return 1;
+				}
+			}
+			else
+			{
+				$lasterror = "Delay time not supplied";
+			}
+		}
+		else
+		{
+			$lasterror = "Key not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Execute a command file
+################################################################
+sub send_command_file
+{
+	Line("Sending command file...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $file = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($file)
+		{
+			$FUNCTION = new Win32::API("$statdir/$dllname", "StdSendCommandFile", [I, P, P], I);
+			if (defined($FUNCTION))
+			{
+				Line("Command File ($hndl, $file )");
+				$ret = $FUNCTION->Call($hndl, $file, 0);
+				if ($ret)
+				{
+					return 1;
+				}
+				else
+				{
+					GetDllError($hndl);
+				}
+			}
+			else
+			{
+				$lasterror = "Function StdSendCommandFile not found\n";
+			}
+		}
+		else
+		{
+			$lasterror = "Command file not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# Execute a raw command
+################################################################
+sub send_raw_command
+{
+	Line("Executing raw command...");
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $command = $cmdref->[1];
+	if ($hndl)
+	{
+		if ($command)
+		{
+			$FUNCTION = new Win32::API("$statdir/$dllname", "StdSendRawCommand", [I, P, P], I);
+			if (defined($FUNCTION))
+			{
+				Line("Command File ($hndl, $command)");
+				$ret = $FUNCTION->Call($hndl, $command, 0);
+				if ($ret)
+				{
+					return 1;
+				}
+				else
+				{
+					GetDllError($hndl);
+				}
+			}
+			else
+			{
+				$lasterror = "Function StdSendRawCommand not found\n";
+			}
+		}
+		else
+		{
+			$lasterror = "Command file not supplied";
+		}
+	}
+	else
+	{
+		$lasterror = "Handle not supplied";
+	}
+
+	Line(get_last_error());
+	return 0;
+}
+
+
+################################################################
+# PRIVATE FUNCTIONS
+################################################################
+
+#############################################################################
+# Get the STAT working path from the registry
+#############################################################################
+sub GetSTATWorkingDirectory
+{
+	my $swkey = $Registry->{"LMachine/software/"};
+	my $endkey = $swkey->{"symbian/stat/"};
+	
+	$workdir = $endkey->{"/WorkingPath"};
+	if (!$workdir)
+	{
+		$lasterror = "Cannot obtain STAT work dir from registry";
+		return 0;
+	}
+
+	$statdir = $endkey->{"/InstallRoot"};
+	if (!$statdir)
+	{
+		$lasterror = "Cannot obtain STAT Install dir from registry";
+		return 0;
+	}
+
+	# substitute DOS '\' with '/' if needed
+	$workdir = "$workdir/";
+	$workdir =~ s/\\/\//g;
+	$statdir =~ s/\\/\//g;
+
+	return 1;
+}
+
+
+################################################################
+# Get the error that occurred within the DLL call
+################################################################
+sub GetDllError
+{
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+
+	$FUNCTION = new Win32::API("$statdir/$dllname", "StdGetError", [I], P);
+	if (defined($FUNCTION))
+	{
+		if ($hndl)
+		{
+			Line("Handle : ($hndl)");
+		}
+
+		$lasterror = $FUNCTION->Call($hndl);
+	}
+	else
+	{
+		$lasterror = "Function StdGetError not found";
+	}
+	
+	return $lasterror;
+}
+
+
+#############################################################################
+# Display a line of text
+#############################################################################
+sub Line
+{
+	my ($msg) = @_;
+
+	if ($msg)
+	{
+		($hour, $min, $sec) = (localtime)[2,1,0];
+		printf("%02d:%02d:%02d $msg\n", $hour, $min, $sec);
+		STDOUT->autoflush;
+		STDERR->autoflush;
+	}
+}
+
+
+###############################################################################################
+# Construct a build location depending on the code and build type
+###############################################################################################
+sub GetBuildLocation
+{
+	my $command;
+	
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $codetype = $cmdref->[0];
+
+	if (!$httpserver)
+	{
+		$lasterror = "TMS Server not defined";
+		Line(get_last_error());
+		return 0;
+	}
+
+	# ceate a user agent object
+	my $ua = new LWP::UserAgent;
+	$ua->agent("AgentName/0.1 " . $ua->agent);
+	
+	$req = new HTTP::Request GET => "$httpserver/GetBuildLocation?RunNo=$runno";
+	$req->header('User-Agent' => $ua->agent);
+	$req->header('Authorization' => "Basic $encoded");
+	$req->header('Content-type' => 'binary');
+	$res = $ua->request($req);
+	if (!$res->is_success)
+	{
+		$lasterror = "Cannot open $httpserver/GetBuildLocation";
+		Line(get_last_error());
+		return 0;
+	}
+
+	# decide build type depending on $codetype
+	my $buildtype = "UREL";
+	if ($codetype eq "WINS")
+	{
+		$buildtype = "UDEB";
+	}
+
+	$command = "$httpserver/" . $res->content() . "/epoc32/release/$codetype/$buildtype";
+
+	# remove any carriage returns in the string
+	$command =~ s/\n//g;
+	
+	Line("Build location is [$command]");
+
+	return $command;
+}
+
+
+###############################################################################################
+# Download a single file to a local location
+###############################################################################################
+sub DownloadAndSaveFile
+{
+	my ($source, $destination) = @_;
+
+	# substitute DOS '\' with '/' if needed
+	$source =~ s/\\/\//g;
+	$destination =~ s/\\/\//g;
+
+	Line("$source => $destination");
+
+	# ceate a user agent object
+	my $ua = new LWP::UserAgent;
+	$ua->agent("AgentName/0.1 " . $ua->agent);
+	
+	$req = new HTTP::Request GET => "$source";
+	$req->header('User-Agent' => $ua->agent);
+	$req->header('Authorization' => "Basic $encoded");
+	$req->header('Content-type' => 'binary');
+	$res = $ua->request($req);
+	if (!$res->is_success)
+	{
+		$lasterror = "Cannot open $source";
+		Line(get_last_error());
+		return 0;
+	}
+
+	Line("Saving retrieved file to $destination...");
+
+	# save the retrieved contents to disk
+	my $fh = IO::File->new ("$destination", O_CREAT | O_WRONLY | O_TRUNC);
+	binmode($fh);
+	if ($fh)
+	{
+		print $fh $res->content();
+		$fh->autoflush(1);
+		close($fh);
+	}
+	else
+	{
+		$lasterror = "Cannot create $destination";
+		Line(get_last_error());
+		return 0;
+	}
+
+	return 1;
+}
+
+
+################################################################
+# Send a command to the target
+################################################################
+sub SendCommand
+{
+	my @cmdline = @_;
+	my $cmdref = \@cmdline;
+	my $hndl = $cmdref->[0];
+	my $command = $cmdref->[1];
+
+	# substitute Perl '/' with DOS '\' if needed
+	$command =~ s/\//\\/g;
+
+	$FUNCTION = new Win32::API("$statdir/$dllname", "StdSendRawCommand", [I, P, P], I);
+	if (defined($FUNCTION))
+	{
+		Line("Command ($hndl, $command)");
+		$ret = $FUNCTION->Call($hndl, $command, 0);
+		if ($ret)
+		{
+			return 1;
+		}
+		else
+		{
+			GetDllError($hndl);
+		}
+	}
+	else
+	{
+		$lasterror = "Function StdSendRawCommand not found";
+	}
+
+	return 0;
+}
+
+
+# last line in file
+1;
+__END__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/perl/using stat with perl.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,18 @@
+To use STATApi with Perl requires that Perl has access to the Win32::API module.  This is not a standard component of the ActiveState Perl download but it is easy to download seperately.  From a command prompt (with the Perl binaries in the path):
+1. Type 'ppm' to start the Perl Package Manager.
+The prompt will change to show you are in a different command interpretor.
+2. Type 'search Win32::API'.
+PPM should find several packages that match the description.  Select a suitable package (an example of one that worked under test was Win32-API from ActiveState).
+3. Type 'install <Package Name>'.
+For example, this may be 'install Win32-API'.  PPM will install the package and confirm that Win::API is added to the Perl libraries.
+4. Type 'exit' to close PPM.
+The prompt will return to the command shell.
+
+To run a Perl script making use of STATApi the file STATApi.pm must be in the same folder as the script OR in the Perl library folder.  (During testing it is easier to copy the file to where the script is executed).
+
+To debug the behaviour of the STAT.dll library under Perl use VC++ and specify some project settings for the STAT.dll project.
+1. Locate the Debug tab of the Project Settings dialog.
+2. For the executable entry browse to the Perl application (probably 'C:\Perl\bin\Perl.exe' for example).
+3. For the working directory enter the folder that contains the script (and the file STATApi.pm if this is not in the Perl library folder).
+4. For the program arguments enter the path to the script to be executed.
+You can now set breakpoints in the DLL code and VC++ will hit these when the script executes.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,65 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "STATDesktop"=.\desktop\STATDesktop.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "STATDll"=.\dll\STATdll.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "STATLib"=.\lib\STATLib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "stat2perl"=.\stat2perl\stat2perl.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+
+TOOLS
+
+PRJ_MMPFILES
+// Extension Makefile
+makefile stat2perl.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/group/stat2perl.mk	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+# which accompanies this distribution, and is available
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# Typically C:\apps\MSVC6\VC98\Bin
+COMPILER=nmake
+
+# Called with
+#
+# $(PLATFORM) = TOOLS
+# $(CFG)      = DEB, REL
+
+BLD	:  
+	@echo BLD called with $(PLATFORM)$(CFG)
+	
+# release version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-mkdir "$(EPOCROOT)epoc32\tools\STAT"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (stat2perl)
+	"$(COMPILER)" /A /NOLOGO /f "stat2perl.mak" CFG="stat2perl - Win32 Release"
+	
+	echo ** STAT 2 PERL CONVERTER (RELEASE) compiled successfully
+
+!endif
+
+# debug version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (stat2perl)
+	"$(COMPILER)" /A /NOLOGO /f "stat2perl.mak" CFG="stat2perl - Win32 Debug"
+	
+	echo ** STAT 2 PERL CONVERTER (DEBUG) compiled successfully
+
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-rmdir "..\Release" /q /s
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+	-rmdir "..\Debug" /q /s
+!endif
+
+RELEASABLES :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	@echo $(EPOCROOT)epoc32\tools\STAT\STAT2PERL.exe
+!endif
+
+SAVESPACE : BLD
+
+MAKMAKE LIB CLEANLIB RESOURCE FREEZE FINAL : 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/inc/commandline.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     include file for Commandline access							*
+*/
+
+
+
+
+
+// Provides access to the command line
+//
+
+#ifndef COMMANDLINE_H
+#define COMMANDLINE_H
+
+class CommandLine
+{
+public:
+	CommandLine();
+	virtual ~CommandLine(){}
+
+	char * GetProgramArgument(const unsigned int iIndex);
+	unsigned int GetNumberOfArgs() {return iCount;}
+	bool FindArgument(const char *pArg);
+	char * GetArgumentBySwitch(const char *pSwitch, const bool bIncludeSwitch = false);
+	char * GetArgumentString();
+
+private:
+	unsigned int iCount;
+	char *pArguments[256];
+	char *pCmdLine;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/inc/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     include file for standard system include files				*
+*/
+
+
+
+
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__55543DF3_BBFB_11D5_BC3C_00B0D065107F__INCLUDED_)
+#define AFX_STDAFX_H__55543DF3_BBFB_11D5_BC3C_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <windows.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__55543DF3_BBFB_11D5_BC3C_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/src/commandline.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+#include "CommandLine.h"
+
+CommandLine::CommandLine()
+: iCount(0), pCmdLine(NULL)
+{
+	char *pTmpCmdLine = GetCommandLine();
+
+	// see if we have one
+	if (pTmpCmdLine && *pTmpCmdLine)
+	{
+		char *pStart, *ptr;
+		unsigned int len = strlen(pTmpCmdLine);
+
+		// save a copy
+		pCmdLine = new char[len + 1];
+		strcpy(pCmdLine, pTmpCmdLine);
+
+		// get a working copy
+		pTmpCmdLine = new char[len + 1];
+		strcpy(pTmpCmdLine, pCmdLine);
+		ptr = pTmpCmdLine;
+
+		// reset the array
+		for (int i=0;i<256;i++)
+			pArguments[i] = NULL;
+
+		// limit of 256 arguments
+		for (i=0;i<256;i++)
+		{
+			pStart = ptr;
+
+			// step to start of argument
+			while (*pStart && *pStart == ' ')
+				pStart++;
+
+			// step to end of argument
+			ptr = pStart;
+			while (*ptr && *ptr != ' ')
+			{
+				// if path is enclosed in quotes, we skip any spaces that might exist within them
+				// NOTE: if a quote exists inside the path, we will lose the first part of the argument!
+				if (*ptr == '"')
+				{
+					ptr++;
+					pStart = ptr;					// don't want first quote in the returned argument
+					while (*ptr && *ptr != '"')
+						ptr++;
+
+					if (*ptr == '"')
+					{
+						*ptr = (char)0;				// don't want last quote in the returned argument
+					}
+				}
+				ptr++;
+			}
+
+			// not at the end so separate arguments
+			if (*ptr)
+			{
+				(*ptr) = (char)0;
+				ptr++;
+			}
+
+			if (*pStart)
+			{
+				// store argument
+				pArguments[i] = new char[strlen(pStart) + 1];
+				strcpy(pArguments[i], pStart);
+				iCount++;
+			}
+			else
+				break;
+		}
+
+		delete [] pTmpCmdLine;
+	}
+}
+
+
+// return whole command line less the first arg (app name)
+char * CommandLine::GetArgumentString()
+{
+	if (pCmdLine && *pCmdLine)
+		return pCmdLine;
+
+	return NULL;
+}
+
+
+// return an argument match
+bool CommandLine::FindArgument(const char *pArg)
+{
+	bool valid = false;
+
+	for (unsigned int i=0;i<iCount;i++)
+	{
+		if (strcmp(pArg, pArguments[i]) == 0)
+		{
+			valid = true;
+			break;
+		}
+	}
+
+	return valid;
+}
+
+
+// return the argument according to the supplied index
+char * CommandLine::GetProgramArgument(const unsigned int iIndex)
+{
+	if (iIndex < iCount)
+	{
+		return pArguments[iIndex];
+	}
+
+	return NULL;
+}
+
+
+// find the argument that begins with the supplied 'switch' and return the value less the 'switch'
+char * CommandLine::GetArgumentBySwitch(const char *pSwitch, const bool bIncludeSwitch)
+{
+	unsigned int len = strlen(pSwitch);
+
+	for (unsigned int i=0;i<iCount;i++)
+	{
+		if (strncmp(pArguments[i], pSwitch, len) == 0)
+		{
+			if (bIncludeSwitch)
+				return pArguments[i];
+			else
+				return pArguments[i] + len;
+		}
+	}
+
+	return NULL;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/src/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/src/stat2perl.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,495 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+#include <commandline.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
+#define IN_LINE_MAX 4096
+
+///////////////////////////////////////////////
+// AUTO-GENERATED TEXT - DO NOT MODIFY!!!
+///////////////////////////////////////////////
+#define S2P_VERSION "4.0"
+///////////////////////////////////////////////
+
+DWORD nFileLength = 0;
+char *lpBuffer = NULL;
+char szConnection[3] = {0};
+char szPlatform[20] = {0};
+char szInputName[MAX_PATH + 1] = {0};
+char szOutputName[MAX_PATH + 1] = {0};
+
+void cleanup(char *message, UINT errorcode = 0);
+bool ReadFileIntoArray(const char *file);
+bool ProcessFileContents(const char *file);
+void ConvertBackslash(char *szCommand);
+void WriteHeader(HANDLE outfile);
+void WriteTrailer(HANDLE outfile);
+void SkipOverComment(DWORD *counter);
+
+int main(int argc, char* argv[])
+{
+	printf("\n------------------------------\n"
+			"STAT2PERL Script Converter %s\n"
+			"------------------------------\n"
+			"Copyright Symbian Ltd 2002.\n"
+			"---------------------------", S2P_VERSION);
+
+	CommandLine oCmd;
+	if (oCmd.GetNumberOfArgs() == 5)
+	{
+		strcpy(szConnection, oCmd.GetProgramArgument(1));
+		strcpy(szPlatform, oCmd.GetProgramArgument(2));
+		strcpy(szInputName, oCmd.GetProgramArgument(3));
+		strcpy(szOutputName, oCmd.GetProgramArgument(4));
+
+		if (ReadFileIntoArray(szInputName))
+		{
+			if (ProcessFileContents(szOutputName))
+			{
+				printf("\n\nFile converted successfully.\n");
+				return 1;
+			}
+		}
+		else
+			printf("\nERROR: Could not read [%s] into memory.\n", szInputName);
+	}
+	else
+		printf("\n\nERROR: Incorrect Number of arguments.\nUsage: stat2perl <connection> <platform> <input file> <output file>\n   Eg: stat2perl 3 COM1 file.txt file.pl\n");
+
+	return -1;
+}
+
+
+bool ReadFileIntoArray(const char *file)
+{
+	HANDLE infile;
+	DWORD bytes = 0;
+	struct stat buf;
+
+	if (stat(file, &buf) == 0)
+	{
+		nFileLength = buf.st_size;
+
+		if ((infile = CreateFile(file,
+							   GENERIC_READ,
+							   0, 
+							   NULL, 
+							   OPEN_EXISTING,
+							   FILE_ATTRIBUTE_NORMAL,
+							   0))
+				!= INVALID_HANDLE_VALUE)
+		{
+			lpBuffer = new char [nFileLength + 1];
+			if (lpBuffer)
+			{
+				if (ReadFile(infile, lpBuffer, nFileLength, &bytes, NULL) && bytes == nFileLength)
+				{
+					CloseHandle(infile);
+					return true;
+				}
+				else
+					printf("\nERROR: Failed to read entire file into memory.");
+
+			}
+			else
+				printf("\nERROR: Could not allocate memory to read file.");
+
+			CloseHandle(infile);
+		}
+		else
+			printf("\nERROR: Could not open [%s] to read.", file);
+	}
+	else
+		printf("\nERROR: [%s] does not exist.", file);
+
+	return false;
+}
+
+bool ProcessFileContents(const char *file)
+{
+	HANDLE outfile;
+	DWORD bytes = 0;
+
+	// open our output file
+	if ((outfile = CreateFile(file,
+						   GENERIC_WRITE,
+						   0, 
+						   NULL, 
+						   CREATE_ALWAYS,
+						   FILE_ATTRIBUTE_NORMAL,
+						   0))
+			!= INVALID_HANDLE_VALUE)
+	{
+		bool bCommand = false;
+		DWORD counter = 0;
+		DWORD actualstart = 0;
+		DWORD actualend = 0;
+
+		WriteHeader(outfile);
+
+		// find the beginning and end
+		while(counter < nFileLength)
+		{
+			// check command format is correct
+			if(lpBuffer[counter] == '<')
+			{
+				counter++;
+				if(lpBuffer[counter] == 'B')
+					actualstart = counter + 2;
+
+				if(lpBuffer[counter] == 'E')
+				{
+					actualend = counter - 2;
+					break;
+				}
+			}
+			else if (lpBuffer[counter] == '/') // start of comment or command
+			{	
+				SkipOverComment(&counter);
+			}
+
+			counter++;
+		}
+
+		// only concerned with usable part of script
+		counter = actualstart;
+		nFileLength = actualend;
+
+		// now parse it...
+		while(counter < nFileLength)	//while not reached end of the file
+		{
+			// check command format is correct
+			if(lpBuffer[counter] == '<')
+			{
+				bCommand = true;
+			}
+			else if (lpBuffer[counter] == '/') // start of comment or command
+			{	
+				SkipOverComment(&counter);
+			}
+			else if (bCommand) // start of comment or command
+			{	
+				char szCommand[2048] = {0};
+				char szLine[IN_LINE_MAX + 1] = {0};
+				char *ptr = NULL;
+				int cmdLength = 0;
+
+				// extract the command
+				while (lpBuffer[counter + cmdLength] != '>')
+					cmdLength++;
+				strncpy(szLine, lpBuffer + counter, cmdLength);
+				*(szLine + counter + cmdLength) = (char)0;
+
+				switch(lpBuffer[counter]) 
+				{
+					case '#' :	// set image directory - format: '#image <location>
+						if ((ptr = strchr(szLine, ' ')) && strncmp(szLine, "#image", 6) == 0)
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "set_screenshot_dir(\"%s\") or goto scripterror;", ptr);
+						}
+						break;
+					case 'D' :		// retrieves information about connected device
+					case 'd' :
+						strcpy(szCommand, "get_device_info($hndl) or goto scripterror;");
+						break;
+					case 'K' :		//standard QWERTY Keypress command
+					case 'k' :
+						sprintf(szCommand, "basic_key_sequence($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						break;
+					case 'L' :	//used to send non-standard key data over (ie - Menu button, Home button, PageDown button)
+					case 'l' :
+						sprintf(szCommand, "control_keystroke($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						break;
+					case 'M' :	//used when combination keys are to be sent over
+					case 'm' :
+						sprintf(szCommand, "combination_keystroke($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						break;
+					case 'H' :	// hold key down for a while
+					case 'h' :
+						if (ptr = strchr(szLine, ','))
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "hold_key($hndl, \"%s\", \"%s\") or goto scripterror;", szLine + 1, ptr);
+						}
+						break;
+					case 'A' :	//Fire up application (second character is a number which opens up the app (e.g - <A1>))
+					case 'a' :
+						if (ptr = strchr(szLine, ','))
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "start_application($hndl, \"%s\", \"%s\") or goto scripterror;", szLine + 1, ptr);
+						}
+						else
+							sprintf(szCommand, "start_application($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						break;
+					case 'F' :	//Open file
+					case 'f' :
+						if (ptr = strchr(szLine, ','))
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "open_application($hndl, \"%s\", \"%s\") or goto scripterror;", szLine + 1, ptr);
+						}
+						break;
+					case 'T' :	//used to transfer files from the PC to the EPOC device
+					case 't' :
+						if (ptr = strchr(szLine, ','))
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "copy_testfile_to_target($hndl, \"%s\", \"%s\") or goto scripterror;", szLine + 1, ptr);
+						}
+						break;
+					case 'R' :	//used to retrieve files from the EPOC device
+					case 'r' :
+						if (ptr = strchr(szLine, ','))
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "copy_from_target($hndl, \"%s\", \"%s\") or goto scripterror;", szLine + 1, ptr);
+						}
+						break;
+					case 'X' :
+					case 'x' :
+						if (ptr = strchr(szLine, ','))
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "move_from_target($hndl, \"%s\", \"%s\") or goto scripterror;", szLine + 1, ptr);
+						}
+						break;
+					case 'S' :	// Used for screen capture 
+					case 's' :
+						if (cmdLength > 1)
+							sprintf(szCommand, "get_screenshot($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						else
+							strcpy(szCommand, "get_screenshot($hndl) or goto scripterror;");
+						break;
+					case 'I' :	//Icon coordinates
+					case 'i' :
+						if (ptr = strchr(szLine, ','))
+						{
+							(*ptr++) = (char)0;
+							sprintf(szCommand, "touch_screen($hndl, %s, %s) or goto scripterror;", szLine + 1, ptr);
+						}
+						break;
+					case 'C' :	//Close currently active application
+					case 'c' :
+						strcpy(szCommand, "close_application($hndl) or goto scripterror;");
+						break;
+					case '!' :	// Start ESHELL.EXE
+						if (*(szLine + 1) != '!')
+							strcpy(szCommand, "start_eshell($hndl) or goto scripterror;");
+						else
+							strcpy(szCommand, "stop_eshell($hndl) or goto scripterror;");
+						break;
+					case 'P' : //pause 
+					case 'p' :
+						sprintf(szCommand, "pause($hndl, %s) or goto scripterror;", szLine + 1);
+						break;
+					case 'U' :	// remove file
+					case 'u' :
+						sprintf(szCommand, "remove_file($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						break;
+					case 'Y' :	// create folder
+					case 'y' :
+						sprintf(szCommand, "create_folder($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						break;
+					case 'Z' :	// remove folder
+					case 'z' :
+						sprintf(szCommand, "remove_folder($hndl, \"%s\") or goto scripterror;", szLine + 1);
+						break;
+				} // switch
+
+				// if command supported, write it to file
+				if (*szCommand)
+				{
+					ConvertBackslash(szCommand);
+					WriteFile(outfile, szCommand, strlen(szCommand), &bytes, NULL);
+					WriteFile(outfile, "\r\n", 2, &bytes, NULL);
+					(*szCommand) = (char)0;
+				}
+
+				counter += cmdLength;
+				bCommand = false;
+			}
+
+			counter++;
+		}
+
+		WriteTrailer(outfile);
+		CloseHandle(outfile);
+	}
+	else
+	{
+		printf("\nERROR: Could not open [%s] to write.", file);
+		return false;
+	}
+
+	return true;
+}
+
+void SkipOverComment(DWORD *counter)
+{
+	int iInComment = 0;
+
+	// beginning of comment
+	if (lpBuffer[(*counter) + 1] == '*')
+	{
+		iInComment++;
+		(*counter)+=2;
+		while(iInComment && (*counter) < nFileLength)	//while not reached end of the file
+		{
+			if (lpBuffer[(*counter)] == '/')
+			{
+				// beginning of comment - support nested comments
+				if (lpBuffer[(*counter) + 1] == '*')
+				{
+					iInComment++;
+					(*counter)++;
+				}
+
+				// end of comment
+				if (lpBuffer[(*counter) - 1] == '*')
+				{
+					iInComment--;
+				}
+			}
+
+			(*counter)++;
+		}
+	}
+}
+
+void ConvertBackslash(char *szCommand)
+{
+	char szCopy[IN_LINE_MAX + 1] = {0};
+	int iSrc = 0, iDest = 0;
+
+	while(*(szCommand + iSrc))
+	{
+		// need to substitute the special chars
+		if (*(szCommand + iSrc) == '\r')
+		{
+			*(szCopy + iDest) = '\\';
+			iDest++;
+			*(szCopy + iDest) = 'r';
+			iDest++;
+		}
+		else if (*(szCommand + iSrc) == '\n')
+		{
+			*(szCopy + iDest) = '\\';
+			iDest++;
+			*(szCopy + iDest) = 'n';
+			iDest++;
+		}
+		else if (*(szCommand + iSrc) == '\t')
+		{
+			*(szCopy + iDest) = '\\';
+			iDest++;
+			*(szCopy + iDest) = 't';
+			iDest++;
+		}
+		else if (*(szCommand + iSrc) == '@')
+		{
+			*(szCopy + iDest) = '\\';
+			iDest++;
+			*(szCopy + iDest) = '@';
+			iDest++;
+		}
+		else
+		{
+			// append a backslash
+			if (*(szCommand + iSrc) == '\\')
+			{
+				*(szCopy + iDest) = '\\';
+				iDest++;
+			}
+
+			// now copy the char
+			*(szCopy + iDest) = *(szCommand + iSrc);
+			iDest++;
+		}
+
+		// don't go too far
+		if (iDest >= IN_LINE_MAX)
+		{
+			*(szCopy + iDest) = (char)0;
+			break;
+		}
+		iSrc++;
+	}
+
+	strcpy(szCommand, szCopy);
+}
+
+void WriteHeader(HANDLE outfile)
+{
+	DWORD bytes = 0;
+	char szLine[2048] = {0};
+
+	WriteFile(outfile, "#########################################################################\r\n", 75, &bytes, NULL);
+	WriteFile(outfile, "# STAT2PERL CONVERTED SCRIPT\r\n", 30, &bytes, NULL);
+	WriteFile(outfile, "#\r\n", 3, &bytes, NULL);
+	WriteFile(outfile, "# For STAT Perl Interface ", 26, &bytes, NULL);
+	WriteFile(outfile, S2P_VERSION, strlen(S2P_VERSION), &bytes, NULL);
+	WriteFile(outfile, " or higher\r\n#\r\n", 15, &bytes, NULL);
+	WriteFile(outfile, "# Auto-Generated from script:\r\n", 31, &bytes, NULL);
+	sprintf(szLine, "# %s\r\n#\r\n", szInputName);
+	WriteFile(outfile, szLine, strlen(szLine), &bytes, NULL);
+	WriteFile(outfile, "#########################################################################\r\n", 75, &bytes, NULL);
+	WriteFile(outfile, "\r\n", 2, &bytes, NULL);
+	WriteFile(outfile, "use Symbian::StatAPI30;  # must include this library\r\n\r\n", 56, &bytes, NULL);
+	WriteFile(outfile, "my $result = 1;          # test result\r\n", 40, &bytes, NULL);
+	WriteFile(outfile, "my $hndl;                # handle to connection\r\n\r\n", 51, &bytes, NULL);
+	WriteFile(outfile, "# set everything up\r\n", 21, &bytes, NULL);
+	sprintf(szLine, "my @arglist = (\"STAT.DLL\", %c, \"%s\");\r\n", szConnection[0], _strupr(szPlatform));
+	WriteFile(outfile, szLine, strlen(szLine), &bytes, NULL);
+	WriteFile(outfile, "initialise(@arglist) or goto scripterror;\r\n\r\n", 45, &bytes, NULL);
+	WriteFile(outfile, "# connect to the board\r\n", 24, &bytes, NULL);
+	WriteFile(outfile, "$hndl = connect_to_target();\r\n", 30, &bytes, NULL);
+	WriteFile(outfile, "$hndl or goto scripterror;\r\n\r\n", 30, &bytes, NULL);
+	WriteFile(outfile, "# send commands\r\n", 17, &bytes, NULL);
+}
+
+
+void WriteTrailer(HANDLE outfile)
+{
+	DWORD bytes = 0;
+
+	WriteFile(outfile, "\r\n\r\n#########################################################################\r\n", 79, &bytes, NULL);
+	WriteFile(outfile, "# test succeeded\r\n", 18, &bytes, NULL);
+	WriteFile(outfile, "goto endscript;\r\n\r\n\r\n", 21, &bytes, NULL);
+	WriteFile(outfile, "#########################################################################\r\n", 75, &bytes, NULL);
+	WriteFile(outfile, "# fail the test\r\n", 17, &bytes, NULL);
+	WriteFile(outfile, "scripterror:\r\n", 14, &bytes, NULL);
+	WriteFile(outfile, "print \"\\nScript aborted due to error:\\n\" . get_last_error($hndl) . \"\\n\";\r\n", 74, &bytes, NULL);
+	WriteFile(outfile, "$result = 0;\r\n\r\n\r\n", 18, &bytes, NULL);
+	WriteFile(outfile, "#########################################################################\r\n", 75, &bytes, NULL);
+	WriteFile(outfile, "# finish\r\n", 10, &bytes, NULL);
+	WriteFile(outfile, "endscript:\r\n", 12, &bytes, NULL);
+	WriteFile(outfile, "$hndl and disconnect_from_target($hndl) and print \"Disconnected OK\\n\";\r\n\r\n\r\n", 76, &bytes, NULL);
+	WriteFile(outfile, "#########################################################################\r\n", 75, &bytes, NULL);
+	WriteFile(outfile, "# return value (zero=fail, non-zero=success)\r\n", 46, &bytes, NULL);
+	WriteFile(outfile, "exit($result);\r\n", 16, &bytes, NULL);
+	WriteFile(outfile, "\r\n", 2, &bytes, NULL);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/src/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/stat2perl.dep	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,13 @@
+# Microsoft Developer Studio Generated Dependency File, included by stat2perl.mak
+
+.\src\CommandLine.cpp : \
+	".\inc\CommandLine.h"\
+	
+
+.\src\stat2perl.cpp : \
+	".\inc\CommandLine.h"\
+	
+
+.\src\StdAfx.cpp : \
+	".\inc\StdAfx.h"\
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/stat2perl.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,130 @@
+# Microsoft Developer Studio Project File - Name="stat2perl" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=stat2perl - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "stat2perl.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "stat2perl.mak" CFG="stat2perl - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "stat2perl - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "stat2perl - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "stat2perl"
+# PROP Scc_LocalPath "..\.."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "stat2perl - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu".\inc\stdafx.h" /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I ".\src" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\..\bin\STAT2Perl.exe"
+# Begin Special Build Tool
+ProjDir=.
+SOURCE="$(InputPath)"
+PostBuild_Desc=Performing Custom Build Step on stat2perl
+PostBuild_Cmds=$(ProjDir)\UpdateStat2Perl.bat
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "stat2perl - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu".\inc\stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I ".\src" /I ".\inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\bin\STAT2Perld.exe" /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "stat2perl - Win32 Release"
+# Name "stat2perl - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\CommandLine.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\stat2perl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\stat2perl.dep
+# End Source File
+# Begin Source File
+
+SOURCE=.\stat2perl.mak
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\CommandLine.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\StdAfx.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/stat2perl.mak	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,231 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on stat2perl.dsp
+!IF "$(CFG)" == ""
+CFG=stat2perl - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to stat2perl - Win32 Debug.
+!ENDIF 
+
+!IF "$(CFG)" != "stat2perl - Win32 Release" && "$(CFG)" != "stat2perl - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "stat2perl.mak" CFG="stat2perl - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "stat2perl - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "stat2perl - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+!ERROR An invalid configuration is specified.
+!ENDIF 
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "stat2perl - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "..\..\bin\STAT2Perl.exe" "$(OUTDIR)\stat2perl.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\CommandLine.obj"
+	-@erase "$(INTDIR)\CommandLine.sbr"
+	-@erase "$(INTDIR)\stat2perl.obj"
+	-@erase "$(INTDIR)\stat2perl.pch"
+	-@erase "$(INTDIR)\stat2perl.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(OUTDIR)\stat2perl.bsc"
+	-@erase "..\..\bin\STAT2Perl.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /ML /W3 /GX /O2 /I ".\src" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\stat2perl.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\stat2perl.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\CommandLine.sbr" \
+	"$(INTDIR)\stat2perl.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\stat2perl.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\STAT2Perl.pdb" /machine:I386 /out:"..\..\bin\STAT2Perl.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\CommandLine.obj" \
+	"$(INTDIR)\stat2perl.obj" \
+	"$(INTDIR)\StdAfx.obj"
+
+"..\..\bin\STAT2Perl.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+ProjDir=.
+SOURCE="$(InputPath)"
+PostBuild_Desc=Performing Custom Build Step on stat2perl
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+$(DS_POSTBUILD_DEP) : "..\..\bin\STAT2Perl.exe" "$(OUTDIR)\stat2perl.bsc"
+   .\UpdateStat2Perl.bat
+	echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ELSEIF  "$(CFG)" == "stat2perl - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "..\..\bin\STAT2Perld.exe" "$(OUTDIR)\stat2perl.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\CommandLine.obj"
+	-@erase "$(INTDIR)\CommandLine.sbr"
+	-@erase "$(INTDIR)\stat2perl.obj"
+	-@erase "$(INTDIR)\stat2perl.pch"
+	-@erase "$(INTDIR)\stat2perl.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(OUTDIR)\stat2perl.bsc"
+	-@erase "$(OUTDIR)\STAT2Perld.pdb"
+	-@erase "..\..\bin\STAT2Perld.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I ".\src" /I ".\inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\stat2perl.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\stat2perl.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\CommandLine.sbr" \
+	"$(INTDIR)\stat2perl.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\stat2perl.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\STAT2Perld.pdb" /debug /machine:I386 /out:"..\..\bin\STAT2Perld.exe" /pdbtype:sept 
+LINK32_OBJS= \
+	"$(INTDIR)\CommandLine.obj" \
+	"$(INTDIR)\stat2perl.obj" \
+	"$(INTDIR)\StdAfx.obj"
+
+"..\..\bin\STAT2Perld.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("stat2perl.dep")
+!INCLUDE "stat2perl.dep"
+!ELSE 
+!MESSAGE Warning: cannot find "stat2perl.dep"
+!ENDIF 
+!ENDIF 
+
+
+!IF "$(CFG)" == "stat2perl - Win32 Release" || "$(CFG)" == "stat2perl - Win32 Debug"
+SOURCE=.\src\CommandLine.cpp
+
+"$(INTDIR)\CommandLine.obj"	"$(INTDIR)\CommandLine.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\stat2perl.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\stat2perl.cpp
+
+"$(INTDIR)\stat2perl.obj"	"$(INTDIR)\stat2perl.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\stat2perl.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\StdAfx.cpp
+
+!IF  "$(CFG)" == "stat2perl - Win32 Release"
+
+CPP_SWITCHES=/nologo /ML /W3 /GX /O2 /I ".\src" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\stat2perl.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\stat2perl.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "stat2perl - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MLd /W3 /Gm /GX /Zi /Od /I ".\src" /I ".\inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\stat2perl.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\stat2perl.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+
+!ENDIF 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/stat2perl/updatestat2perl.bat	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,34 @@
+@rem
+@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@@rem
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+
+rem which accompanies this distribution, and is available
+
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+copy ..\..\bin\stat2perl.exe \epoc32\tools\stat\stat2perl.exe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/trgtest/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,48 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 1999-2000 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+PRJ_PLATFORMS
+
+TOOLS
+
+
+PRJ_MMPFILES
+
+#if defined(TOOLS)
+
+trgtest.mmp
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/trgtest/group/trgtest.mmp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+target			trgtest.exe
+targettype		exe
+
+systeminclude	\epoc32\include
+
+sourcepath		..\src
+source			trgtest.cpp
+
+VENDORID 0x70000001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/source/trgtest/src/trgtest.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1417 @@
+/*
+* Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* e32utils\trgtest\trgtesth.cpp
+*
+*/
+
+
+#include <e32err.h>
+#include <windows.h>
+#include <shlwapi.h>
+#include <stdio.h>
+#include <time.h>
+
+#pragma comment(lib, "shlwapi.lib")
+
+const TUint8 SOH=0x01;
+const TUint8 STX=0x02;
+const TUint8 EOT=0x04;
+const TUint8 ACK=0x06;
+const TUint8 NAK=0x15;
+const TUint8 CAN=0x18;
+const TUint8 SUB=0x1A;
+const TUint8 BIGC=0x43;
+const TUint8 BIGG=0x47;
+
+// Try 115200bps first since it is the most commonly supported baud rate.  Newer platforms like the
+// NaviEngine support 230400bps and above.
+const TUint KDefaultBaudRate = 115200;
+const TUint KBaudRateSearchList[] = {KDefaultBaudRate, 230400, 460800};
+
+#define READ_BUF_SIZE	32768
+#define WRITE_BUF_SIZE	32768
+#define MAX_LINE		32768
+#define PACKET_SIZE		1024
+
+#define MIN(a,b)		((a)<(b)?(a):(b))
+#define OFFSET(p,off)	((void*)((char*)p+off))
+
+#define RESET_COMM()	PurgeComm(Comm, PURGE_RXCLEAR|PURGE_TXCLEAR)
+
+const TInt	KExitCodeOK							= 0;		// no failure
+const TInt	KExitCodeUsage						= 1;		// command like usage
+const TInt	KExitCodeLog						= 2;		// can't open log file
+const TInt	KExitCodeImage						= 3;		// can't open image file
+const TInt	KExitCodeSerial						= 4;		// can't open serial port
+const TInt	KExitCodeDownload					= 5;		// download started, but failed
+const TInt	KExitCodeFaulted					= 6;		// entered debug monitor abnormally
+const TInt	KExitCodeHung						= 7;		// target hung
+const TInt	KExitCodeDOA						= 8;		// board was in debug monitor at start
+const TInt	KExitCodeUnsupportedBaudRate		= 9;		// the baud rate set by the -b parameter is not supported by the PC's COM port
+const TInt	KExitCodeAssert						= 99;		// trgtest assertion failed
+
+FILE* LogFile = NULL;
+HANDLE Comm = INVALID_HANDLE_VALUE;
+
+char ImgFileName[MAX_PATH] = "";
+TInt ImgFileSize = 0;
+char LineBuf[MAX_LINE+1];
+void* ImgFileChunkBase = NULL;
+TBool use_stdout = false;
+
+enum EDebugMonitorOptions
+{
+	kDebugDumpCodeSegs = 1
+};
+
+TUint DebugMonitorOptions = kDebugDumpCodeSegs;
+
+#define TT_ASSERT(x)	__ASSERT_ALWAYS(x, __Panic(__LINE__))
+
+const char* GetWinErrMsg(DWORD errorCode)
+	{
+	static char lastErrorBuffer[512]; // not thread safe or reentrant (but shouldn't need to be)
+	strcpy(lastErrorBuffer, "Unknown error");
+	
+	if(errorCode != ERROR_SUCCESS)
+		{
+		if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, 0, lastErrorBuffer, 512, NULL) != 0)
+			{
+			size_t size = strlen(lastErrorBuffer);
+			
+			// Strip any trailing carriage return.
+			if(StrCmpNI(lastErrorBuffer + size - 2, "\r\n", 2) == 0)
+				{
+				lastErrorBuffer[size - 2] = '\0';
+				size -= 2;
+				}
+
+			// Strip any trailing period.
+			if(lastErrorBuffer[size - 1] == '.')
+				{
+				lastErrorBuffer[size - 1] = '\0';
+				}
+			}
+		}
+	
+	return lastErrorBuffer;
+	}
+
+const char* GetSymOrWinErrMsg(TInt errorCode)
+	{
+	static char lastErrorBuffer[512]; // not thread safe or reentrant (but shouldn't need to be)
+	strcpy(lastErrorBuffer, "Unknown error");
+	
+	switch(errorCode)
+		{
+		case KErrNone:
+			{
+			// Unknown error
+			}
+		break;
+		case KErrEof:
+			{
+			strcpy(lastErrorBuffer, "Unexpected end of file");
+			}
+		break;
+		case KErrTimedOut:
+			{
+			strcpy(lastErrorBuffer, "Timed-out");
+			}
+		break;
+		default:
+			{
+			if(errorCode > 0)
+				{
+				strcpy(lastErrorBuffer, GetWinErrMsg(errorCode));
+				}
+			}
+		break;
+		}
+	
+	return lastErrorBuffer;
+	}
+
+void __Panic(TInt aLine)
+	{
+	fprintf(stderr, "Assertion failed at line %d\n", aLine);
+	exit(KExitCodeAssert);
+	}
+
+void WriteLog(const void* aBuf, TInt aLength)
+	{
+	if (LogFile)
+		fwrite(aBuf, 1, aLength, LogFile);
+	}
+
+void WriteLogS(const char* aString)
+	{
+	WriteLog( aString, strlen(aString) );
+	}
+
+void TraceLog(const char* aFmt, ...)
+	{
+	char buf[512];
+	va_list list;
+	va_start(list, aFmt);
+	if (!LogFile)
+		return;
+	sprintf(buf, "TRGTEST: ");
+	vsprintf(buf, aFmt, list);
+	strcat(buf, "\r\n");
+	WriteLogS(buf);
+	}
+
+/*
+YModem packet structure:
+Byte 0 = STX
+Byte 1 = sequence number (first user data packet is 1)
+Byte 2 = complement of sequence number
+Bytes 3-1026 = data (1K per packet)
+Bytes 1027, 1028 = 16-bit CRC (big-endian)
+
+A herald packet is sent first, with sequence number 0
+The data field consists of the null-terminated file name
+followed by the null-terminated file size in ASCII decimal
+digits.
+*/
+struct SPacket
+	{
+	TUint8 iPTI;
+	TUint8 iSeq;
+	TUint8 iSeqBar;
+	TUint8 iData[PACKET_SIZE];
+	TUint8 iCRC1;
+	TUint8 iCRC0;
+	};
+
+static const TUint16 crcTab[256] =
+    {
+	0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,0x8108,0x9129,0xa14a,
+	0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,
+	0x72f7,0x62d6,0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,0x2462,
+	0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,0xa56a,0xb54b,0x8528,0x9509,
+	0xe5ee,0xf5cf,0xc5ac,0xd58d,0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,
+	0x46b4,0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc,0x48c4,0x58e5,
+	0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,
+	0x9969,0xa90a,0xb92b,0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,
+	0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a,0x6ca6,0x7c87,0x4ce4,
+	0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,
+	0x8d68,0x9d49,0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,0xff9f,
+	0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78,0x9188,0x81a9,0xb1ca,0xa1eb,
+	0xd10c,0xc12d,0xf14e,0xe16f,0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,
+	0x6067,0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,0x02b1,0x1290,
+	0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256,0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,
+	0xe54f,0xd52c,0xc50d,0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405,
+	0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,0x26d3,0x36f2,0x0691,
+	0x16b0,0x6657,0x7676,0x4615,0x5634,0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,
+	0xb98a,0xa9ab,0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3,0xcb7d,
+	0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,0x4a75,0x5a54,0x6a37,0x7a16,
+	0x0af1,0x1ad0,0x2ab3,0x3a92,0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,
+	0x8dc9,0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1,0xef1f,0xff3e,
+	0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,
+	0x3eb2,0x0ed1,0x1ef0
+    };
+
+void UpdateCrc(const void* aPtr, TInt aLength, TUint16& aCrc)
+//
+// Perform a CCITT CRC checksum.
+//
+	{
+
+	register const TUint8* pB = (const TUint8*)aPtr;
+	register TUint16 crc=aCrc;
+    while (aLength--)
+		crc=TUint16((crc<<8)^crcTab[(crc>>8)^*pB++]);
+	aCrc=crc;
+	}
+
+void ClearCommError()
+	{
+	DWORD err;
+	COMSTAT s;
+	TT_ASSERT(ClearCommError(Comm,&err,&s));
+	}
+	
+void OpenCommPort(TInt aPort)
+	{
+	char buf[20];
+
+	sprintf(buf, "\\\\.\\COM%d", aPort); // COM ports with indexes higher than 9 can only be referenced by prefixing the device name with "\\.\\"
+	Comm = CreateFile(buf, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+	if (Comm == INVALID_HANDLE_VALUE)
+		{
+		if(GetLastError() == ERROR_ACCESS_DENIED)
+			{
+			fprintf(stderr, "Can't open COM%d: Error %d (Access denied) - a terminal application has probably been left running with the port still open\n", aPort, ERROR_ACCESS_DENIED);
+			}
+		else
+			{
+			fprintf(stderr, "Can't open COM%d: Error %d (%s)\n", aPort, GetLastError(), GetWinErrMsg(GetLastError()));
+			}
+		exit(KExitCodeSerial);
+		}
+
+	// Raise our thread priority to avoid being starved if builds are continuing in parallel while we are communicating with the target
+	// at high speeds.  TrgTest does not use serial flow control so if the buffers fill up, data will be lost.  We do not try to use the
+	// real-time process priority class because it requires administrator privileges.
+	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
+	}
+	
+TInt SetupCommPort(TInt aPort, TUint aBaudRate, TBool aIgnoreInvalidBaudRateError = false)
+	{
+	TInt r = KErrNone;
+	const char* errFuncName = NULL;
+
+	DCB dcb;
+
+	dcb.DCBlength = sizeof(dcb);
+	if(!GetCommState(Comm, &dcb))
+		{
+		r = GetLastError();
+		errFuncName = "GetCommState";
+		}
+	else if(!SetCommMask(Comm, EV_ERR|EV_RXCHAR))
+		{
+		r = GetLastError();
+		errFuncName = "SetCommMask";
+		}
+	else if(!SetupComm(Comm, READ_BUF_SIZE, WRITE_BUF_SIZE))
+		{
+		r = GetLastError();
+		errFuncName = "SetupComm";
+		}
+	if(r != KErrNone)
+		{
+		TT_ASSERT(errFuncName);
+		
+		fprintf(stderr, "Error in SetupComm: Error %d (%s) calling %s\n", r, GetWinErrMsg(r), errFuncName);
+		TraceLog("Error in SetupComm: Error %d (%s) calling %s", r, GetWinErrMsg(r), errFuncName);
+		fprintf(stderr, "Trying to proceed anyway, be suspicious of any problems!\n");
+		TraceLog("Trying to proceed anyway, be suspicious of any problems!");
+		}
+	ClearCommError();
+	r = KErrNone;
+
+	dcb.fAbortOnError = TRUE;
+	dcb.BaudRate=aBaudRate;
+	dcb.Parity=NOPARITY;
+	dcb.fParity = FALSE;
+	dcb.fErrorChar = FALSE;
+	dcb.ByteSize = 8;
+	dcb.StopBits=ONESTOPBIT;
+	dcb.fInX  = FALSE;
+	dcb.fOutX = FALSE;
+	dcb.XonChar = 0;
+	dcb.XoffChar = 0;
+	dcb.ErrorChar = 0;
+	dcb.fOutxDsrFlow = FALSE;
+	dcb.fOutxCtsFlow = FALSE;
+	dcb.fDsrSensitivity =  FALSE;
+	dcb.fRtsControl = RTS_CONTROL_DISABLE;
+	dcb.fDtrControl = DTR_CONTROL_DISABLE;
+	if(!SetCommState(Comm, &dcb))
+		{
+		if(GetLastError() == ERROR_INVALID_PARAMETER)
+			{
+			r = KExitCodeUnsupportedBaudRate;
+
+			if(aIgnoreInvalidBaudRateError)
+				{
+				return r;
+				}
+			else
+				{
+				fprintf(stderr, "Error in SetCommState : Error %d (%s) - a baud rate of %dbps is not supported by COM%d - try a different port\n", GetLastError(), GetWinErrMsg(GetLastError()), aBaudRate, aPort);
+				TraceLog("Error in SetCommState : Error %d (%s) - a baud rate of %dbps is not supported by COM%d - try a different port", GetLastError(), GetWinErrMsg(GetLastError()), aBaudRate, aPort);
+				}
+			}
+		else
+			{
+			fprintf(stderr, "Error in SetCommState : Error %d calling (%s) SetCommState\n", GetLastError(), GetWinErrMsg(GetLastError()), aBaudRate);
+			TraceLog("Error in SetCommState : Error %d (%s) SetCommState", GetLastError(), GetWinErrMsg(GetLastError()), aBaudRate);
+			r = KExitCodeSerial;
+			}
+
+		exit(r);
+		}
+	EscapeCommFunction(Comm, SETDTR);
+	EscapeCommFunction(Comm, SETRTS);
+	
+	return KErrNone;
+	}
+
+void SetupTimeout(TInt aInt, TInt aTot)
+	{
+	COMMTIMEOUTS ct;
+	GetCommTimeouts(Comm, &ct);
+	ct.ReadIntervalTimeout = aInt;		// ms
+	ct.ReadTotalTimeoutMultiplier = 0;
+	ct.ReadTotalTimeoutConstant = aTot;	// ms
+	ct.WriteTotalTimeoutConstant = 0;
+	ct.WriteTotalTimeoutMultiplier = 0;
+	SetCommTimeouts(Comm, &ct);
+	}
+
+TInt CommRead1(TInt aTimeout)
+	{
+	unsigned char c;
+	DWORD n=0;
+	BOOL ok;
+
+	SetupTimeout(0, aTimeout);
+	ok = ReadFile(Comm, &c, 1, &n, NULL);
+	if (!ok)
+		ClearCommError();
+	if (ok && n)
+		return c;
+	return KErrTimedOut;
+	}
+
+TInt CommRead(void* aBuf, TInt aMax, TInt aTimeout)
+	{
+	DWORD n=0;
+	BOOL ok;
+
+	SetupTimeout(100, aTimeout);
+	ok = ReadFile(Comm, aBuf, aMax, &n, NULL);
+	if (!ok)
+		ClearCommError();
+	if (n==0)
+		return KErrTimedOut;
+	return n;
+	}
+
+void CommWrite(const void* aBuf, TInt aLen)
+	{
+	DWORD n = 0;
+	BOOL ok = WriteFile(Comm, aBuf, aLen, &n, NULL);
+	if (!ok)
+		ClearCommError();
+	}
+
+void CommWriteC(TUint aChar)
+	{
+	unsigned char c = (unsigned char)aChar;
+	CommWrite(&c, 1);
+	}
+
+void CommWriteS(const char* aString)
+	{
+	CommWrite( aString, strlen(aString) );
+	}
+
+TInt PreparePacket(SPacket& pkt, TInt aSeq, TInt& aOutBytesUploaded)
+	{
+	TInt r = KErrNone;
+	TUint16 crc = 0;
+
+	pkt.iPTI = STX;
+	pkt.iSeq = (TUint8)(aSeq>=0 ? aSeq : 0);
+	pkt.iSeqBar = (TUint8)~pkt.iSeq;
+	if (aSeq>0)
+		{
+		TInt l;
+		aOutBytesUploaded = (aSeq-1)*PACKET_SIZE;	// file position of packet
+		if ( aOutBytesUploaded >= ImgFileSize )
+			return KErrEof;
+		l = MIN(PACKET_SIZE, ImgFileSize-aOutBytesUploaded);
+		memcpy(pkt.iData, OFFSET(ImgFileChunkBase,aOutBytesUploaded), l);
+		if (l<PACKET_SIZE)
+			memset(pkt.iData+l, 0, PACKET_SIZE-l);
+		aOutBytesUploaded = max( aOutBytesUploaded, 0L );
+		}
+	else
+		{
+		aOutBytesUploaded = 0;
+		memset(pkt.iData, 0, PACKET_SIZE);
+		if (aSeq==0)
+			{
+			const char* p = ImgFileName;
+			const char* q = p + strlen(p);
+			while (--q>=p && *q!='\\') {}
+			sprintf( (char*)pkt.iData, "%s%c%d", q+1, 0, ImgFileSize);
+			}
+		}
+	UpdateCrc(pkt.iData, PACKET_SIZE, crc);
+	pkt.iCRC1 = (TUint8)(crc>>8);
+	pkt.iCRC0 = (TUint8)crc;
+	return r;
+	}
+
+TInt SendPacket(TInt& aSeq, TBool aStream, clock_t startTime)
+	{
+	TBool ackPacket = aSeq == -1;
+	TInt c;
+	SPacket pkt;
+	TInt retries = 10;
+	TInt tmout = (aSeq>=0) ? 2000 : 500;
+	TInt bytesUploaded;
+	
+	// Prepare the next packet.
+	TInt r = PreparePacket(pkt, aSeq, bytesUploaded);
+		
+	if (r==KErrNone)
+		{
+		// Keep trying to send the packet until it is acknowledged.
+		for(;;)
+			{
+			RESET_COMM();
+			CommWrite(&pkt, sizeof(pkt));
+			if (aStream)
+				break;
+			c = CommRead1(tmout);
+			if (c==KErrTimedOut && aSeq<0)
+				{
+				return KErrNone;
+				}
+			if (c>=0)
+				{
+				if (c==ACK)
+					break;
+				}
+			if (--retries==0)
+				{
+				r = KErrTimedOut;
+				break;
+				}
+			}
+	
+		// Check to see if the send operation was successful.	
+		if (r == KErrNone || (r == KErrEof))
+			{
+			// Verify the stream type for the first packet.
+			if(aSeq==0)
+				{
+				c = CommRead1(100);
+				if (c==KErrTimedOut)
+					{
+					r = KErrNone;
+					}
+				else if (aStream && c!=BIGG)
+					r = KErrTimedOut;
+				else if (!aStream && c!=BIGC)
+					r = KErrTimedOut;
+				}
+			
+			if(r == KErrNone)
+				{
+				++aSeq;
+				}
+			}
+		}
+		
+	// Print the progress info.
+	if (((r == KErrNone) && ((aSeq & 7) == 0)) || (r != KErrNone) || ackPacket)
+		{
+		// Calculate total packet count.
+		TInt totalPacketCount = (ImgFileSize / PACKET_SIZE) + 2; // one extra packet for handshake and one extra packet for acknowledgement
+		TInt roundedImageFileSize = ImgFileSize;
+		TInt remainderSize = ImgFileSize % PACKET_SIZE;
+		if(remainderSize != 0)
+			{
+			totalPacketCount ++;
+			roundedImageFileSize += (PACKET_SIZE - remainderSize);
+			}
+		
+		// Calculate the percentage complete.
+		TInt percentComplete = (bytesUploaded * 100) / roundedImageFileSize;
+		
+		// Calculate the ETA.
+		clock_t elapsedTime = clock() - startTime;
+		clock_t etaM = -1L;
+		clock_t etaS = -1L;
+		if(aSeq > 0)
+			{
+			double bytesPerSec = double(bytesUploaded) / (double(elapsedTime) / double(CLOCKS_PER_SEC));
+			clock_t etaTotalS = clock_t((double(roundedImageFileSize) - double(bytesUploaded)) / bytesPerSec);
+			etaM = max(etaTotalS / 60, 0L);
+			etaS = max(etaTotalS % 60, 0L);
+			}
+
+		// Ensure upload always halts at 100%.
+		if(ackPacket)
+			{
+			aSeq = totalPacketCount;
+			bytesUploaded = roundedImageFileSize;
+			percentComplete = 100;
+			etaM = 0L;
+			etaS = 0L;
+			}
+
+		// Format uploaded bytes and ROM size.
+		char sizeBuffer[256];
+		StrFormatByteSize(bytesUploaded, sizeBuffer, sizeof(sizeBuffer));
+		char imageSizeBuffer[256];
+		StrFormatByteSize(roundedImageFileSize, imageSizeBuffer, sizeof(imageSizeBuffer));
+
+		// Update the currently uploaded bytes, percentage complete and ETA in-place.
+		// We add additional spacing to overwrite the previous line if the new line
+		// contracts because the byte sizes have switched to larger units.
+		if(ackPacket)
+			{
+			elapsedTime /= CLOCKS_PER_SEC;
+			clock_t elapsedM = max(elapsedTime / 60, 0L);
+			clock_t elapsedS = max(elapsedTime % 60, 0L);
+			printf("\r%05d Packets Sent: %s / %s (%02d %%), Time Taken: %02d:%02d      ", aSeq, sizeBuffer, imageSizeBuffer, percentComplete, elapsedM, elapsedS);
+			}
+		else if((r == KErrNone) || (r == KErrEof))
+			{
+			if(etaM >= 0L)
+				{
+				printf("\r%05d Packets Sent: %s / %s (%02d %%), ETA: %02d:%02d      ", aSeq, sizeBuffer, imageSizeBuffer, percentComplete, etaM, etaS);
+				}
+			else
+				{
+				printf("\r%05d Packets Sent: %s / %s (%02d %%), ETA: ??:??      ", aSeq, sizeBuffer, imageSizeBuffer, percentComplete);
+				}
+			}
+		else
+			{
+			fprintf(stderr, "\rFailed to send packet %d: %s / %s (%02d %%), Error: %d (%s)      ", ackPacket ? (totalPacketCount - 1) : aSeq, sizeBuffer, imageSizeBuffer, percentComplete, r, GetSymOrWinErrMsg(r));
+			}
+		}
+		
+	return r;
+	}
+
+TInt GetMonitorInfo();
+
+TInt Handshake(TBool& aOutStream, TBool aIgnoreHandshakeFailure = false)
+	{
+	TInt r = 0;
+	TInt r2 = 0;
+	TUint8 b2[256];
+
+	Sleep(2000); // wait 2 seconds
+	RESET_COMM();
+	Sleep(2000); // wait 2 seconds
+flush:
+	r = CommRead(b2, sizeof(b2), 60000);	// 60 second timeout
+	if(r==sizeof(b2))
+		{
+		printf("Flushing data from port\n");
+		TraceLog("Flushing data from port");
+		goto flush;
+		}
+
+	if (r<0)
+		{
+		TraceLog("ERROR Handshake 1: r=%d (%s)", r, GetSymOrWinErrMsg(r));
+		// Send CR to see if it elicits monitor prompt
+		CommWriteC(0x0d);
+		r2 = CommRead(LineBuf, 12, 1000);		// 1 second timeout
+		if (r2==12 && memcmp(LineBuf, "\xd\xaPassword: ", 12)==0)
+			{
+			printf("ERROR: target is in debug monitor\n");
+			TraceLog("ERROR: target is in debug monitor");
+			if (LogFile)
+				{
+				printf("Gathering information...\n");
+				TraceLog("Gathering information...");
+				r2 = GetMonitorInfo();
+				printf("Rebooting...\n");
+				TraceLog("Rebooting...");
+				CommWriteS("X\xd");
+				}
+			else
+				{
+				printf("No logfile - preserving state (not rebooting)\n");
+				TraceLog("No logfile - preserving state (not rebooting)");
+				}
+			return KExitCodeDOA;
+			}
+		return r;
+		}
+	if (b2[r-1]!=BIGG && b2[r-1]!=BIGC)
+		{
+		if(!aIgnoreHandshakeFailure)
+			{
+			TraceLog("ERROR Handshake 2: r=%d (%s)", KErrTimedOut, GetSymOrWinErrMsg(KErrTimedOut));
+			}
+		return KErrTimedOut;
+		}
+		
+	aOutStream = (b2[r-1]==BIGG);
+	
+	return KErrNone;
+	}
+	
+TInt SendImageFile(TUint aPort, TUint aBaudRate, TBool aStream)
+	{
+	printf("Sending ROM image %s on COM%d at %dbps\n",ImgFileName,aPort,aBaudRate);
+	TraceLog("Sending ROM image %s on COM%d at %dbps",ImgFileName,aPort,aBaudRate);
+
+	TInt r = KErrNone;
+
+	// Keep sending packets until we reach the end of the file or an error occurs.
+	TInt seq = 0;
+	clock_t startTime = clock();
+	while(r==KErrNone)
+		{
+		r = SendPacket(seq, aStream, startTime);
+		}
+	
+	// If we reached the end of the file, acknowledge that the transfer is complete.
+	if(r==KErrEof)
+		{
+		RESET_COMM();
+		CommWriteC(EOT);
+		TInt b1 = CommRead1(500);
+		if (b1==KErrTimedOut)
+			{
+			r = KErrNone;
+			}
+		else if (b1!=ACK)
+			{
+			r = KErrNone;
+			}
+		
+		if(r == KErrNone)
+			{
+			printf("\n");
+			}
+		else
+			{
+			// Wait for acknowledgement from the target.
+			TBool noAck = false;
+			b1 = CommRead1(1000);
+			if (b1==KErrTimedOut)
+				{
+				r = KErrNone;
+				noAck = true;
+				}
+			else if (aStream && b1!=BIGG)
+				{
+				r = KErrNone;
+				noAck = true;
+				}
+			else if (!aStream && b1!=BIGC)
+				{
+				r = KErrNone;
+				noAck = true;
+				}
+			
+			// If there was no acknowledgement from the target, ignore the problem at this point and print the newline.
+			if(noAck)
+				{
+				printf("\n");
+				}
+
+			// Else, send our acknowledgement packet to complete the transfer.
+			else
+				{
+				seq = -1;
+				TInt bytesUploaded = 0;
+				r = SendPacket(seq, aStream, bytesUploaded);
+				printf("\n");
+				if(r)
+					{
+					TraceLog("ERROR: SendImageFile r=%d (%s)", r, GetSymOrWinErrMsg(r));
+					}
+				}
+			}
+		}
+		
+	// Else, print any error.
+	else
+		{
+		printf("\n<SendPacket %d -> %d (%s)\n", seq, r, GetSymOrWinErrMsg(r));
+		TraceLog("ERROR: <SendPacket seq=%d r=%d (%s)", seq, r, GetSymOrWinErrMsg(r));
+		}
+
+	return r;
+	}
+
+void GetResponse()
+	{
+	TInt r;
+	do	{
+		r = CommRead(LineBuf, MAX_LINE, 1000);
+		if (r>=0)
+			if(use_stdout)
+				{
+				LineBuf[r]=0;
+				printf(LineBuf);
+				}
+			else
+				{
+				WriteLog(LineBuf, r);
+				}
+		} while (r>=0);
+	}
+
+void IssueCommandAndGetResponse(const char* aCmd)
+	{
+	CommWriteS(aCmd);
+	GetResponse();
+	}
+
+int token_length(const char* s)
+	{
+	const char* p = s;
+	for (; *p && !isspace(*p); ++p) {}
+	return p - s;
+	}
+
+const char* skip_space(const char* s)
+	{
+	for (; *s && isspace(*s); ++s) {}
+	return s;
+	}
+
+TInt GetMonitorInfo()
+/*
+ return 0 on success, -1 on failure
+ */
+	{
+	BOOL ok = FALSE;
+	int l;
+	int type;
+	RESET_COMM();
+	IssueCommandAndGetResponse("replacement\xd");
+	IssueCommandAndGetResponse("f\xd");
+	const char* p = LineBuf;
+	const char* q = LineBuf + strlen(LineBuf);
+	while (p<q)
+		{
+		p = skip_space(p);
+		if (p+16>q || memcmp(p, "Fault Category: ", 16))
+			{
+			p += token_length(p);
+			continue;
+			}
+		p = skip_space(p+16);
+		l = token_length(p);
+		if (l!=4 || memcmp(p, "KERN", 4))
+			{
+			p += l;
+			continue;
+			}
+		p = skip_space(p+4);
+		if (p+14>q || memcmp(p, "Fault Reason: ", 14))
+			{
+			p += token_length(p);
+			continue;
+			}
+		p = skip_space(p+14);
+		if (p+8<=q && memcmp(p, "00000050", 8)==0)
+			{
+			ok = true;
+			break;
+			}
+		p+=8;
+		continue;
+		}
+	if (ok)
+		{
+		// Add a line after the "." debug monitor prompt so the next log line won't appear next to it.
+		TraceLog("");
+		
+		return 0;
+		}
+
+	IssueCommandAndGetResponse("i\xd");
+	for (type=0; type<14; ++type)
+		{
+		char b[8];
+		sprintf(b, "c%x\xd", type);
+		IssueCommandAndGetResponse(b);
+		}
+
+	IssueCommandAndGetResponse("S\xd");
+	
+	// Optionally, dump the code segs to make it clear where non-XIP code is loaded
+	// and make debugging easier.
+	if(DebugMonitorOptions & kDebugDumpCodeSegs)
+		{
+		IssueCommandAndGetResponse("p all\xd");
+		}
+		
+	// Add a line after the "." debug monitor prompt so the next log line won't appear next to it.
+	TraceLog("");
+
+	return -1;
+	}
+	
+TInt ReceiveTestLog(TInt aOverallTimeOutS)
+	{
+	TInt r=0;
+	TInt r2;
+	clock_t iterationStartTime = clock();
+	
+	for(;;)
+		{
+		TBool checkDebugMonitor = false;
+		
+		r = CommRead(LineBuf, MAX_LINE, aOverallTimeOutS * 1000);
+		
+		// If a time-out occured, print an error message.
+		if (r==KErrTimedOut)
+			{
+			clock_t elapsedTimeC = clock() - iterationStartTime;
+			double elapsedTimeS = double(elapsedTimeC) / double(CLOCKS_PER_SEC);
+
+			if(elapsedTimeS < 10.0)
+				{
+				if(!use_stdout)
+					{
+					fprintf(stderr, "Nothing received for past %.02f seconds\n", elapsedTimeS);
+					}
+				TraceLog("Nothing received for past %.02f seconds", elapsedTimeS);
+				}
+			else
+				{
+				elapsedTimeC /= CLOCKS_PER_SEC;
+				clock_t elapsedM = max(elapsedTimeC / 60, 0L);
+				clock_t elapsedS = max(elapsedTimeC % 60, 0L);
+
+				if(!use_stdout)
+					{
+					fprintf(stderr, "Nothing received for past %02d:%02d minutes\n", elapsedM, elapsedS);
+					}
+				TraceLog("Nothing received for past %02d:%02d minutes", elapsedM, elapsedS);
+				}
+
+			checkDebugMonitor = true;
+			}
+			
+		// If the string "Password: " was read, this probably indicates the kernel
+		// has jumped into the debug monitor.
+		if (r>=10 && memcmp(LineBuf+r-10, "Password: ", 10)==0)
+			{
+			checkDebugMonitor = true;
+			}
+			
+		// If real data was received, print it to the selected output.
+		if (r>0)
+			{
+			if (use_stdout)
+				{
+				LineBuf[r]=0;		// terminate string
+				printf(LineBuf);
+				}
+			else
+				{
+				WriteLog(LineBuf, r);
+				}
+
+			iterationStartTime = clock();
+			}
+		
+		// If an error occured, check to see if the debug monitor is running.  If it is,
+		// we can extract information about the fault and use it to reboot the board.
+		if (checkDebugMonitor || (r==KErrTimedOut))
+			{
+			// Send CR to see if it elicits monitor prompt.
+			CommWriteC(0x0d);
+			r2 = CommRead(LineBuf, 12, 1000);
+			if (r2>0)
+				{
+				if(use_stdout)
+					{
+					LineBuf[r2]=0;
+					printf(LineBuf);
+					}
+				else
+					{
+					WriteLog(LineBuf, r2);
+					}
+				}
+			if (r2==12 && memcmp(LineBuf, "\xd\xaPassword: ", 12)==0)
+				{
+				break;
+				}
+			}
+			
+		// If an error occured and the debug monitor is not running, stop trying to receive the session log.
+		if (r<0)
+			{
+			break;
+			}
+		}
+
+	// Check to see if the debug monitor was successfully prompted.
+	TT_ASSERT((r>0) || (r==KErrTimedOut));
+	if (r>0)
+		{
+		// The debug monitor is accessible so extract debugging information.
+		r = GetMonitorInfo();
+		
+		// Issue the command to try to reboot the board.
+		CommWriteS("X\xd");
+		if (r)
+			{
+			r = KExitCodeFaulted;
+			}
+		else
+			{
+			r = KErrNone;
+			}
+		}
+	else if(r<0)
+		{
+		// The board debug monitor is not accessible or the board has locked up.
+		printf("Target hung\n");
+		TraceLog("Target hung");
+		r = KExitCodeHung;
+		}
+		
+	return r;	
+	}
+
+TInt DetermineBaudRate(TInt aPort, TUint& outBaudRate, TBool& aOutStream)
+	{
+	TInt r = KErrNone;
+	
+	for( TUint i = 0; i < sizeof(KBaudRateSearchList) / sizeof(TUint); i ++ )
+		{
+		// Set the COM port to use the next baud rate to try.
+		if(i != 0)	// hide the first test so that the UI for boards supporting 115200bps-only remains the same as it
+			{		// was before.
+			printf("Testing COM%d at %dbps...", aPort, KBaudRateSearchList[i]);
+			}
+		TraceLog("Testing COM%d at %dbps", aPort, KBaudRateSearchList[i]);
+		r = SetupCommPort(aPort, KBaudRateSearchList[i], true);
+
+		if(r == KErrNone)
+			{
+			// Try to Y-modem handshake with the board.  If we succeed then we have found the correct speed.
+			r = Handshake(aOutStream, true);
+			if(r == KErrNone)
+				{
+				if(i != 0)
+					{
+					// If we finished the first test (115200bps) successfully, we do not reveal the fact that we are
+					// prepared to test multiple baud rates so that the UI for boards supporting 115200bps only remains
+					// the same as it was before.
+					printf(" Succeeded\n", aPort, KBaudRateSearchList[i]);
+					}
+				TraceLog("Testing of COM%d at %dbps Succeeded", aPort, KBaudRateSearchList[i]);
+				outBaudRate = KBaudRateSearchList[i];
+				
+				break;
+				}
+			else if(r == KExitCodeDOA)
+				{
+				// The board is stuck in the crash debugger and is unusable.
+				break;
+				}
+			else
+				{
+				if(i == 0)
+					{
+					// If we finished the first test (115200bps) unsuccessfully, at this point we reveal that we are
+					// testing multiple baud rates and report the results of the failure.
+					printf("Testing COM%d at %dbps...", aPort, KBaudRateSearchList[i]);
+					}
+				printf(" Failed (%d) %s\n", r, GetSymOrWinErrMsg(r));
+				TraceLog("Testing of COM%d at %dbps Failed (%d) %s", aPort, KBaudRateSearchList[i], r, GetSymOrWinErrMsg(r));
+				}
+			}
+		else if(r == KExitCodeUnsupportedBaudRate)
+			{
+			if(i == 0)
+				{
+				// If we finished the first test (115200bps) and the baud rate setting is unsupported, at this point
+				// we reveal that we are testing multiple baud rates and report the results of the failure.
+				printf("Testing COM%d at %dbps...", aPort, KBaudRateSearchList[i]);
+				}
+			printf(" COM%d port doesn't support this baud rate setting\n", aPort);
+			TraceLog("COM%d port doesn't support %dbps setting", aPort, KBaudRateSearchList[i]);
+			}
+		}
+		
+	return r;
+	}
+
+void UploadROM(TInt aPort, TUint& aInOutBaudRate)
+	{
+	// Open the ROM image file and copy it into memory.
+	FILE* img = fopen(ImgFileName, "rb");
+	if (!img)
+		{
+		fprintf(stderr, "Can't open %s for read (%d) %s\n", ImgFileName, errno, strerror(errno));
+		exit(KExitCodeImage);
+		}
+	fseek(img,0,SEEK_END);
+	ImgFileSize=ftell(img);
+	fseek(img,0,SEEK_SET);
+	TraceLog("ROM Image File Size   = %d bytes\n", ImgFileSize);
+	ImgFileChunkBase = malloc(ImgFileSize);
+	TT_ASSERT(ImgFileChunkBase != NULL);
+	int n = fread(ImgFileChunkBase, 1, ImgFileSize, img);
+	TT_ASSERT(n == ImgFileSize);
+	fclose(img);
+
+	// Check to see if we should flash the ROM image or the boot loader based
+	// on the filename of the tool.
+	if (strcmpi("flashimg", __argv[0])==0)
+		{
+		printf("Uploading image %s to flash ", ImgFileName);
+		if (strstr(ImgFileName, ".zip") || strstr(ImgFileName, ".zip"))
+			strcpy(ImgFileName, "flashimg.zip");
+		else
+			strcpy(ImgFileName, "flashimg.bin");
+		printf("[%s]\n", ImgFileName);
+		}
+	else if (strcmpi("flashldr", __argv[0])==0)
+		{
+		printf("Uploading image %s to flash as bootloader ", ImgFileName);
+		if (strstr(ImgFileName, ".zip") || strstr(ImgFileName, ".zip"))
+			strcpy(ImgFileName, "flashldr.zip");
+		else
+			strcpy(ImgFileName, "flashldr.bin");
+		printf("[%s]\n", ImgFileName);
+		}
+
+	// Open the COM port.
+	OpenCommPort(aPort);
+	
+	// Check to see if we should try to automatically determine the baud rate.
+	TInt r;
+	TBool stream = true;
+	if(aInOutBaudRate == 0)
+		{
+		r = DetermineBaudRate(aPort, aInOutBaudRate, stream);
+		if(r != KErrNone)
+			{
+			if(r != KExitCodeDOA) // DetermineBaudRate prints its own error message for KExitCodeDOA
+				{
+				fprintf(stderr, "Unable to determine baud rate or the target is hung/unplugged\n");
+				TraceLog("Unable to determine baud rate or the target is hung/unplugged");
+				}
+			exit(r);
+			}
+		}
+	else
+		{
+		r = SetupCommPort(aPort, aInOutBaudRate);
+		if(r == KErrNone)
+			{
+			r = Handshake(stream);
+			}
+		if(r != KErrNone)
+			{
+			fprintf(stderr, "Unable to connect to target on COM%d at %dbps (%d) %s\n", aPort, aInOutBaudRate, r, GetSymOrWinErrMsg(r));
+			TraceLog("Unable to connect to target on COM%d at %dbps (%d) %s", aPort, aInOutBaudRate, r, GetSymOrWinErrMsg(r));
+			exit(r);
+			}
+		}
+
+	// Send the image.
+	r = SendImageFile(aPort, aInOutBaudRate, stream);
+	
+	free(ImgFileChunkBase);
+	}
+	
+TInt LogTargetOutput(const char* aLogFileName, TBool aUseStdOut, TInt aPort, TUint& aInOutBaudRate, TUint& aInOutLogBaudRate, TInt aOverallTimeOutS)
+	{
+	TInt r;
+	
+	// Switch to the session log baud rate (default 115200bps) - higher speeds are usually only used for serial
+	// upload and not for the log download.  It is possible to utilise higher log baud rates by manually modifying
+	// the debugport code in the board support package.
+	if(aInOutBaudRate != aInOutLogBaudRate)
+		{
+		r = SetupCommPort(aPort, aInOutLogBaudRate);
+
+		if(r != KErrNone)
+			{
+			fprintf(stderr, "Unable to switch to session log baud rate (%dbps) or the target is hung/unplugged\n", aInOutLogBaudRate);
+			TraceLog("Unable to switch to session log baud rate (%dbps) or the target is hung/unplugged", aInOutLogBaudRate);
+			exit(r);
+			}
+		
+		aInOutBaudRate = aInOutLogBaudRate;
+		}
+
+	// Check to see if we are logging to STDOUT or to a file.
+	if(!aUseStdOut)
+		{
+		printf("Logging target output from COM%d at %dbps to %s...\n", aPort, aInOutLogBaudRate, aLogFileName);
+		TraceLog("BEGIN TARGET LOG", aLogFileName);
+		}
+	
+	// Receive the session log.
+	clock_t startTime = clock();
+	r = ReceiveTestLog(aOverallTimeOutS);
+	
+	// Print the duration of the session.
+	clock_t elapsedTimeC = clock() - startTime;
+	double elapsedTimeS = double(elapsedTimeC) / double(CLOCKS_PER_SEC);
+	if(elapsedTimeS < 10.0)
+		{
+		if(!use_stdout)
+			{
+			printf("Target output log ended after %.02f seconds\n", elapsedTimeS);
+			}
+		TraceLog("END TARGET LOG after %.02f seconds", elapsedTimeS);
+		}
+	else
+		{
+		elapsedTimeC /= CLOCKS_PER_SEC;
+		clock_t elapsedM = max(elapsedTimeC / 60, 0L);
+		clock_t elapsedS = max(elapsedTimeC % 60, 0L);
+
+		if(!use_stdout)
+			{
+			printf("Target output log ended after %02d:%02d minutes\n", elapsedM, elapsedS);
+			}
+		TraceLog("END TARGET LOG after %02d:%02d minutes", elapsedM, elapsedS);
+		}
+	
+	return r;
+	}
+	
+void CloseSession()
+	{
+	// Perform cleanup...
+	
+	WriteLogS("\n\n");
+	TraceLog("DONE");
+
+	EscapeCommFunction(Comm, CLRRTS);
+	EscapeCommFunction(Comm, CLRDTR);
+
+	if(Comm != INVALID_HANDLE_VALUE)
+		{
+		CloseHandle(Comm);
+		Comm = INVALID_HANDLE_VALUE;
+		}
+
+	if (LogFile)
+		{
+		fclose(LogFile);
+		LogFile = NULL;
+		}
+	}
+
+void PrintHelp()
+	{
+	fprintf(stderr, "\n");
+	fprintf(stderr, "TrgTest Serial Y-Modem Upload Test Utility\n");
+	fprintf(stderr, "==========================================\n\n");
+	fprintf(stderr, "trgtest port# [-b<baudrate> default: 0 (auto)] [-lb<baudrate> default: 115200]");
+	fprintf(stderr, "        imagefilename [logfilename] [timeout]\n\n");
+	fprintf(stderr, "  port#              = COM port e.g., \"1\"\n");
+	fprintf(stderr, "  -b (optional)      = ROM image serial upload baud rate e.g., \"-b115200\"\n");
+	fprintf(stderr, "  -lb (opt.)         = session log download baud rate e.g., \"-lb115200\"\n");
+	fprintf(stderr, "  imagefilename      = path to ROM image e.g., \"rom.img\" or \"nul\" for no image\n");
+	fprintf(stderr, "  logfilename (opt.) = path to session log e.g., \"test.log\" or \"-\" for STDOUT\n");
+	fprintf(stderr, "  timeout (opt.)     = timeout after inactivity in seconds e.g., \"1800\"\n\n");
+	fprintf(stderr, "Example Usage:\n\n");
+	fprintf(stderr, "  trgtest 1 rom.img log.txt\n");
+	}
+
+
+int main(int argc, char** argv)
+	{
+	TInt r = KErrNone;
+	TInt port = 0;
+	TUint baudRate = 0;
+	TUint logBaudRate = 0;
+	TInt overallTimeOutS = 1800;  // default time to wait for output (in seconds)
+	const char* logfilename = NULL;
+	int paramIndex = 1;
+	
+	// Disable stream buffering.
+	setvbuf(stdout,NULL,_IONBF,0);
+	
+	// Print help if the parameter count is incorrect.
+	if (argc<3 || argc>7)
+		{
+		PrintHelp();
+		exit(KExitCodeUsage);
+		}
+		
+	// Get the COM port.
+	if(isdigit(argv[paramIndex][0]))
+		{
+		port = atoi(argv[paramIndex]);
+		if(port == 0)
+			{
+			fprintf(stderr, "\"0\" is not valid - specify a serial COM port index number >= 1");
+			exit(KExitCodeUsage);
+			}
+		paramIndex ++;
+		}
+	else
+		{
+		fprintf(stderr, "\"%s\" is not valid - specify a serial COM port index number >= 1", argv[paramIndex]);
+		exit(KExitCodeUsage);
+		}
+	
+	// Parse the optional parameters - order is not important.	
+	while(paramIndex < argc)
+		{
+		// Get the serial upload baud rate.
+		if(StrCmpNI(argv[paramIndex], "-b", 2) == 0)
+			{
+			baudRate = atoi(argv[paramIndex] + 2);
+			paramIndex ++;
+			}
+			
+		// Get the session log baud rate.
+		else if(StrCmpNI(argv[paramIndex], "-lb", 3) == 0)
+			{
+			logBaudRate = atoi(argv[paramIndex] + 3);
+			paramIndex ++;
+			}
+		
+		// Stop if we parse an unknown option - it is probably the ROM image file path.	
+		else
+			{
+			break;
+			}
+		}
+		
+	// If no session log baud rate was specified, set the default rate of 115200bps.
+	if(logBaudRate == 0)
+		{
+		logBaudRate = KDefaultBaudRate;
+		}
+		
+	// Get the ROM image file path.
+	if(paramIndex >= argc)
+		{
+		fprintf(stderr, "No ROM image file specified\n");
+		exit(KExitCodeUsage);
+		}
+	strcpy(ImgFileName, argv[paramIndex]);
+	paramIndex ++;
+
+	// Get the session log options.
+	if (paramIndex < argc)
+		{
+		// Check to see if TrgTest should log the target output and to what.
+		logfilename = argv[paramIndex];
+		if (!strcmp(logfilename, "-"))
+			{
+			printf("After the upload has completed, TrgTest will read from the serial port and write to STDOUT.\n");
+			use_stdout = true;
+			}
+		else
+			{
+			LogFile = fopen(logfilename, "wb");
+			
+			if (!LogFile)
+				{
+				fprintf(stderr, "Can't open %s for write (%d) %s\n", logfilename, errno, strerror(errno));
+				exit(KExitCodeLog);
+				}
+			
+			// Disable stream buffering.
+			setvbuf(LogFile,NULL,_IONBF,0);
+			}
+		paramIndex ++;
+
+		// Check to see if a non-default inactivity timeout has been specified.
+		if (paramIndex < argc)
+			{
+			overallTimeOutS = atoi(argv[paramIndex]);
+			}
+		}
+
+	TBool sendImage = strcmpi(ImgFileName, "nul") != 0;
+
+	// Log the trgtest parameters.
+	TraceLog("Port                  = COM%d", port);
+	if(sendImage)
+		{
+		if(baudRate == 0)
+			{
+			TraceLog("Baud Rate             = Auto");
+			}
+		else
+			{
+			TraceLog("Baud Rate             = %dbps", baudRate);
+			}
+		TraceLog("ROM Image             = %s", ImgFileName);
+		}
+	else
+		{
+		TraceLog("ROM Image             = None");
+		}
+	TraceLog("Log Baud Rate         = %dbps", logBaudRate);
+	if(use_stdout)
+		{
+		TraceLog("Log                   = STDOUT");
+		}
+	else if(logfilename)
+		{
+		TraceLog("Log                   = %s", logfilename);
+		}
+	else
+		{
+		TraceLog("Log                   = None", logfilename);
+		}
+	TraceLog("Inactivity Timeout    = %d secs.", overallTimeOutS);
+	if(DebugMonitorOptions & kDebugDumpCodeSegs)
+		{
+		TraceLog("Debug Monitor Options = Dump Code Segs");
+		}
+	else
+		{
+		TraceLog("Debug Monitor Options = None");
+		}
+
+	// Initiate serial upload if a ROM image was specified.
+	if(sendImage)
+		{
+		UploadROM(port, baudRate);
+		}
+
+	if(r==KErrNone)
+		{
+		// Check to see if the ROM upload (if any) succeeded.
+		if(sendImage)
+			{
+			printf("Sent image file OK\n");
+			TraceLog("Sent image file OK");
+			}
+		
+		// Check to see if we should log the target output.
+		if (LogFile || use_stdout)
+			{
+			// If no serial upload was performed the COM port is not yet open.
+			if(!sendImage)
+				{
+				// Open the COM port.
+				OpenCommPort(port);
+				}
+
+			// Log the target output if a log file was specified.
+			r = LogTargetOutput(logfilename, use_stdout, port, baudRate, logBaudRate, overallTimeOutS);
+			}
+		}
+	else
+		{
+		printf("SendImageFile upload failed -> (%d) %s\n", r, GetSymOrWinErrMsg(r));
+		TraceLog("SendImageFile upload failed -> (%d) %s", r, GetSymOrWinErrMsg(r));
+		r = KExitCodeDownload;
+		}
+
+	// Close the session
+	CloseSession();
+
+	// Print any exit error. 
+	if (r!=KErrNone)
+		{
+		fprintf(stderr, "Exiting with error %d\n", r);
+		}
+
+	return r;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/include.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#include "stdafx.h"
+
+#include "D://development//test_harness//automation//stat//3.0//desktop//cstatlogfile.cpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/resource.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by testcom.rc
+//
+#define IDD_TESTCOM_DIALOG              102
+#define IDR_MAINFRAME                   128
+#define IDC_OUT                         1000
+#define IDC_IN                          1001
+#define IDC_TRANSFER                    1002
+#define IDC_LIST1                       1003
+#define IDC_LIST2                       1004
+#define IDC_BUTTON1                     1005
+#define IDC_TRANSPORT                   1006
+#define IDC_PORT                        1007
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        130
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1008
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.cpp : source file that includes just the standard includes
+//	testcom.pch will be the pre-compiled header
+//	stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__F5EDDB5A_81F0_11D6_BC69_00B0D065107F__INCLUDED_)
+#define AFX_STDAFX_H__F5EDDB5A_81F0_11D6_BC69_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>			// MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__F5EDDB5A_81F0_11D6_BC69_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// testcom.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "testcom.h"
+#include "testcomDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CTestcomApp
+
+BEGIN_MESSAGE_MAP(CTestcomApp, CWinApp)
+	//{{AFX_MSG_MAP(CTestcomApp)
+	//}}AFX_MSG
+	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CTestcomApp construction
+
+CTestcomApp::CTestcomApp()
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CTestcomApp object
+
+CTestcomApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CTestcomApp initialization
+
+BOOL CTestcomApp::InitInstance()
+{
+	// Standard initialization
+
+	CTestcomDlg dlg;
+	m_pMainWnd = &dlg;
+	int nResponse = dlg.DoModal();
+	if (nResponse == IDOK)
+	{
+	}
+	else if (nResponse == IDCANCEL)
+	{
+	}
+
+	// Since the dialog has been closed, return FALSE so that we exit the
+	//  application, rather than start the application's message pump.
+	return FALSE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,192 @@
+# Microsoft Developer Studio Project File - Name="testcom" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testcom - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "testcom.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "testcom.mak" CFG="testcom - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "testcom - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testcom - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "testcom"
+# PROP Scc_LocalPath ".."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "testcom - Win32 Release"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\inc" /I ".\src" /I "..\..\..\source\dll\transport\inc" /I "..\..\..\source\dll\inc" /I "..\..\..\source\regaccess\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 Ws2_32.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF  "$(CFG)" == "testcom - Win32 Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\inc" /I ".\src" /I "..\..\..\source\dll\transport\inc" /I "..\..\..\source\dll\inc" /I "..\..\..\source\regaccess\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Ws2_32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "testcom - Win32 Release"
+# Name "testcom - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\src\STATComms.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\src\statserial.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\src\statserialbluetooth.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\src\statsocket_block.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\testcom.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\testcom.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\testcomDlg.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\inc\cstatreturncodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\inc\stat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\inc\statcommon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\statcomms.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\statserial.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\statserialbluetooth.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\statsocket_block.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\stattransport.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\testcom.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\testcomDlg.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\testcom.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\testcom.rc2
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// testcom.h : main header file for the TESTCOM application
+//
+
+#if !defined(AFX_TESTCOM_H__F5EDDB56_81F0_11D6_BC69_00B0D065107F__INCLUDED_)
+#define AFX_TESTCOM_H__F5EDDB56_81F0_11D6_BC69_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+	#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h"		// main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CTestcomApp:
+// See testcom.cpp for the implementation of this class
+//
+
+class CTestcomApp : public CWinApp
+{
+public:
+	CTestcomApp();
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CTestcomApp)
+	public:
+	virtual BOOL InitInstance();
+	//}}AFX_VIRTUAL
+
+// Implementation
+
+	//{{AFX_MSG(CTestcomApp)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_TESTCOM_H__F5EDDB56_81F0_11D6_BC69_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcom.rc	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,217 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_TESTCOM_DIALOG DIALOGEX 0, 0, 265, 151
+STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
+    WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "STAT Device Communications Test"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "Listen / Stop",IDC_TRANSFER,150,129,50,14
+    PUSHBUTTON      "Close",IDOK,208,129,50,14
+    LISTBOX         IDC_LIST1,7,36,251,87,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_TRANSPORT,7,131,78,90,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    EDITTEXT        IDC_PORT,94,129,47,14,ES_AUTOHSCROLL
+    LTEXT           "This dialog is used to test a STAT connection to the device.  Whatever is sent down will be bounced straight back, with the exception of <S> and <R> which read and send the files C:\\basicscreen.mbm and C:\\basicapp.exe respectively.",
+                    IDC_STATIC,7,7,251,27
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0"
+        BEGIN
+            VALUE "CompanyName", "\0"
+            VALUE "FileDescription", "testcom MFC Application\0"
+            VALUE "FileVersion", "1, 0, 0, 1\0"
+            VALUE "InternalName", "testcom\0"
+            VALUE "LegalCopyright", "Copyright (C) 2002\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "testcom.EXE\0"
+            VALUE "ProductName", "testcom Application\0"
+            VALUE "ProductVersion", "1, 0, 0, 1\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_TESTCOM_DIALOG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 258
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 143
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_TESTCOM_DIALOG DLGINIT
+BEGIN
+    IDC_TRANSPORT, 0x403, 16, 0
+0x7953, 0x626d, 0x6169, 0x436e, 0x6e6f, 0x656e, 0x7463, 0x0020, 
+    IDC_TRANSPORT, 0x403, 14, 0
+0x7953, 0x626d, 0x6169, 0x536e, 0x636f, 0x656b, 0x0074, 
+    IDC_TRANSPORT, 0x403, 14, 0
+0x7953, 0x626d, 0x6169, 0x536e, 0x7265, 0x6169, 0x006c, 
+    IDC_TRANSPORT, 0x403, 16, 0
+0x7953, 0x626d, 0x6169, 0x496e, 0x666e, 0x6172, 0x6572, 0x0064, 
+    IDC_TRANSPORT, 0x403, 17, 0
+0x7953, 0x626d, 0x6169, 0x426e, 0x756c, 0x7465, 0x6f6f, 0x6874, "\000" 
+    IDC_TRANSPORT, 0x403, 11, 0
+0x7953, 0x626d, 0x6169, 0x556e, 0x4253, "\000" 
+    0
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif //_WIN32\r\n"
+    "#include ""res\\testcom.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME           ICON    DISCARDABLE     "res\\testcom.ico"
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "res/testcom.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcomdlg.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,361 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// testcomDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "testcom.h"
+#include "testcomDlg.h"
+#include <statcommon.h>
+#include <statcomms.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+DWORD WINAPI ThreadProcOut(LPVOID lpParameter);
+void ProcessInput(STATComms *pComms, CTestcomDlg *pDlg);
+
+bool bFinished = true;
+bool bReset = true;
+char szBitmapFile[] = "C:\\basicscreen.mbm";
+char szReceiveFile[] = "C:\\basicapp.exe";
+
+/////////////////////////////////////////////////////////////////////////////
+// CTestcomDlg dialog
+
+CTestcomDlg::CTestcomDlg(CWnd* pParent /*=NULL*/)
+	: CDialog(CTestcomDlg::IDD, pParent)
+{
+	//{{AFX_DATA_INIT(CTestcomDlg)
+		// NOTE: the ClassWizard will add member initialization here
+	//}}AFX_DATA_INIT
+	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+}
+
+CTestcomDlg::~CTestcomDlg()
+{
+  	if (hThread2Out)
+  		CloseHandle(hThread2Out);
+}
+
+void CTestcomDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CTestcomDlg)
+	DDX_Control(pDX, IDC_PORT, m_Port);
+	DDX_Control(pDX, IDC_TRANSPORT, m_Transport);
+	DDX_Control(pDX, IDC_LIST1, m_List1);
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CTestcomDlg, CDialog)
+	//{{AFX_MSG_MAP(CTestcomDlg)
+	ON_WM_PAINT()
+	ON_WM_QUERYDRAGICON()
+	ON_BN_CLICKED(IDC_TRANSFER, OnTransfer)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CTestcomDlg message handlers
+
+BOOL CTestcomDlg::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	SetIcon(m_hIcon, TRUE);			// Set big icon
+	SetIcon(m_hIcon, FALSE);		// Set small icon
+	
+	// defaults
+	m_Transport.SetCurSel(1);
+	m_Port.SetWindowText("3000");
+	m_Port.SetLimitText(25);
+
+	return TRUE;  // return TRUE  unless you set the focus to a control
+}
+
+// If you add a minimize button to your dialog, you will need the code below
+//  to draw the icon.  For MFC applications using the document/view model,
+//  this is automatically done for you by the framework.
+
+void CTestcomDlg::OnPaint() 
+{
+	if (IsIconic())
+	{
+		CPaintDC dc(this); // device context for painting
+
+		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+		// Center icon in client rectangle
+		int cxIcon = GetSystemMetrics(SM_CXICON);
+		int cyIcon = GetSystemMetrics(SM_CYICON);
+		CRect rect;
+		GetClientRect(&rect);
+		int x = (rect.Width() - cxIcon + 1) / 2;
+		int y = (rect.Height() - cyIcon + 1) / 2;
+
+		// Draw the icon
+		dc.DrawIcon(x, y, m_hIcon);
+	}
+	else
+	{
+		CDialog::OnPaint();
+	}
+}
+
+HCURSOR CTestcomDlg::OnQueryDragIcon()
+{
+	return (HCURSOR) m_hIcon;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Start it all
+///////////////////////////////////////////////////////////////////////////////////
+void CTestcomDlg::OnTransfer() 
+{
+	if (bFinished)
+	{
+		bReset = true;
+		DWORD dwThreadID2Out;
+		if (!(hThread2Out = CreateThread( NULL,				// security attributes
+												0,				// stack size
+												ThreadProcOut,		// proc to call
+												this,			// proc parameter
+												0,				// creation flags
+												&dwThreadID2Out)))	// thread identifier
+		{
+			AfxMessageBox("Could not create listening thread");
+		}
+	}
+	else
+	{
+		bFinished = true;	// signal thread to stop
+		AddString("Stopping...");
+		Sleep(250);			// ...and wait for it
+	}
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Thread entry point
+///////////////////////////////////////////////////////////////////////////////////
+DWORD WINAPI ThreadProcOut(LPVOID lpParameter)
+{
+	CTestcomDlg *pDlg = (CTestcomDlg *)lpParameter;
+
+	STATComms *pComms;
+	pComms = new STATComms();
+	if (pComms)
+	{
+		pComms->SetTransport((STATCONNECTTYPE)(pDlg->m_Transport.GetCurSel() + 1));
+		if (pComms->Initialise() == ITS_OK)
+		{
+			char szPort[25];
+			pDlg->m_Port.GetWindowText(szPort, 25);
+
+			while (bReset)
+			{
+				pDlg->AddString("Listening...");
+				if (pComms->Connect(szPort) == ITS_OK)
+				{
+					bFinished = false;
+					bReset = false;
+					pDlg->AddString("Connected.");
+					pDlg->AddString(szPort);
+
+					ProcessInput(pComms, pDlg);
+
+					pComms->Disconnect();
+				}
+				else
+				{
+					pDlg->AddString("Could not connect.");
+					pDlg->AddString(szPort);
+				}
+
+				pDlg->AddString("Stopped.");
+			}
+
+			pComms->Release();
+		}
+		else
+		{
+			pDlg->AddString("Could not initialise.");
+		}
+	}
+	else
+		pDlg->AddString("Out of memory.");
+
+	return 1;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Listen on the port
+///////////////////////////////////////////////////////////////////////////////////
+void
+ProcessInput(STATComms *pComms, CTestcomDlg *pDlg)
+{
+	int ret = GENERAL_FAILURE;
+	char szBuf[512] = {0};
+	char cIdentifier;
+	char *pExtra = NULL;
+	unsigned long ulReadLength = 0;
+
+	while (!bFinished)
+	{
+		if ((ret = pComms->Receive(&cIdentifier, &pExtra, &ulReadLength)) == ITS_OK)
+		{
+			// display what we received
+			if (ulReadLength && ulReadLength < MAX_LOG_MSG_LEN)
+			{
+				char szContents[MAX_LOG_MSG_LEN + 1];
+				strncpy(szContents, pExtra, ulReadLength);
+				*(szContents + ulReadLength) = (char)0;
+				sprintf(szBuf, "%c   [%s]   (%ld)", cIdentifier, szContents, ulReadLength);
+			}
+			else
+				sprintf(szBuf, "%c   (%ld)", cIdentifier, ulReadLength);
+			pDlg->AddString(szBuf);
+
+			// special behaviour
+			switch(cIdentifier)
+			{
+				case 'T':
+				{
+					pDlg->ReleaseData(&pExtra);
+					ulReadLength = 0;
+					break;
+				}
+				case 'S':
+				{
+					// read bitmap data
+					pDlg->ReleaseData(&pExtra);
+					ret = pDlg->ReadTransferFile(szBitmapFile, &pExtra, &ulReadLength);
+					if (ret != ITS_OK)
+					{
+						pDlg->AddString("Read of bitmap failed!!!");
+						pDlg->AddString(szBitmapFile);
+					}
+					break;
+				}
+				case 'R':
+				case 'X':
+				{
+					// read binary
+					pDlg->ReleaseData(&pExtra);
+					ret = pDlg->ReadTransferFile(szReceiveFile, &pExtra, &ulReadLength);
+					if (ret != ITS_OK)
+					{
+						pDlg->AddString("Read of application file failed!!!");
+						pDlg->AddString(szReceiveFile);
+					}
+					break;
+				}
+			}
+
+			// now send data back as a response to show we got it ok
+			if (pComms->Send(cIdentifier, pExtra, ulReadLength) != ITS_OK)
+				pDlg->AddString("Send failed!!!");
+
+			// need to delete received data once finished with it
+			pDlg->ReleaseData(&pExtra);
+		}
+		else
+		{
+			// restart the connection
+			if (ret != NO_DATA_AT_PORT)
+			{
+				bReset = true;
+				break;
+			}
+		}
+
+		Sleep (250);
+	}
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Release memory resources
+///////////////////////////////////////////////////////////////////////////////////
+void
+CTestcomDlg::ReleaseData(char **ppData)
+{
+	if (*ppData)
+	{
+		delete [] (*ppData);
+		(*ppData) = NULL;
+	}
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Add a string to the list box
+///////////////////////////////////////////////////////////////////////////////////
+void
+CTestcomDlg::AddString(char *szText)
+{
+	m_List1.AddString(szText);
+	int nCount = m_List1.GetCount();
+	if (nCount > 0)
+		m_List1.SetTopIndex(nCount - 1);
+	UpdateWindow();
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Read in a file
+///////////////////////////////////////////////////////////////////////////////////
+int CTestcomDlg::ReadTransferFile(const char *pFile, char **ppContents, unsigned long *pLength)
+{
+	int ret = E_BADFILENAME;
+	CString path = pFile;
+	CFile script_file;
+	if (script_file.Open(path, CFile::modeRead))
+	{
+		try
+		{
+			(*pLength) = script_file.GetLength();
+			(*ppContents) = new char [*pLength];
+			if (*ppContents)
+			{
+				script_file.Read(*ppContents, *pLength);
+				ret = ITS_OK;
+			}
+			else
+				ret = E_OUTOFMEM;
+		}
+		catch(CFileException *e)
+		{
+			e->Delete();
+			ret = GENERAL_FAILURE;
+		}
+
+		script_file.Abort();
+	}
+
+	return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatcomms/testcomdlg.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// testcomDlg.h : header file
+//
+
+#if !defined(AFX_TESTCOMDLG_H__F5EDDB58_81F0_11D6_BC69_00B0D065107F__INCLUDED_)
+#define AFX_TESTCOMDLG_H__F5EDDB58_81F0_11D6_BC69_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+/////////////////////////////////////////////////////////////////////////////
+// CTestcomDlg dialog
+
+class CTestcomDlg : public CDialog
+{
+// Construction
+public:
+	CTestcomDlg(CWnd* pParent = NULL);	// standard constructor
+	~CTestcomDlg();
+	void AddString(char *szText);
+	int ReadTransferFile(const char *pFile, char **ppContents, unsigned long *pLength);
+	void ReleaseData(char **ppData);
+
+	HANDLE hThread2Out;
+
+// Dialog Data
+	//{{AFX_DATA(CTestcomDlg)
+	enum { IDD = IDD_TESTCOM_DIALOG };
+	CEdit	m_Port;
+	CComboBox	m_Transport;
+	CListBox	m_List1;
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CTestcomDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	HICON m_hIcon;
+
+	// Generated message map functions
+	//{{AFX_MSG(CTestcomDlg)
+	virtual BOOL OnInitDialog();
+	afx_msg void OnPaint();
+	afx_msg HCURSOR OnQueryDragIcon();
+	afx_msg void OnTransfer();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_TESTCOMDLG_H__F5EDDB58_81F0_11D6_BC69_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclient.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "myclient.h"
+#include "myclientDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp
+
+BEGIN_MESSAGE_MAP(CMyclientApp, CWinApp)
+	//{{AFX_MSG_MAP(CMyclientApp)
+	//}}AFX_MSG
+	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp construction
+
+CMyclientApp::CMyclientApp()
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CMyclientApp object
+
+CMyclientApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp initialization
+
+BOOL CMyclientApp::InitInstance()
+{
+	if (!AfxSocketInit())
+	{
+		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
+		return FALSE;
+	}
+
+	// Standard initialization
+
+	CMyclientDlg dlg;
+	m_pMainWnd = &dlg;
+	int nResponse = dlg.DoModal();
+	if (nResponse == IDOK)
+	{
+	}
+	else if (nResponse == IDCANCEL)
+	{
+	}
+
+	// Since the dialog has been closed, return FALSE so that we exit the
+	//  application, rather than start the application's message pump.
+	return FALSE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,170 @@
+# Microsoft Developer Studio Project File - Name="myclient" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=myclient - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "myclient.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "myclient.mak" CFG="myclient - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "myclient - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "myclient - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "myclient"
+# PROP Scc_LocalPath "..\.."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "myclient - Win32 Release"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\inc" /I ".\src" /I "..\..\..\source\dll\transport\inc" /I "..\..\..\source\dll\inc" /I "..\..\..\source\regaccess\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 /nologo /subsystem:windows /machine:I386
+
+!ELSEIF  "$(CFG)" == "myclient - Win32 Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\inc" /I ".\src" /I "..\..\..\source\dll\transport\inc" /I "..\..\..\source\dll\inc" /I "..\..\..\source\regaccess\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "myclient - Win32 Release"
+# Name "myclient - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\src\CClientSocket.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclient.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclient.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclientDlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\src\statsocket.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\CClientSocket.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\inc\cstatreturncodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclient.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclientDlg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\inc\statcommon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\statsocket.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\stattransport.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\myclient.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\myclient.rc2
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclient.h : main header file for the MYCLIENT application
+//
+
+#if !defined(AFX_MYCLIENT_H__DCBFD0A3_CBD8_11D6_AF94_000000000000__INCLUDED_)
+#define AFX_MYCLIENT_H__DCBFD0A3_CBD8_11D6_AF94_000000000000__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+	#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h"		// main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp:
+// See myclient.cpp for the implementation of this class
+//
+
+class CMyclientApp : public CWinApp
+{
+public:
+	CMyclientApp();
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CMyclientApp)
+	public:
+	virtual BOOL InitInstance();
+	//}}AFX_VIRTUAL
+
+// Implementation
+
+	//{{AFX_MSG(CMyclientApp)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MYCLIENT_H__DCBFD0A3_CBD8_11D6_AF94_000000000000__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclient.rc	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,229 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 55
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About myclient"
+FONT 8, "MS Sans Serif"
+BEGIN
+    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
+    LTEXT           "myclient Version 1.0",IDC_STATIC,40,10,119,8,
+                    SS_NOPREFIX
+    LTEXT           "Copyright (C) 2002",IDC_STATIC,40,25,119,8
+    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
+END
+
+IDD_MYCLIENT_DIALOG DIALOGEX 0, 0, 237, 169
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "STAT Socket Transport Tester"
+FONT 8, "MS Sans Serif"
+BEGIN
+    EDITTEXT        IDC_SENDMSG,7,7,164,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "Send",IDC_SEND,180,7,50,14
+    EDITTEXT        IDC_MACHINE,44,127,112,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_PORT,190,127,40,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "Connect",IDC_CONNECT,121,148,50,14
+    PUSHBUTTON      "OK",IDOK,180,148,50,14
+    LISTBOX         IDC_RECVLIST,7,29,223,90,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL
+    LTEXT           "Machine:",IDC_STATIC,7,127,31,8
+    LTEXT           "Port:",IDC_STATIC,167,127,16,8
+    CONTROL         "Listen",IDC_CHKLISTEN,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,152,35,10
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0"
+        BEGIN
+            VALUE "CompanyName", "\0"
+            VALUE "FileDescription", "myclient MFC Application\0"
+            VALUE "FileVersion", "1, 0, 0, 1\0"
+            VALUE "InternalName", "myclient\0"
+            VALUE "LegalCopyright", "Copyright (C) 2002\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "myclient.EXE\0"
+            VALUE "ProductName", "myclient Application\0"
+            VALUE "ProductVersion", "1, 0, 0, 1\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_ABOUTBOX, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 228
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 48
+    END
+
+    IDD_MYCLIENT_DIALOG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 230
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 162
+        HORZGUIDE, 127
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_ABOUTBOX            "&About myclient..."
+    IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif //_WIN32\r\n"
+    "#include ""res\\myclient.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME           ICON    DISCARDABLE     "res\\myclient.ico"
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "res/myclient.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclientdlg.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,323 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclientDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "myclient.h"
+#include "myclientDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+	CAboutDlg();
+
+// Dialog Data
+	//{{AFX_DATA(CAboutDlg)
+	enum { IDD = IDD_ABOUTBOX };
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CAboutDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	//{{AFX_MSG(CAboutDlg)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+	//{{AFX_DATA_INIT(CAboutDlg)
+	//}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CAboutDlg)
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+	//{{AFX_MSG_MAP(CAboutDlg)
+		// No message handlers
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientDlg dialog
+
+CMyclientDlg::CMyclientDlg(CWnd* pParent /*=NULL*/)
+	: CDialog(CMyclientDlg::IDD, pParent)
+{
+	//{{AFX_DATA_INIT(CMyclientDlg)
+		// NOTE: the ClassWizard will add member initialization here
+	//}}AFX_DATA_INIT
+	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+}
+
+void CMyclientDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CMyclientDlg)
+	DDX_Control(pDX, IDC_CHKLISTEN, m_ChkListen);
+	DDX_Control(pDX, IDC_PORT, m_Port);
+	DDX_Control(pDX, IDC_MACHINE, m_Machine);
+	DDX_Control(pDX, IDC_CONNECT, m_Connect);
+	DDX_Control(pDX, IDC_SEND, m_Send);
+	DDX_Control(pDX, IDC_SENDMSG, m_SendMsg);
+	DDX_Control(pDX, IDC_RECVLIST, m_RecvList);
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CMyclientDlg, CDialog)
+	//{{AFX_MSG_MAP(CMyclientDlg)
+	ON_WM_SYSCOMMAND()
+	ON_WM_PAINT()
+	ON_WM_QUERYDRAGICON()
+	ON_BN_CLICKED(IDC_SEND, OnSend)
+	ON_BN_CLICKED(IDC_CONNECT, OnConnect)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientDlg message handlers
+
+BOOL CMyclientDlg::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	if (!AfxSocketInit())
+	{
+		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
+		exit(0);
+	}
+
+	// Add "About..." menu item to system menu.
+
+	// IDM_ABOUTBOX must be in the system command range.
+	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+	ASSERT(IDM_ABOUTBOX < 0xF000);
+
+	CMenu* pSysMenu = GetSystemMenu(FALSE);
+	if (pSysMenu != NULL)
+	{
+		CString strAboutMenu;
+		strAboutMenu.LoadString(IDS_ABOUTBOX);
+		if (!strAboutMenu.IsEmpty())
+		{
+			pSysMenu->AppendMenu(MF_SEPARATOR);
+			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
+		}
+	}
+
+	SetIcon(m_hIcon, TRUE);			// Set big icon
+	SetIcon(m_hIcon, FALSE);		// Set small icon
+	
+	m_SendMsg.EnableWindow(FALSE);
+	m_Send.EnableWindow(FALSE);
+
+	m_Machine.SetWindowText("LON-PHILH01");
+	m_Port.SetWindowText("701");
+
+	hThreadHandle = 0;
+
+	return TRUE;  // return TRUE  unless you set the focus to a control
+}
+
+void CMyclientDlg::OnSysCommand(UINT nID, LPARAM lParam)
+{
+	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
+	{
+		CAboutDlg dlgAbout;
+		dlgAbout.DoModal();
+	}
+	else
+	{
+		CDialog::OnSysCommand(nID, lParam);
+	}
+}
+
+// If you add a minimize button to your dialog, you will need the code below
+//  to draw the icon.  For MFC applications using the document/view model,
+//  this is automatically done for you by the framework.
+
+void CMyclientDlg::OnPaint() 
+{
+	if (IsIconic())
+	{
+		CPaintDC dc(this); // device context for painting
+
+		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+		// Center icon in client rectangle
+		int cxIcon = GetSystemMetrics(SM_CXICON);
+		int cyIcon = GetSystemMetrics(SM_CYICON);
+		CRect rect;
+		GetClientRect(&rect);
+		int x = (rect.Width() - cxIcon + 1) / 2;
+		int y = (rect.Height() - cyIcon + 1) / 2;
+
+		// Draw the icon
+		dc.DrawIcon(x, y, m_hIcon);
+	}
+	else
+	{
+		CDialog::OnPaint();
+	}
+}
+
+HCURSOR CMyclientDlg::OnQueryDragIcon()
+{
+	return (HCURSOR) m_hIcon;
+}
+
+void CMyclientDlg::OnSend() 
+{
+	if (pSocket)
+	{
+		char szData[256];
+		m_SendMsg.GetWindowText(szData, 256);
+		if (*szData)
+		{
+			if (pSocket->Send('X', szData, strlen(szData)) != ITS_OK)
+				m_RecvList.AddString("Could not send.");
+		}
+	}
+}
+
+void CMyclientDlg::OnConnect() 
+{
+	bool IsConnected = false;
+
+	pSocket = new CSTATSocket;
+	if (pSocket)
+	{
+		CWaitCursor oWait;
+
+		if (!m_ChkListen.GetCheck())
+		{
+			// get machine name and port number
+			char szMachine[256];
+			m_Machine.GetWindowText(szMachine, 251);
+			strcat(szMachine, ":");
+			m_Port.GetWindowText(szMachine + strlen(szMachine), 4);
+
+			if (pSocket->Connect(szMachine) == ITS_OK)
+			{
+				IsConnected = true;
+				m_RecvList.AddString("Connected.");
+			}
+			else
+				m_RecvList.AddString("Could not connect.");
+		}
+		else
+		{
+			int ret = 0;
+			char szPort[4];
+			m_Port.GetWindowText(szPort, 4);
+			if ((ret = pSocket->Listen(szPort)) == ITS_OK)
+			{
+				m_RecvList.AddString("Listening for connection...");
+				IsConnected = true;
+			}
+			else
+				m_RecvList.AddString("Could not connect.");
+		}
+
+		if (IsConnected)
+		{
+			m_SendMsg.EnableWindow(TRUE);
+			m_Send.EnableWindow(TRUE);
+			m_Connect.EnableWindow(FALSE);
+			m_ChkListen.EnableWindow(FALSE);
+			m_Machine.EnableWindow(FALSE);
+			m_Port.EnableWindow(FALSE);
+			GetMessages();
+		}
+	}
+	else
+		m_RecvList.AddString("Memory error.");
+}
+
+// thread entry point
+DWORD WINAPI ThreadProc(LPVOID lpParameter)
+{
+	// lpParameter can be a pointer to a class to allow method calls
+	CMyclientDlg *pDlg = (CMyclientDlg *)lpParameter;
+
+	char ID = 0;
+	unsigned long Length = 0;
+	char *pData = NULL;
+	char szBuffer[1024];
+
+	while(1)
+	{
+		if (pDlg->pSocket->Receive(&ID, &pData, &Length) == ITS_OK)
+		{
+			memset(szBuffer, 0, 1024);
+			sprintf(szBuffer, "%c %ld %s", ID, Length, pData);
+
+			pDlg->m_RecvList.AddString(szBuffer);
+			pDlg->UpdateWindow();
+		}
+
+		Sleep(100);
+	}
+
+	return 1;
+}
+
+void CMyclientDlg::GetMessages() 
+{
+	DWORD dwThreadID;
+	if (!(hThreadHandle = CreateThread( NULL,				// security attributes
+											0,				// stack size
+											ThreadProc,		// proc to call
+											this,		// proc parameter
+											0,				// creation flags
+											&dwThreadID)))	// thread identifier
+	{
+		AfxMessageBox("Could not create thread");
+	}
+}
+
+void CMyclientDlg::OnOK() 
+{
+	if (hThreadHandle)
+		TerminateThread(hThreadHandle, -1);	
+
+	CDialog::OnOK();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/myclientdlg.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclientDlg.h : header file
+//
+
+#if !defined(AFX_MYCLIENTDLG_H__DCBFD0A5_CBD8_11D6_AF94_000000000000__INCLUDED_)
+#define AFX_MYCLIENTDLG_H__DCBFD0A5_CBD8_11D6_AF94_000000000000__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <statsocket.h>
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientDlg dialog
+
+class CMyclientDlg : public CDialog
+{
+// Construction
+public:
+	CMyclientDlg(CWnd* pParent = NULL);	// standard constructor
+
+	CSTATSocket* pSocket;
+
+// Dialog Data
+	//{{AFX_DATA(CMyclientDlg)
+	enum { IDD = IDD_MYCLIENT_DIALOG };
+	CButton	m_ChkListen;
+	CEdit	m_Port;
+	CEdit	m_Machine;
+	CButton	m_Connect;
+	CButton	m_Send;
+	CEdit	m_SendMsg;
+	CListBox	m_RecvList;
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CMyclientDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	HICON m_hIcon;
+
+	// Generated message map functions
+	//{{AFX_MSG(CMyclientDlg)
+	virtual BOOL OnInitDialog();
+	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
+	afx_msg void OnPaint();
+	afx_msg HCURSOR OnQueryDragIcon();
+	afx_msg void OnSend();
+	afx_msg void OnConnect();
+	virtual void OnOK();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	void GetMessages();
+
+	HANDLE hThreadHandle;
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MYCLIENTDLG_H__DCBFD0A5_CBD8_11D6_AF94_000000000000__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/resource.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by myclient.rc
+//
+#define IDM_ABOUTBOX                    0x0010
+#define IDD_ABOUTBOX                    100
+#define IDS_ABOUTBOX                    101
+#define IDD_MYCLIENT_DIALOG             102
+#define IDP_SOCKETS_INIT_FAILED         103
+#define IDR_MAINFRAME                   128
+#define IDC_SENDMSG                     1000
+#define IDC_SEND                        1001
+#define IDC_RECVLIST                    1002
+#define IDC_CONNECT                     1003
+#define IDC_LISTEN                      1004
+#define IDC_MACHINE                     1005
+#define IDC_PORT                        1006
+#define IDC_CHKLISTEN                   1007
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        129
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1008
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.cpp : source file that includes just the standard includes
+//	myclient.pch will be the pre-compiled header
+//	stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsasync/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__DCBFD0A7_CBD8_11D6_AF94_000000000000__INCLUDED_)
+#define AFX_STDAFX_H__DCBFD0A7_CBD8_11D6_AF94_000000000000__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>			// MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+#include <afxsock.h>		// MFC socket extensions
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__DCBFD0A7_CBD8_11D6_AF94_000000000000__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclient.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "myclient.h"
+#include "myclientDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp
+
+BEGIN_MESSAGE_MAP(CMyclientApp, CWinApp)
+	//{{AFX_MSG_MAP(CMyclientApp)
+	//}}AFX_MSG
+	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp construction
+
+CMyclientApp::CMyclientApp()
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CMyclientApp object
+
+CMyclientApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp initialization
+
+BOOL CMyclientApp::InitInstance()
+{
+	CMyclientDlg dlg;
+	m_pMainWnd = &dlg;
+	dlg.DoModal();
+
+	// Since the dialog has been closed, return FALSE so that we exit the
+	//  application, rather than start the application's message pump.
+	return FALSE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,158 @@
+# Microsoft Developer Studio Project File - Name="myclient" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=myclient - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "myclient.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "myclient.mak" CFG="myclient - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "myclient - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "myclient - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "myclient"
+# PROP Scc_LocalPath "..\.."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "myclient - Win32 Release"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\inc" /I ".\src" /I "..\..\..\source\dll\transport\inc" /I "..\..\..\source\dll\inc" /I "..\..\..\source\regaccess\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 /nologo /subsystem:windows /machine:I386
+
+!ELSEIF  "$(CFG)" == "myclient - Win32 Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\inc" /I ".\src" /I "..\..\..\source\dll\transport\inc" /I "..\..\..\source\dll\inc" /I "..\..\..\source\regaccess\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "myclient - Win32 Release"
+# Name "myclient - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\myclient.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclient.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclientDlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\src\statsocket_block.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\myclient.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\myclientDlg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\inc\statcommon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\statsocket_block.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\source\dll\transport\inc\stattransport.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\myclient.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\myclient.rc2
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclient.h : main header file for the MYCLIENT application
+//
+
+#if !defined(AFX_MYCLIENT_H__DCBFD0A3_CBD8_11D6_AF94_000000000000__INCLUDED_)
+#define AFX_MYCLIENT_H__DCBFD0A3_CBD8_11D6_AF94_000000000000__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+	#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h"		// main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientApp:
+// See myclient.cpp for the implementation of this class
+//
+
+class CMyclientApp : public CWinApp
+{
+public:
+	CMyclientApp();
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CMyclientApp)
+	public:
+	virtual BOOL InitInstance();
+	//}}AFX_VIRTUAL
+
+// Implementation
+
+	//{{AFX_MSG(CMyclientApp)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MYCLIENT_H__DCBFD0A3_CBD8_11D6_AF94_000000000000__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclient.rc	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,236 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 55
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About myclient"
+FONT 8, "MS Sans Serif"
+BEGIN
+    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
+    LTEXT           "myclient Version 1.0",IDC_STATIC,40,10,119,8,
+                    SS_NOPREFIX
+    LTEXT           "Copyright (C) 2002",IDC_STATIC,40,25,119,8
+    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
+END
+
+IDD_MYCLIENT_DIALOG DIALOGEX 0, 0, 237, 199
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "STAT Service Communications Test"
+FONT 8, "MS Sans Serif"
+BEGIN
+    EDITTEXT        IDC_SENDMSG,40,158,133,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "Send",IDC_SEND,180,158,50,14
+    EDITTEXT        IDC_MACHINE,40,137,66,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_PORT,141,137,32,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "Connect",IDC_CONNECT,67,178,50,14
+    PUSHBUTTON      "OK",IDOK,123,178,50,14
+    LISTBOX         IDC_RECVLIST,7,36,223,90,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL
+    LTEXT           "Machine:",IDC_STATIC,7,137,31,8
+    LTEXT           "Port:",IDC_STATIC,117,137,16,8
+    CONTROL         "Listen",IDC_CHKLISTEN,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,182,35,10
+    PUSHBUTTON      "Receive",IDC_RECEIVE,180,178,50,14
+    LTEXT           "This application is used to send STAT scripts to a listening STAT service.  This application can also be used to test a socket connection by one listening and one connecting on the same port.",
+                    IDC_STATIC,7,7,223,26
+    LTEXT           "Data:",IDC_STATIC,7,158,26,8
+    PUSHBUTTON      "Device Info",IDC_INFO,180,137,50,14
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0"
+        BEGIN
+            VALUE "CompanyName", "\0"
+            VALUE "FileDescription", "myclient MFC Application\0"
+            VALUE "FileVersion", "1, 0, 0, 1\0"
+            VALUE "InternalName", "myclient\0"
+            VALUE "LegalCopyright", "Copyright (C) 2002\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "myclient.EXE\0"
+            VALUE "ProductName", "myclient Application\0"
+            VALUE "ProductVersion", "1, 0, 0, 1\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_ABOUTBOX, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 228
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 48
+    END
+
+    IDD_MYCLIENT_DIALOG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 230
+        VERTGUIDE, 40
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 192
+        HORZGUIDE, 137
+        HORZGUIDE, 158
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_ABOUTBOX            "&About myclient..."
+    IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif //_WIN32\r\n"
+    "#include ""res\\myclient.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME           ICON    DISCARDABLE     "res\\myclient.ico"
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "res/myclient.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclientdlg.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,588 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclientDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "myclient.h"
+#include "myclientDlg.h"
+#include <statsocket.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+	CAboutDlg();
+
+// Dialog Data
+	//{{AFX_DATA(CAboutDlg)
+	enum { IDD = IDD_ABOUTBOX };
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CAboutDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	//{{AFX_MSG(CAboutDlg)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+	//{{AFX_DATA_INIT(CAboutDlg)
+	//}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CAboutDlg)
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+	//{{AFX_MSG_MAP(CAboutDlg)
+		// No message handlers
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientDlg dialog
+
+CMyclientDlg::CMyclientDlg(CWnd* pParent /*=NULL*/)
+	: CDialog(CMyclientDlg::IDD, pParent)
+{
+	//{{AFX_DATA_INIT(CMyclientDlg)
+		// NOTE: the ClassWizard will add member initialization here
+	//}}AFX_DATA_INIT
+	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+}
+
+void CMyclientDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CMyclientDlg)
+	DDX_Control(pDX, IDC_INFO, m_Info);
+	DDX_Control(pDX, IDC_RECEIVE, m_Receive);
+	DDX_Control(pDX, IDC_CHKLISTEN, m_ChkListen);
+	DDX_Control(pDX, IDC_PORT, m_Port);
+	DDX_Control(pDX, IDC_MACHINE, m_Machine);
+	DDX_Control(pDX, IDC_CONNECT, m_Connect);
+	DDX_Control(pDX, IDC_SEND, m_Send);
+	DDX_Control(pDX, IDC_SENDMSG, m_SendMsg);
+	DDX_Control(pDX, IDC_RECVLIST, m_RecvList);
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CMyclientDlg, CDialog)
+	//{{AFX_MSG_MAP(CMyclientDlg)
+	ON_WM_SYSCOMMAND()
+	ON_WM_PAINT()
+	ON_WM_QUERYDRAGICON()
+	ON_BN_CLICKED(IDC_SEND, OnSend)
+	ON_BN_CLICKED(IDC_CONNECT, OnConnect)
+	ON_BN_CLICKED(IDC_RECEIVE, OnReceive)
+	ON_BN_CLICKED(IDC_CHKLISTEN, OnChklisten)
+	ON_BN_CLICKED(IDC_INFO, OnInfo)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientDlg message handlers
+
+BOOL CMyclientDlg::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	// IDM_ABOUTBOX must be in the system command range.
+	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+	ASSERT(IDM_ABOUTBOX < 0xF000);
+
+	CMenu* pSysMenu = GetSystemMenu(FALSE);
+	if (pSysMenu != NULL)
+	{
+		CString strAboutMenu;
+		strAboutMenu.LoadString(IDS_ABOUTBOX);
+		if (!strAboutMenu.IsEmpty())
+		{
+			pSysMenu->AppendMenu(MF_SEPARATOR);
+			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
+		}
+	}
+
+	SetIcon(m_hIcon, TRUE);			// Set big icon
+	SetIcon(m_hIcon, FALSE);		// Set small icon
+	
+	hThreadHandle = 0;
+	pSocket = NULL;
+
+	m_Machine.SetWindowText("LON-PHILH03");
+	m_Port.SetWindowText("3001");
+	m_SendMsg.SetWindowText("<B><S><E>");
+
+	Prepare();
+	ResetDeviceInfo();
+
+	return TRUE;  // return TRUE  unless you set the focus to a control
+}
+
+void CMyclientDlg::OnSysCommand(UINT nID, LPARAM lParam)
+{
+	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
+	{
+		CAboutDlg dlgAbout;
+		dlgAbout.DoModal();
+	}
+	else
+	{
+		CDialog::OnSysCommand(nID, lParam);
+	}
+}
+
+// If you add a minimize button to your dialog, you will need the code below
+//  to draw the icon.  For MFC applications using the document/view model,
+//  this is automatically done for you by the framework.
+
+void CMyclientDlg::OnPaint() 
+{
+	if (IsIconic())
+	{
+		CPaintDC dc(this); // device context for painting
+
+		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+		// Center icon in client rectangle
+		int cxIcon = GetSystemMetrics(SM_CXICON);
+		int cyIcon = GetSystemMetrics(SM_CYICON);
+		CRect rect;
+		GetClientRect(&rect);
+		int x = (rect.Width() - cxIcon + 1) / 2;
+		int y = (rect.Height() - cyIcon + 1) / 2;
+
+		// Draw the icon
+		dc.DrawIcon(x, y, m_hIcon);
+	}
+	else
+	{
+		CDialog::OnPaint();
+	}
+}
+
+HCURSOR CMyclientDlg::OnQueryDragIcon()
+{
+	return (HCURSOR) m_hIcon;
+}
+
+void CMyclientDlg::OnSend() 
+{
+	if (pSocket)
+	{
+		char szData[256];
+		m_SendMsg.GetWindowText(szData, 256);
+		if (*szData)
+		{
+			CWaitCursor oWait;
+
+			if (pSocket->Send(SymbianScript, szData, strlen(szData)) != ITS_OK)
+			{
+				AddString("Could not send.  Try to re-connect.");
+				Prepare();
+			}
+		}
+	}
+	else
+		AddString("Bad socket");
+}
+
+void CMyclientDlg::OnReceive() 
+{
+	if (pSocket)
+	{
+		CWaitCursor oWait;
+
+		char ID = 0;
+		unsigned long Length = 0;
+		char *pData = NULL;
+
+		if (pSocket->Receive(&ID, &pData, &Length) != ITS_OK)
+		{
+			AddString("Could not receive.  Try to re-connect.");
+			Prepare();
+		}
+		else
+		{
+			char szBuffer[120] = {0};
+
+			switch(ID)
+			{
+			case SymbianScript:
+				if ((Length < 80) && pData)
+					sprintf(szBuffer, "%ld [%s]", Length, pData);
+				else
+				{
+					sprintf(szBuffer, "Received %ld bytes of data", Length);
+					OpenDataInNotepad(pData, Length);
+				}
+				break;
+			case SymbianError:
+				if ((Length < 100) && pData)
+					sprintf(szBuffer, "ERROR: %ld [%s]", Length, pData);
+				else
+				{
+					sprintf(szBuffer, "ERROR: Received %ld bytes of data", Length);
+					OpenDataInNotepad(pData, Length);
+				}
+				break;
+			case SymbianDeviceInfo:
+				StoreDeviceInformation(pData, Length);
+				DisplayDeviceInformation(pData);
+				break;
+			};
+
+			AddString(szBuffer);
+		}
+
+		if (pData)
+		{
+			delete [] pData;
+			pData = NULL;
+		}
+	}
+	else
+		AddString("Bad socket");
+}
+
+void CMyclientDlg::OnConnect() 
+{
+	bool IsConnected = false;
+
+	pSocket = new CSTATSocket;
+	if (pSocket)
+	{
+		CWaitCursor oWait;
+
+		if (pSocket->Initialise() != ITS_OK)
+			return;
+
+		char szMachine[256] = {0};
+		if (!m_ChkListen.GetCheck())
+		{
+			// get machine name and port number
+			m_Machine.GetWindowText(szMachine, 247);
+			strcat(szMachine, ":");
+			m_Port.GetWindowText(szMachine + strlen(szMachine), 8);
+		}
+		else
+		{
+			m_Port.GetWindowText(szMachine, 8);
+		}
+
+		if (pSocket->Connect(szMachine) == ITS_OK)
+		{
+			AddString("Connected.");
+			m_SendMsg.EnableWindow(TRUE);
+			m_Send.EnableWindow(TRUE);
+			m_Receive.EnableWindow(TRUE);
+			m_Connect.EnableWindow(FALSE);
+			m_ChkListen.EnableWindow(FALSE);
+			m_Machine.EnableWindow(FALSE);
+			m_Port.EnableWindow(FALSE);
+			m_Info.EnableWindow(TRUE);
+		}
+		else
+			AddString("Could not connect.");
+	}
+	else
+		AddString("Memory error.");
+}
+
+
+void CMyclientDlg::OnChklisten() 
+{
+	if (m_ChkListen.GetCheck())
+	{
+		m_Machine.EnableWindow(FALSE);
+	}
+	else
+	{
+		m_Machine.EnableWindow(TRUE);
+	}
+}
+
+void CMyclientDlg::OnOK() 
+{
+	Prepare();
+
+	// delete once we've finished with it
+	DeleteFile(STAT_TEMP_FILE);
+
+	CDialog::OnOK();
+}
+
+
+void CMyclientDlg::OnInfo() 
+{
+	if (pSocket)
+	{
+		if (pSocket->Send(SymbianDeviceInfo) != ITS_OK)
+		{
+			AddString("Could not send.  Try to re-connect.");
+			Prepare();
+		}
+		else
+		{
+			OnReceive();
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// PRIVATE FUNCTIONS
+///////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////////
+// Add a string to the list box
+///////////////////////////////////////////////////////////////////////////////////
+void CMyclientDlg::AddString(char *szText)
+{
+	m_RecvList.AddString(szText);
+	int nCount = m_RecvList.GetCount();
+	if (nCount > 0)
+		m_RecvList.SetTopIndex(nCount - 1);
+	UpdateWindow();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Open a text file in Notepad
+void CMyclientDlg::OpenDataInNotepad(char *pContents, unsigned long ulLength)
+{
+	// save data
+	int ret = E_BADFILENAME;
+
+	CFile script_file;
+	if (script_file.Open(STAT_TEMP_FILE, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite))
+	{
+		try
+		{
+			// might be a zero-length file
+			if (pContents && ulLength)
+				script_file.Write(pContents, ulLength);
+
+			ret = ITS_OK;
+		}
+		catch(CFileException *e)
+		{
+			e->Delete();
+			ret = GENERAL_FAILURE;
+		}
+
+		script_file.Flush();
+		script_file.Close();
+	}
+
+
+	if (ret == ITS_OK)
+	{
+		// open file
+		TCHAR szCurrentDir[MAX_PATH + 1];
+		if (GetWindowsDirectory(szCurrentDir, sizeof(szCurrentDir)))
+		{
+			CString cBuf;
+			cBuf = _T("\"");
+			cBuf += szCurrentDir;
+			cBuf += _T("\\Notepad.exe\" ");
+			cBuf += STAT_TEMP_FILE;
+
+			if (!CallProcess(NULL, cBuf.GetBuffer(0), NULL))
+				MessageBox(_T("Could not invoke Notepad.exe to view script file"), NULL, MB_OK);
+		}
+		else
+			MessageBox(_T("Could not locate Windows directory"), NULL, MB_OK);
+	}
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Invoke a process
+bool CMyclientDlg::CallProcess(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory)
+{
+	bool valid = false;
+	STARTUPINFO startInfo = {0};
+	startInfo.cb = sizeof(STARTUPINFO);
+
+	PROCESS_INFORMATION procInfo = {0};
+
+	// event attributes for the child process
+	SECURITY_ATTRIBUTES eventAttr;
+	eventAttr.nLength = sizeof(eventAttr);
+	eventAttr.lpSecurityDescriptor = NULL;
+	eventAttr.bInheritHandle = TRUE;
+
+	if (CreateProcess(szApplication, szCommandLine, NULL, NULL, FALSE, NULL, NULL,
+					  szDirectory, &startInfo, &procInfo))
+	{
+		valid = true;
+		CloseHandle(procInfo.hThread);
+		CloseHandle(procInfo.hProcess);
+	}
+
+	return valid;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Reset dialog buttons
+void CMyclientDlg::Prepare()
+{
+	m_Info.EnableWindow(FALSE);
+	m_SendMsg.EnableWindow(FALSE);
+	m_Send.EnableWindow(FALSE);
+	m_Receive.EnableWindow(FALSE);
+	m_Connect.EnableWindow(TRUE);
+	m_ChkListen.EnableWindow(TRUE);
+
+	if (pSocket)
+	{
+		pSocket->Disconnect();
+		pSocket->Release();
+		delete pSocket;
+		pSocket = NULL;
+	}
+}
+
+
+//----------------------------------------------------------------------------
+// Break up newline delimited list of device info and store
+void CMyclientDlg::StoreDeviceInformation(char *info, unsigned long length)
+{
+	ResetDeviceInfo();
+	if (length && info)
+	{
+		char szInfo[2048] = {0};
+		char *pEnd = szInfo;
+		strncpy(szInfo, info, length);
+
+		char *p[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+		int i = 0;
+
+		// skip over leading CR/LF's
+		while ((*pEnd) && (*pEnd) == '\r' || (*pEnd) == '\n')
+		{
+			(*pEnd) = (char)0;
+			pEnd++;
+		}
+
+		// split
+		while(*pEnd)
+		{
+			p[i] = pEnd;
+
+			// step over setting
+			while ((*pEnd) && (*pEnd) != '\r' && (*pEnd) != '\n')
+				pEnd++;
+
+			// null terminate
+			while ((*pEnd) && (*pEnd) == '\r' || (*pEnd) == '\n')
+			{
+				(*pEnd) = (char)0;
+				pEnd++;
+			}
+
+			i++;
+			if (i > 18)
+				break;
+		}
+		*pEnd = (char)0;
+
+		// assign
+		strcpy(szMachine, p[0]);
+		strcpy(szCPU, p[1]);
+		strcpy(szInterface, p[2]);
+		strcpy(szFamily, p[3]);
+		strcpy(szManufacturer, p[4]);
+		lModel = atol(p[5]);
+		lFamilyRevision = atol(p[6]);
+		lHardwareRevision = atol(p[7]);
+		lSoftwareRevision = atol(p[8]);
+		lSoftwareBuild = atol(p[9]);
+		lMemoryPageSize = atol(p[10]);
+		lMemoryRAM = atol(p[11]);
+		lMemoryRAMFree = atol(p[12]);
+		lMemoryROM = atol(p[13]);
+		iDelay = atoi(p[14]);
+		iImageVerification = atoi(p[15]);
+		if (iImageVerification)
+		{
+			strcpy(szRefDir, p[16]);
+			iFudge = atoi(p[17]);
+		}
+	}
+}
+
+
+//----------------------------------------------------------------------------
+// Clear any device info settings
+void CMyclientDlg::ResetDeviceInfo()
+{
+	// device info
+	memset(&szMachine, 0, sizeof(szMachine));
+	memset(&szCPU, 0, sizeof(szCPU));
+	memset(&szInterface, 0, sizeof(szInterface));
+	memset(&szFamily, 0, sizeof(szFamily));
+	memset(&szManufacturer, 0, sizeof(szManufacturer));
+	lModel = 0;
+	lFamilyRevision = 0;
+	lHardwareRevision = 0;
+	lSoftwareRevision = 0;
+	lSoftwareBuild = 0;
+	lMemoryPageSize = 0;
+	lMemoryRAM = 0;
+	lMemoryRAMFree = 0;
+	lMemoryROM = 0;
+	iDelay = 0;
+	iImageVerification = 0;
+	memset(&szRefDir, 0, sizeof(szRefDir));
+	iFudge = 0;
+}
+
+
+//----------------------------------------------------------------------------
+// Clear any device info settings
+void CMyclientDlg::DisplayDeviceInformation(char *data)
+{
+	MessageBox(data, "Info", MB_OK);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/myclientdlg.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// myclientDlg.h : header file
+//
+
+#if !defined(AFX_MYCLIENTDLG_H__DCBFD0A5_CBD8_11D6_AF94_000000000000__INCLUDED_)
+#define AFX_MYCLIENTDLG_H__DCBFD0A5_CBD8_11D6_AF94_000000000000__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+class CSTATSocket;
+
+#define STAT_TEMP_FILE	"C:\\stat_temp_file.tmp"
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyclientDlg dialog
+
+class CMyclientDlg : public CDialog
+{
+// Construction
+public:
+	CMyclientDlg(CWnd* pParent = NULL);	// standard constructor
+
+	CSTATSocket* pSocket;
+
+// Dialog Data
+	//{{AFX_DATA(CMyclientDlg)
+	enum { IDD = IDD_MYCLIENT_DIALOG };
+	CButton	m_Info;
+	CButton	m_Receive;
+	CButton	m_ChkListen;
+	CEdit	m_Port;
+	CEdit	m_Machine;
+	CButton	m_Connect;
+	CButton	m_Send;
+	CEdit	m_SendMsg;
+	CListBox	m_RecvList;
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CMyclientDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	HICON m_hIcon;
+
+	// Generated message map functions
+	//{{AFX_MSG(CMyclientDlg)
+	virtual BOOL OnInitDialog();
+	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
+	afx_msg void OnPaint();
+	afx_msg HCURSOR OnQueryDragIcon();
+	afx_msg void OnSend();
+	afx_msg void OnConnect();
+	afx_msg void OnReceive();
+	afx_msg void OnChklisten();
+	virtual void OnOK();
+	afx_msg void OnInfo();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	void Prepare();
+	void OpenDataInNotepad(char *pContents, unsigned long ulLength);
+	bool CallProcess(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory);
+	void AddString(char *szText);
+	void StoreDeviceInformation(char *info, unsigned long length);
+	void ResetDeviceInfo();
+	void DisplayDeviceInformation(char *data);
+
+	HANDLE hThreadHandle;
+
+	// device information - retains information of connected device after <D> command is run
+	char szMachine[256];
+	char szCPU[256];
+	char szInterface[256];
+	char szFamily[256];
+	char szManufacturer[256];
+	long lModel;
+	long lFamilyRevision;
+	long lHardwareRevision;
+	long lSoftwareRevision;
+	long lSoftwareBuild;
+	long lMemoryPageSize;
+	long lMemoryRAM;
+	long lMemoryRAMFree;
+	long lMemoryROM;
+	int iDelay;
+	int iImageVerification;
+	char szRefDir[256];
+	int iFudge;
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MYCLIENTDLG_H__DCBFD0A5_CBD8_11D6_AF94_000000000000__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/resource.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by myclient.rc
+//
+#define IDM_ABOUTBOX                    0x0010
+#define IDD_ABOUTBOX                    100
+#define IDS_ABOUTBOX                    101
+#define IDD_MYCLIENT_DIALOG             102
+#define IDP_SOCKETS_INIT_FAILED         103
+#define IDR_MAINFRAME                   128
+#define IDC_SENDMSG                     1000
+#define IDC_SEND                        1001
+#define IDC_RECVLIST                    1002
+#define IDC_CONNECT                     1003
+#define IDC_LISTEN                      1004
+#define IDC_MACHINE                     1005
+#define IDC_PORT                        1006
+#define IDC_CHKLISTEN                   1007
+#define IDC_RECEIVE                     1008
+#define IDC_INFO                        1009
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        129
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1010
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.cpp : source file that includes just the standard includes
+//	myclient.pch will be the pre-compiled header
+//	stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dllcommstesters/teststatsocketsblock/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__DCBFD0A7_CBD8_11D6_AF94_000000000000__INCLUDED_)
+#define AFX_STDAFX_H__DCBFD0A7_CBD8_11D6_AF94_000000000000__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h>         // MFC core and standard components
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__DCBFD0A7_CBD8_11D6_AF94_000000000000__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/dlltest.dep	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,33 @@
+# Microsoft Developer Studio Generated Dependency File, included by dlltest.mak
+
+.\src\dlltest.cpp : \
+	"..\..\source\lib\inc\INI.h"\
+	"..\..\source\lib\inc\statcommon.h"\
+	".\inc\dlltest.h"\
+	".\inc\dlltestDlg.h"\
+	".\inc\Resource.h"\
+	
+
+.\dlltest.rc : \
+	".\inc\Resource.h"\
+	".\res\dlltest.ico"\
+	".\res\dlltest.rc2"\
+	
+
+.\src\dlltestDlg.cpp : \
+	"..\..\source\lib\inc\INI.h"\
+	"..\..\source\lib\inc\statcommon.h"\
+	"..\..\source\lib\inc\statexp.h"\
+	".\inc\dlltest.h"\
+	".\inc\dlltestDlg.h"\
+	".\inc\Resource.h"\
+	".\inc\Utils.h"\
+	
+
+.\src\StdAfx.cpp : \
+	".\inc\StdAfx.h"\
+	
+
+.\src\utils.cpp : \
+	".\inc\Utils.h"\
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/dlltest.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,176 @@
+# Microsoft Developer Studio Project File - Name="dlltest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=dlltest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "dlltest.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "dlltest - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "dlltest - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "dlltest"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "dlltest - Win32 Release"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 ..\..\lib\STATDll.lib ..\..\lib\STAT.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"Release\STATDllTest.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=copy release\STATDllTest.exe \epoc32\tools\stat\STATDllTest.exe
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "dlltest - Win32 Debug"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\lib\STATDlld.lib ..\..\lib\STATd.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"Debug\STATDllTestd.exe" /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "dlltest - Win32 Release"
+# Name "dlltest - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\dlltest.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\dlltest.dep
+# End Source File
+# Begin Source File
+
+SOURCE=.\dlltest.mak
+# End Source File
+# Begin Source File
+
+SOURCE=.\dlltest.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\dlltestDlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\utils.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\dlltest.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\dlltestDlg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\lib\inc\INI.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\lib\inc\statcommon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\lib\inc\statexp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\StdAfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\Utils.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\dlltest.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\dlltest.rc2
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/dlltest.mak	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,258 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on dlltest.dsp
+!IF "$(CFG)" == ""
+CFG=dlltest - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to dlltest - Win32 Debug.
+!ENDIF 
+
+!IF "$(CFG)" != "dlltest - Win32 Release" && "$(CFG)" != "dlltest - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "dlltest - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "dlltest - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+!ERROR An invalid configuration is specified.
+!ENDIF 
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "dlltest - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\STATDllTest.exe" "$(OUTDIR)\dlltest.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\dlltest.obj"
+	-@erase "$(INTDIR)\dlltest.pch"
+	-@erase "$(INTDIR)\dlltest.res"
+	-@erase "$(INTDIR)\dlltest.sbr"
+	-@erase "$(INTDIR)\dlltestDlg.obj"
+	-@erase "$(INTDIR)\dlltestDlg.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\utils.obj"
+	-@erase "$(INTDIR)\utils.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(OUTDIR)\dlltest.bsc"
+	-@erase "$(OUTDIR)\STATDllTest.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\dlltest.res" /d "NDEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\dlltest.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\dlltest.sbr" \
+	"$(INTDIR)\dlltestDlg.sbr" \
+	"$(INTDIR)\StdAfx.sbr" \
+	"$(INTDIR)\utils.sbr"
+
+"$(OUTDIR)\dlltest.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=..\..\lib\STATDll.lib ..\..\lib\STAT.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"$(OUTDIR)\STATDllTest.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\dlltest.obj" \
+	"$(INTDIR)\dlltestDlg.obj" \
+	"$(INTDIR)\StdAfx.obj" \
+	"$(INTDIR)\utils.obj" \
+	"$(INTDIR)\dlltest.res"
+
+"$(OUTDIR)\STATDllTest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+SOURCE="$(InputPath)"
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+$(DS_POSTBUILD_DEP) : "$(OUTDIR)\STATDllTest.exe" "$(OUTDIR)\dlltest.bsc"
+   copy release\STATDllTest.exe \epoc32\tools\stat\STATDllTest.exe
+	echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ELSEIF  "$(CFG)" == "dlltest - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "$(OUTDIR)\STATDllTestd.exe" "$(OUTDIR)\dlltest.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\dlltest.obj"
+	-@erase "$(INTDIR)\dlltest.pch"
+	-@erase "$(INTDIR)\dlltest.res"
+	-@erase "$(INTDIR)\dlltest.sbr"
+	-@erase "$(INTDIR)\dlltestDlg.obj"
+	-@erase "$(INTDIR)\dlltestDlg.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\utils.obj"
+	-@erase "$(INTDIR)\utils.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(OUTDIR)\dlltest.bsc"
+	-@erase "$(OUTDIR)\STATDllTestd.exe"
+	-@erase "$(OUTDIR)\STATDllTestd.pdb"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MTd /W3 /GX /Zi /Od /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\dlltest.res" /d "_DEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\dlltest.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\dlltest.sbr" \
+	"$(INTDIR)\dlltestDlg.sbr" \
+	"$(INTDIR)\StdAfx.sbr" \
+	"$(INTDIR)\utils.sbr"
+
+"$(OUTDIR)\dlltest.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=..\..\lib\STATDlld.lib ..\..\lib\STATd.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\STATDllTestd.pdb" /debug /machine:I386 /out:"$(OUTDIR)\STATDllTestd.exe" /pdbtype:sept 
+LINK32_OBJS= \
+	"$(INTDIR)\dlltest.obj" \
+	"$(INTDIR)\dlltestDlg.obj" \
+	"$(INTDIR)\StdAfx.obj" \
+	"$(INTDIR)\utils.obj" \
+	"$(INTDIR)\dlltest.res"
+
+"$(OUTDIR)\STATDllTestd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("dlltest.dep")
+!INCLUDE "dlltest.dep"
+!ELSE 
+!MESSAGE Warning: cannot find "dlltest.dep"
+!ENDIF 
+!ENDIF 
+
+
+!IF "$(CFG)" == "dlltest - Win32 Release" || "$(CFG)" == "dlltest - Win32 Debug"
+SOURCE=.\src\dlltest.cpp
+
+"$(INTDIR)\dlltest.obj"	"$(INTDIR)\dlltest.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dlltest.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\dlltest.rc
+
+"$(INTDIR)\dlltest.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) $(RSC_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\dlltestDlg.cpp
+
+"$(INTDIR)\dlltestDlg.obj"	"$(INTDIR)\dlltestDlg.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dlltest.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\StdAfx.cpp
+
+!IF  "$(CFG)" == "dlltest - Win32 Release"
+
+CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\dlltest.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "dlltest - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MTd /W3 /GX /Zi /Od /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\dlltest.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+SOURCE=.\src\utils.cpp
+
+"$(INTDIR)\utils.obj"	"$(INTDIR)\utils.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dlltest.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+
+!ENDIF 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/dlltest.rc	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,320 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "./inc/resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 184, 79
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About STAT DLL Entrypoint Tester"
+FONT 8, "MS Sans Serif"
+BEGIN
+    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
+    LTEXT           "STAT DLL Entrypoint Tester",IDC_STATIC,46,7,97,10,
+                    SS_NOPREFIX
+    LTEXT           "Copyright Symbian (C) 2002",IDC_STATIC,50,38,91,8
+    DEFPUSHBUTTON   "OK",IDOK,69,58,50,14,WS_GROUP
+    LTEXT           "Version 4.0",IDC_STATIC,73,23,40,8
+END
+
+IDD_DLLTEST_DIALOG DIALOGEX 0, 0, 342, 253
+STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
+    WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "STAT DLL Entrypoint Tester"
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+    COMBOBOX        IDC_LINK,64,20,55,76,CBS_DROPDOWNLIST | CBS_SORT | 
+                    CBS_UPPERCASE | WS_TABSTOP
+    EDITTEXT        IDC_DELAY,156,20,24,14,ES_AUTOHSCROLL | ES_NUMBER
+    EDITTEXT        IDC_ITERATIONS,233,20,24,14,ES_AUTOHSCROLL | ES_NUMBER
+    COMBOBOX        IDC_CONNECTION,76,41,50,76,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_PLATFORM,172,41,51,76,CBS_DROPDOWNLIST | CBS_SORT | 
+                    CBS_UPPERCASE | WS_TABSTOP
+    EDITTEXT        IDC_ADDRESS,265,41,59,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "&Reset Defaults",IDC_RESETSETTINGS,265,20,59,14
+    EDITTEXT        IDC_LOGFILE,76,62,181,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_RAWCMD,98,103,226,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_CMDFILE,98,123,159,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_SNAPSHOT,98,143,159,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_REFDIR,98,162,159,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_FUDGE,98,182,28,14,ES_AUTOHSCROLL | ES_NUMBER
+    PUSHBUTTON      "Reset &Defaults",IDC_RESETTESTS,265,182,59,14
+    DEFPUSHBUTTON   "&Run",IDC_RUN,7,232,50,14
+    PUSHBUTTON      "&OK",IDOK,225,232,50,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,284,232,50,14
+    LTEXT           "Delay:",IDC_STATIC,126,20,26,8
+    LTEXT           "Fudge Factor (%):",IDC_STATIC,28,182,61,8
+    LTEXT           "Iterations:",IDC_STATIC,189,20,33,8
+    LTEXT           "DLL Linkage:",IDC_STATIC,16,20,44,8
+    LTEXT           "Platform:",IDC_STATIC,134,41,31,8
+    GROUPBOX        " Tests ",IDC_STATIC,7,89,327,114
+    GROUPBOX        " Settings ",IDC_STATIC,7,6,327,77
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
+                    210,327,14
+    LTEXT           "Connection Type:",IDC_STATIC,16,41,58,8
+    LTEXT           "Address:",IDC_STATIC,231,41,33,8
+    PUSHBUTTON      "Browse...",IDC_BROWSELOG,265,62,59,14
+    PUSHBUTTON      "Browse...",IDC_BROWSECMDFILE,265,123,59,14
+    PUSHBUTTON      "Browse...",IDC_BROWSESNAPSHOT,265,143,59,14
+    PUSHBUTTON      "Browse...",IDC_BROWSEREFIMAGES,265,162,59,14
+    CONTROL         "Raw Command:",IDC_CHECKRAWCMD,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,16,103,66,10
+    CONTROL         "Command File:",IDC_CHECKCMDFILE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,16,123,62,10
+    CONTROL         "Snapshot Filename:",IDC_CHECKSNAPSHOT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,16,143,76,10
+    CONTROL         "Image Verification:",IDC_CHECKVERIFICATION,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,16,162,76,10
+    CONTROL         "Log To File:",IDC_CHKLOGTOFILE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,16,62,54,10
+    CONTROL         "Remove old images",IDC_OVERWRITE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,182,182,75,10
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "Comments", "STAT DLL Test Application\0"
+            VALUE "CompanyName", "Symbian Ltd\0"
+            VALUE "FileDescription", "STAT DLL Test Application\0"
+            VALUE "FileVersion", "4.0\0"
+            VALUE "InternalName", "STAT DLL Test\0"
+            VALUE "LegalCopyright", "Copyright (C) 2005-2009 Nokia Corporation\0"
+            VALUE "LegalTrademarks", "Copyright Nokia Corporation\0"
+            VALUE "OriginalFilename", "STATDLLTest.exe\0"
+            VALUE "PrivateBuild", "\0"
+            VALUE "ProductName", "STAT DLL Test Application\0"
+            VALUE "ProductVersion", "4.0\0"
+            VALUE "SpecialBuild", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_ABOUTBOX, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 177
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 72
+    END
+
+    IDD_DLLTEST_DIALOG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 334
+        VERTGUIDE, 16
+        VERTGUIDE, 76
+        VERTGUIDE, 98
+        VERTGUIDE, 126
+        VERTGUIDE, 189
+        VERTGUIDE, 197
+        VERTGUIDE, 209
+        VERTGUIDE, 250
+        VERTGUIDE, 257
+        VERTGUIDE, 265
+        VERTGUIDE, 324
+        TOPMARGIN, 6
+        BOTTOMMARGIN, 246
+        HORZGUIDE, 20
+        HORZGUIDE, 41
+        HORZGUIDE, 62
+        HORZGUIDE, 83
+        HORZGUIDE, 103
+        HORZGUIDE, 123
+        HORZGUIDE, 143
+        HORZGUIDE, 162
+        HORZGUIDE, 182
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_DLLTEST_DIALOG DLGINIT
+BEGIN
+    IDC_LINK, 0x403, 9, 0
+0x5552, 0x2d4e, 0x4954, 0x454d, "\000" 
+    IDC_LINK, 0x403, 8, 0
+0x5944, 0x414e, 0x494d, 0x0043, 
+    IDC_CONNECTION, 0x403, 7, 0
+0x6f53, 0x6b63, 0x7465, "\000" 
+    IDC_CONNECTION, 0x403, 7, 0
+0x6553, 0x6972, 0x6c61, "\000" 
+    IDC_CONNECTION, 0x403, 10, 0
+0x6e49, 0x7266, 0x2d61, 0x6572, 0x0064, 
+    IDC_CONNECTION, 0x403, 10, 0
+0x6c42, 0x6575, 0x6f74, 0x746f, 0x0068, 
+    IDC_CONNECTION, 0x403, 4, 0
+0x5355, 0x0042, 
+    IDC_PLATFORM, 0x403, 4, 0
+0x5241, 0x004d, 
+    IDC_PLATFORM, 0x403, 5, 0
+0x4957, 0x534e, "\000" 
+    IDC_PLATFORM, 0x403, 7, 0
+0x4957, 0x534e, 0x5743, "\000" 
+    IDC_PLATFORM, 0x403, 6, 0
+0x4854, 0x4d55, 0x0042, 
+    0
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_ABOUTBOX            "&About dlltest..."
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    ".\\inc\\resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif //_WIN32\r\n"
+    "#include ""res\\dlltest.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME           ICON    DISCARDABLE     "res\\dlltest.ico"
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "res/dlltest.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+
+TOOLS
+
+PRJ_MMPFILES
+// Extension Makefile
+makefile statdlltester.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/group/statdlltester.mk	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+# which accompanies this distribution, and is available
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# Typically C:\apps\MSVC6\VC98\Bin
+COMPILER=nmake
+
+# Called with
+#
+# $(PLATFORM) = TOOLS
+# $(CFG)      = DEB, REL
+
+BLD	:  
+	@echo BLD called with $(PLATFORM)$(CFG)
+	
+# release version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (dlltester)
+	"$(COMPILER)" /A /NOLOGO /f "dlltest.mak" CFG="dlltest - Win32 Release"
+	
+	echo ** DLL TESTER (RELEASE) compiled successfully
+
+!endif
+
+# debug version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (dlltester)
+	"$(COMPILER)" /A /NOLOGO /f "dlltest.mak" CFG="dlltest - Win32 Debug"
+	
+	echo ** DLL TESTER (DEBUG) compiled successfully
+
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-rmdir "..\Release" /q /s
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+	-rmdir "..\Debug" /q /s
+!endif
+
+RELEASABLES :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	@echo $(EPOCROOT)epoc32\tools\STAT\STATDlltest.exe
+!endif
+
+SAVESPACE : BLD
+
+MAKMAKE LIB CLEANLIB RESOURCE FREEZE FINAL : 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/inc/dlltest.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// dlltest.h : main header file for the DLLTEST application
+//
+
+#if !defined(AFX_DLLTEST_H__04DFB724_4E37_11D6_BC5F_00B0D065107F__INCLUDED_)
+#define AFX_DLLTEST_H__04DFB724_4E37_11D6_BC5F_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+	#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h"		// main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlltestApp:
+// See dlltest.cpp for the implementation of this class
+//
+
+class CDlltestApp : public CWinApp
+{
+public:
+	CDlltestApp();
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CDlltestApp)
+	public:
+	virtual BOOL InitInstance();
+	//}}AFX_VIRTUAL
+
+// Implementation
+
+	//{{AFX_MSG(CDlltestApp)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_DLLTEST_H__04DFB724_4E37_11D6_BC5F_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/inc/dlltestdlg.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// dlltestDlg.h : header file
+//
+
+#if !defined(AFX_DLLTESTDLG_H__04DFB726_4E37_11D6_BC5F_00B0D065107F__INCLUDED_)
+#define AFX_DLLTESTDLG_H__04DFB726_4E37_11D6_BC5F_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <statcommon.h>
+#include <ini.h>
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlltestDlg dialog
+
+class CDlltestDlg : public CDialog
+{
+// Construction
+public:
+	CDlltestDlg(CWnd* pParent = NULL);	// standard constructor
+	void Run();
+
+// Dialog Data
+	//{{AFX_DATA(CDlltestDlg)
+	enum { IDD = IDD_DLLTEST_DIALOG };
+	CButton	m_RemoveImages;
+	CButton	m_Run;
+	CButton	m_ChkLogtofile;
+	CButton	m_BrowseSnapshot;
+	CButton	m_BrowseRefImages;
+	CButton	m_BrowseLog;
+	CButton	m_BrowseCmdFile;
+	CButton	m_CheckCmdFile;
+	CButton	m_CheckVerification;
+	CButton	m_CheckSnapshot;
+	CButton	m_CheckRawCmd;
+	CEdit	m_Address;
+	CComboBox	m_Connection;
+	CProgressCtrl	m_Progress;
+	CEdit	m_Snapshot;
+	CEdit	m_Delay;
+	CEdit	m_Fudge;
+	CEdit	m_RefDir;
+	CEdit	m_RawCmd;
+	CEdit	m_LogFile;
+	CEdit	m_CmdFile;
+	CEdit	m_Iterations;
+	CComboBox	m_Platform;
+	CComboBox	m_Link;
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CDlltestDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	HICON m_hIcon;
+
+	// Generated message map functions
+	//{{AFX_MSG(CDlltestDlg)
+	virtual BOOL OnInitDialog();
+	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
+	afx_msg void OnPaint();
+	afx_msg HCURSOR OnQueryDragIcon();
+	afx_msg void OnRun();
+	afx_msg void OnChangeConnection();
+	virtual void OnOK();
+	afx_msg void OnResetsettings();
+	afx_msg void OnResettests();
+	afx_msg void OnBrowselog();
+	afx_msg void OnCheckcmdfile();
+	afx_msg void OnCheckrawcmd();
+	afx_msg void OnChecksnapshot();
+	afx_msg void OnCheckverification();
+	afx_msg void OnBrowsecmdfile();
+	afx_msg void OnBrowsesnapshot();
+	afx_msg void OnBrowserefimages();
+	afx_msg void OnChklogtofile();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	void LoadEntrypoint(HINSTANCE inst, FARPROC *fn, const char *name);
+	bool LoadFunctionEntrypoints(HINSTANCE inst);
+	void Evaluate(int ret, int handle);
+	bool WriteBitmap(char *file, TBitmapFileHeader *fileheader, TBitmapInfoHeader * bmpHeader, char *bmpBits, unsigned long lSize);
+	int GetIncrement();
+	void ReadSettings();
+	void SaveSettings();
+	void AddConnectPlatforms();
+	void AddPortPlatforms();
+	void ChangeConnection(int iSelection);
+	void EnableFields(bool bEnable);
+	void GetLogFolder(CString& logFileFolder) const;
+	void GetLogFilePath(const char* logFileName, CString& logFilePath) const;
+
+	bool bRunning;				// flag set if currently processing a script
+	HANDLE hThreadHandle;		// handle to our worker thread
+	char szBuffer[2048];		// global buffer for strings
+	int iValue;					// global buffer for ints
+	int h;						// handle to stat
+	bool bErrors;
+	CStatIniFile statIniFile;
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_DLLTESTDLG_H__04DFB726_4E37_11D6_BC5F_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/inc/resource.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by M:\D\P4work\DP\development\project\2008\preq2582\sf\ana\testexec\testtoolsconn\stat\Desktop\testsource\dlltester\dlltest.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        130
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1027
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/inc/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__04DFB728_4E37_11D6_BC5F_00B0D065107F__INCLUDED_)
+#define AFX_STDAFX_H__04DFB728_4E37_11D6_BC5F_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>			// MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__04DFB728_4E37_11D6_BC5F_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/inc/utils.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// Utils.h : main header file for the basic utilities class
+//
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <windows.h>
+#include <stdio.h>
+#include <winsvc.h>
+
+// service requests
+#define REQ_START 1
+#define REQ_STOP  2
+
+// file requests
+#define DELETEALL 1
+#define DELETEFILESONLY 2
+#define REMOVEALLATTRIBUTES 4
+
+
+class CUtils
+{
+	SC_HANDLE hSCM;
+	HANDLE m_hMutex;
+	WIN32_FIND_DATA ffd;
+	unsigned int iFileCommand;
+	unsigned int iFileCount;
+	TCHAR szError[2048];
+	unsigned long retCode;
+
+	bool Validate(SC_HANDLE hSCM, const char *szServiceName, DWORD dwState, bool bDisplayOnly = false);
+	void Recurse(const char * rootDir);
+	void DealWithDependentServices(const char *szServiceName, const unsigned int iRequest);
+	void _GetWindowsError();
+
+public:
+	CUtils();
+	~CUtils();
+
+	bool AlreadyRunning(LPCTSTR szAppName);
+	bool CallProcessAndWait(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory, bool bRunMinimised = false);
+	bool CallProcess(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory);
+	bool ServiceRequest(const char *szServiceName, const unsigned int iRequest);
+	bool ListServices(DWORD dwState);
+	unsigned int RecurseDir(const char *szDirectory, const unsigned int iCommand);
+	void AddSlash(char *szPath);
+	int TrimBufferToFirstEOL(HANDLE mmphndl, char *szBuffer, bool bIncludeCR = true);
+	void TrimBufferToLastEOL(HANDLE mmphndl, char *szBuffer);
+	void TrimTabsCRAndWhitespace(char *szBuffer);
+	char *GetWindowsError();
+	char *GetWindowsErrorNow();
+	unsigned long GetReturnCode() {return retCode;}
+	unsigned long GetReturnCodeNow() {return GetLastError();}
+};
+
+#endif
Binary file testtoolsconn/stat/desktop/testsource/dlltester/res/dlltest.ico has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/res/dlltest.rc2	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,13 @@
+//
+// DLLTEST.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+	#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/src/distribution.policy	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,2 @@
+Category T
+OSD:	Reference/Test	Tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/src/dlltest.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// dlltest.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "dlltest.h"
+#include "dlltestDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlltestApp
+
+BEGIN_MESSAGE_MAP(CDlltestApp, CWinApp)
+	//{{AFX_MSG_MAP(CDlltestApp)
+	//}}AFX_MSG
+	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlltestApp construction
+
+CDlltestApp::CDlltestApp()
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CDlltestApp object
+
+CDlltestApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlltestApp initialization
+
+BOOL CDlltestApp::InitInstance()
+{
+	// Standard initialization
+
+	CDlltestDlg dlg;
+	m_pMainWnd = &dlg;
+	int nResponse = dlg.DoModal();
+	if (nResponse == IDOK)
+	{
+	}
+	else if (nResponse == IDCANCEL)
+	{
+	}
+
+	// Since the dialog has been closed, return FALSE so that we exit the
+	//  application, rather than start the application's message pump.
+	return FALSE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/src/dlltestdlg.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1419 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// dlltestDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "dlltest.h"
+#include "dlltestDlg.h"
+
+#include <utils.h>
+#include <statexp.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+// function pointer prototypes
+typedef	char * (*LPFN_Version)();
+typedef	char * (*LPFN_GetError)(const int handle);
+typedef	int (*LPFN_SetConnectionLogging)(const char * filename);
+typedef	void (*LPFN_CloseConnectionLogging)();
+typedef	int (*LPFN_Connect)(const STATCONNECTTYPE iConnectType, const char * pszPlatformType);
+typedef	int (*LPFN_Disconnect)(const int handle);
+typedef	int (*LPFN_SetCommandDelay)(const int handle, const unsigned int iMillisecondDelay);
+typedef	int (*LPFN_SetCommandLogging)(const int handle, const char * pszLogPath, HWND messageWindow, const STATLOGLEVEL iLevel, const bool bAppend);
+typedef	int (*LPFN_SetImageVerification)(const int handle, const char * pszRefDir, const bool bRemoveOldImages, const int iFactor);
+typedef	int (*LPFN_SendRawCommand)(const int handle, const char * pszText);
+typedef	int (*LPFN_SendCommandFile)(const int handle, const char * pszFile);
+typedef	int (*LPFN_GetSnapshot)(const int handle, TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize);
+
+// initialise pointers
+LPFN_Version pfn_Version = NULL;
+LPFN_GetError pfn_GetError = NULL;
+LPFN_SetConnectionLogging pfn_SetConnectionLogging = NULL;
+LPFN_CloseConnectionLogging pfn_CloseConnectionLogging = NULL;
+LPFN_Connect pfn_Connect = NULL;
+LPFN_Disconnect pfn_Disconnect = NULL;
+LPFN_SetCommandDelay pfn_SetCommandDelay = NULL;
+LPFN_SetCommandLogging pfn_SetCommandLogging = NULL;
+LPFN_SetImageVerification pfn_SetImageVerification = NULL;
+LPFN_SendRawCommand pfn_SendRawCommand = NULL;
+LPFN_SendCommandFile pfn_SendCommandFile = NULL;
+LPFN_GetSnapshot pfn_GetSnapshot = NULL;
+
+//////////////////////////////////////////////////////////////////////////
+// This is the main thread function which listens on a socket and
+// processes any incoming scripts
+DWORD WINAPI
+ThreadProc(LPVOID lpParameter)
+{
+	CDlltestDlg *pWorker = (CDlltestDlg *)lpParameter;
+
+	pWorker->Run();
+
+	return 1;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+	CAboutDlg();
+
+// Dialog Data
+	//{{AFX_DATA(CAboutDlg)
+	enum { IDD = IDD_ABOUTBOX };
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CAboutDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	//{{AFX_MSG(CAboutDlg)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+	//{{AFX_DATA_INIT(CAboutDlg)
+	//}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CAboutDlg)
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+	//{{AFX_MSG_MAP(CAboutDlg)
+		// No message handlers
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlltestDlg dialog
+
+CDlltestDlg::CDlltestDlg(CWnd* pParent /*=NULL*/)
+	: CDialog(CDlltestDlg::IDD, pParent)
+{
+	//{{AFX_DATA_INIT(CDlltestDlg)
+		// NOTE: the ClassWizard will add member initialization here
+	//}}AFX_DATA_INIT
+	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+}
+
+void CDlltestDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CDlltestDlg)
+	DDX_Control(pDX, IDC_OVERWRITE, m_RemoveImages);
+	DDX_Control(pDX, IDC_RUN, m_Run);
+	DDX_Control(pDX, IDC_CHKLOGTOFILE, m_ChkLogtofile);
+	DDX_Control(pDX, IDC_BROWSESNAPSHOT, m_BrowseSnapshot);
+	DDX_Control(pDX, IDC_BROWSEREFIMAGES, m_BrowseRefImages);
+	DDX_Control(pDX, IDC_BROWSELOG, m_BrowseLog);
+	DDX_Control(pDX, IDC_BROWSECMDFILE, m_BrowseCmdFile);
+	DDX_Control(pDX, IDC_CHECKCMDFILE, m_CheckCmdFile);
+	DDX_Control(pDX, IDC_CHECKVERIFICATION, m_CheckVerification);
+	DDX_Control(pDX, IDC_CHECKSNAPSHOT, m_CheckSnapshot);
+	DDX_Control(pDX, IDC_CHECKRAWCMD, m_CheckRawCmd);
+	DDX_Control(pDX, IDC_ADDRESS, m_Address);
+	DDX_Control(pDX, IDC_CONNECTION, m_Connection);
+	DDX_Control(pDX, IDC_PROGRESS, m_Progress);
+	DDX_Control(pDX, IDC_SNAPSHOT, m_Snapshot);
+	DDX_Control(pDX, IDC_DELAY, m_Delay);
+	DDX_Control(pDX, IDC_FUDGE, m_Fudge);
+	DDX_Control(pDX, IDC_REFDIR, m_RefDir);
+	DDX_Control(pDX, IDC_RAWCMD, m_RawCmd);
+	DDX_Control(pDX, IDC_LOGFILE, m_LogFile);
+	DDX_Control(pDX, IDC_CMDFILE, m_CmdFile);
+	DDX_Control(pDX, IDC_ITERATIONS, m_Iterations);
+	DDX_Control(pDX, IDC_PLATFORM, m_Platform);
+	DDX_Control(pDX, IDC_LINK, m_Link);
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CDlltestDlg, CDialog)
+	//{{AFX_MSG_MAP(CDlltestDlg)
+	ON_WM_SYSCOMMAND()
+	ON_WM_PAINT()
+	ON_WM_QUERYDRAGICON()
+	ON_BN_CLICKED(IDC_RUN, OnRun)
+	ON_CBN_SELCHANGE(IDC_CONNECTION, OnChangeConnection)
+	ON_BN_CLICKED(IDC_RESETSETTINGS, OnResetsettings)
+	ON_BN_CLICKED(IDC_RESETTESTS, OnResettests)
+	ON_BN_CLICKED(IDC_BROWSELOG, OnBrowselog)
+	ON_BN_CLICKED(IDC_CHECKCMDFILE, OnCheckcmdfile)
+	ON_BN_CLICKED(IDC_CHECKRAWCMD, OnCheckrawcmd)
+	ON_BN_CLICKED(IDC_CHECKSNAPSHOT, OnChecksnapshot)
+	ON_BN_CLICKED(IDC_CHECKVERIFICATION, OnCheckverification)
+	ON_BN_CLICKED(IDC_BROWSECMDFILE, OnBrowsecmdfile)
+	ON_BN_CLICKED(IDC_BROWSESNAPSHOT, OnBrowsesnapshot)
+	ON_BN_CLICKED(IDC_BROWSEREFIMAGES, OnBrowserefimages)
+	ON_BN_CLICKED(IDC_CHKLOGTOFILE, OnChklogtofile)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlltestDlg message handlers
+
+BOOL CDlltestDlg::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	// Add "About..." menu item to system menu.
+
+	// IDM_ABOUTBOX must be in the system command range.
+	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+	ASSERT(IDM_ABOUTBOX < 0xF000);
+
+	CMenu* pSysMenu = GetSystemMenu(FALSE);
+	if (pSysMenu != NULL)
+	{
+		CString strAboutMenu;
+		strAboutMenu.LoadString(IDS_ABOUTBOX);
+		if (!strAboutMenu.IsEmpty())
+		{
+			pSysMenu->AppendMenu(MF_SEPARATOR);
+			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
+		}
+	}
+
+	SetIcon(m_hIcon, TRUE);			// Set big icon
+	SetIcon(m_hIcon, FALSE);		// Set small icon
+
+	m_Snapshot.SetLimitText(sizeof(szBuffer));
+	m_RefDir.SetLimitText(sizeof(szBuffer));
+	m_RawCmd.SetLimitText(sizeof(szBuffer));
+	m_LogFile.SetLimitText(sizeof(szBuffer));
+	m_CmdFile.SetLimitText(sizeof(szBuffer));
+
+	// initialise our settings
+	OnResetsettings();
+	OnResettests();
+	ReadSettings();
+
+	return TRUE;  // return TRUE  unless you set the focus to a control
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnSysCommand(UINT nID, LPARAM lParam)
+{
+	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
+	{
+		CAboutDlg dlgAbout;
+		dlgAbout.DoModal();
+	}
+	else
+	{
+		CDialog::OnSysCommand(nID, lParam);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+// If you add a minimize button to your dialog, you will need the code below
+//  to draw the icon.  For MFC applications using the document/view model,
+//  this is automatically done for you by the framework.
+
+void CDlltestDlg::OnPaint() 
+{
+	if (IsIconic())
+	{
+		CPaintDC dc(this); // device context for painting
+
+		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+		// Center icon in client rectangle
+		int cxIcon = GetSystemMetrics(SM_CXICON);
+		int cyIcon = GetSystemMetrics(SM_CYICON);
+		CRect rect;
+		GetClientRect(&rect);
+		int x = (rect.Width() - cxIcon + 1) / 2;
+		int y = (rect.Height() - cyIcon + 1) / 2;
+
+		// Draw the icon
+		dc.DrawIcon(x, y, m_hIcon);
+	}
+	else
+	{
+		CDialog::OnPaint();
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+HCURSOR CDlltestDlg::OnQueryDragIcon()
+{
+	return (HCURSOR) m_hIcon;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnRun() 
+{
+	if (bRunning)
+	{
+		if (IDYES == AfxMessageBox(_T("The work task has not completed its current job and stopping it now may cause it to be left in an unstable state.  Do you wish to abort the current task?"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2))
+		{
+			TerminateThread(hThreadHandle, (unsigned long)-1);
+			EnableFields(TRUE);
+		}
+	}
+	else
+	{
+		//call Run to run through the script (with no appending to log file in this case) - spawn a thread...
+		DWORD dwThreadID;
+		if (hThreadHandle = CreateThread( NULL,					// security attributes
+												0,				// stack size
+												ThreadProc,		// proc to call
+												this,			// proc parameter
+												0,				// creation flags
+												&dwThreadID))	// thread identifier
+		{
+			EnableFields(FALSE);
+
+			MSG msg;
+			while(WaitForSingleObject(hThreadHandle, STAT_THREAD_SLEEP_TIME) == WAIT_TIMEOUT)
+			{
+				PeekMessage(&msg, m_hWnd, 0, 0, PM_REMOVE);
+				DispatchMessage(&msg);
+			}
+
+			EnableFields(TRUE);
+		}
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::Run()
+{
+	struct TBitmapFileHeader *pFile = NULL;
+	struct TBitmapInfoHeader *pInfo = NULL;
+	char *pData = NULL;
+	char szPrevious[10] = {0};
+	char szRemaining[10] = {0};
+	unsigned long lSize = 0;
+
+	bErrors = false;
+
+	m_Progress.SetRange(0, 100);
+	m_Progress.SetPos(0);
+	m_Progress.SetStep(GetIncrement());
+
+	CString logFile;		// We use this file name throughout the
+							// function and we should save it.
+	CString logFilePath;	// Also, we have a bit of a mixture
+							// of calls to make to set up logging
+							// and some require a file name (and assume a
+							// folder) and some require a full path.
+							// Generate a full path (based on the file name
+							// above) and use whichever variable suits
+							// each function call.
+
+	if (m_ChkLogtofile.GetCheck())
+	{
+		m_LogFile.GetWindowText(logFile);
+		GetLogFilePath(logFile,logFilePath);
+	}
+
+	// connect to runtime dll
+	if (m_Link.GetCurSel() == 1)
+	{
+		// display version
+		MessageBox(Version(), "STAT DLL Version", MB_OK);
+
+		CWaitCursor oWait;
+
+		// log connections
+		if (m_ChkLogtofile.GetCheck())
+		{
+			if (0 != logFilePath.GetLength())
+			{
+				SetConnectionLogging(logFilePath);
+			}
+		}
+
+		// get the connect string
+		switch(m_Connection.GetCurSel())
+		{
+		case 1:	// serial
+		case 2:	// infra-red
+		case 3:	// bluetooth
+		case 4:	// USB
+			m_Platform.GetLBText(m_Platform.GetCurSel(), szBuffer);
+			break;
+		case 0:	// socket
+			m_Address.GetWindowText(szBuffer, sizeof(szBuffer));
+			break;
+		}
+
+		// connect
+		Evaluate(h = Connect((STATCONNECTTYPE)(m_Connection.GetCurSel() + 1), szBuffer, NULL, NULL), h);
+
+		if (h)
+		{
+			m_Progress.StepIt();
+			UpdateWindow();
+
+			// log commands
+			if (m_ChkLogtofile.GetCheck())
+			{
+				if (0 != logFile.GetLength())
+					Evaluate(SetCommandLogging(h, logFile, NULL, EVerbose, true, NULL, NULL), h);
+			}
+
+			if (!bErrors)
+			{
+				// set command delay
+				m_Delay.GetWindowText(szBuffer, sizeof(szBuffer));
+				iValue = atoi(szBuffer);
+				Evaluate(SetCommandDelay(h, iValue), h);
+			}
+
+			if (!bErrors)
+			{
+				// set image verification
+				if (m_CheckVerification.GetCheck())
+				{
+					m_Fudge.GetWindowText(szBuffer, sizeof(szBuffer));
+					iValue = atoi(szBuffer);
+					m_RefDir.GetWindowText(szBuffer, sizeof(szBuffer));
+					if (*szBuffer)
+						Evaluate(SetImageVerification(h, szBuffer, m_RemoveImages.GetCheck()?true:false, iValue), h);
+				}
+			}
+
+			m_Iterations.GetWindowText(szPrevious, sizeof(szPrevious));
+			int iMax = atoi(szPrevious);
+			for (int i=0;i<iMax;i++)
+			{
+				if (!bErrors)
+				{
+					// execute raw command
+					if (m_CheckRawCmd.GetCheck())
+					{
+						m_RawCmd.GetWindowText(szBuffer, sizeof(szBuffer));
+						if (*szBuffer)
+						{
+							Evaluate(SendRawCommand(h, szBuffer), h);
+							m_Progress.StepIt();
+							UpdateWindow();
+						}
+					}
+				}
+
+				if (!bErrors)
+				{
+					// execute command file
+					if (m_CheckCmdFile.GetCheck())
+					{
+						m_CmdFile.GetWindowText(szBuffer, sizeof(szBuffer));
+						if (*szBuffer)
+						{
+							Evaluate(SendCommandFile(h, szBuffer), h);
+							m_Progress.StepIt();
+							UpdateWindow();
+						}
+					}
+				}
+
+				if (!bErrors)
+				{
+					// get a snapshot
+					if (m_CheckSnapshot.GetCheck())
+					{
+						m_Snapshot.GetWindowText(szBuffer, sizeof(szBuffer));
+						if (*szBuffer)
+						{
+							DeleteFile(szBuffer);
+							Evaluate(GetSnapshot(h, &pFile, &pInfo, &pData, &lSize), h);
+
+							if (!bErrors)
+								if (!WriteBitmap(szBuffer, pFile, pInfo, pData, lSize))
+									bErrors = true;
+
+							m_Progress.StepIt();
+							UpdateWindow();
+						}
+					}
+				}
+
+				// decrement the iteration count
+				itoa(iMax - i - 1, szRemaining, 10);
+				m_Iterations.SetWindowText(szRemaining);
+				UpdateWindow();
+			}
+
+			// disconnect
+			Evaluate(Disconnect(h), h);
+			m_Progress.SetPos(100);
+			m_Iterations.SetWindowText(szPrevious);
+		}
+
+		if (m_ChkLogtofile.GetCheck())
+			CloseConnectionLogging();
+	}
+	else
+	{
+		// connect to loaded dll
+#if defined _DEBUG
+		HINSTANCE inst = LoadLibrary("statd.dll");
+#else // defined _DEBUG
+		HINSTANCE inst = LoadLibrary("stat.dll");
+#endif // defined _DEBUG
+		if (inst && LoadFunctionEntrypoints(inst))
+		{
+			// display version
+			MessageBox((*pfn_Version)(), "STAT DLL Version", MB_OK);
+
+			CWaitCursor oWait;
+
+			// log connections
+			if (m_ChkLogtofile.GetCheck())
+			{
+				if (0 != logFilePath.GetLength())
+				{
+					(*pfn_SetConnectionLogging)(logFilePath);
+				}
+			}
+
+			// get the connect string
+			switch(m_Connection.GetCurSel())
+			{
+			case 1:	// serial
+			case 2:	// infra-red
+			case 3:	// bluetooth
+			case 4:	// USB
+				m_Platform.GetLBText(m_Platform.GetCurSel(), szBuffer);
+				break;
+			
+			case 0:	// socket
+				m_Address.GetWindowText(szBuffer, sizeof(szBuffer));
+				break;
+			}
+
+			// connect
+			Evaluate(h = (*pfn_Connect)((STATCONNECTTYPE)(m_Connection.GetCurSel() + 1), szBuffer), h);
+
+			if (h)
+			{
+				m_Progress.StepIt();
+				UpdateWindow();
+
+				// log commands
+				if (m_ChkLogtofile.GetCheck())
+				{
+					if (0 != logFile.GetLength())
+						Evaluate((*pfn_SetCommandLogging)(h, logFile, NULL, EVerbose, true), h);
+				}
+
+				// set command delay
+				if (!bErrors)
+				{
+					m_Delay.GetWindowText(szBuffer, sizeof(szBuffer));
+					iValue = atoi(szBuffer);
+					Evaluate((*pfn_SetCommandDelay)(h, iValue), h);
+				}
+
+				// set image verification
+				if (!bErrors)
+				{
+					if (m_CheckVerification.GetCheck())
+					{
+						m_Fudge.GetWindowText(szBuffer, sizeof(szBuffer));
+						iValue = atoi(szBuffer);
+						m_RefDir.GetWindowText(szBuffer, sizeof(szBuffer));
+						if (*szBuffer)
+							Evaluate((*pfn_SetImageVerification)(h, szBuffer, m_RemoveImages.GetCheck()?true:false, iValue), h);
+					}
+				}
+
+				m_Iterations.GetWindowText(szPrevious, sizeof(szPrevious));
+				int iMax = atoi(szPrevious);
+				for (int i=0;i<iMax;i++)
+				{
+					if (!bErrors)
+					{
+						// execute raw command
+						if (m_CheckRawCmd.GetCheck())
+						{
+							m_RawCmd.GetWindowText(szBuffer, sizeof(szBuffer));
+							if (*szBuffer)
+							{
+								Evaluate((*pfn_SendRawCommand)(h, szBuffer), h);
+								m_Progress.StepIt();
+								UpdateWindow();
+							}
+						}
+					}
+
+					if (!bErrors)
+					{
+						// execute command file
+						if (m_CheckCmdFile.GetCheck())
+						{
+							m_CmdFile.GetWindowText(szBuffer, sizeof(szBuffer));
+							if (*szBuffer)
+							{
+								Evaluate((*pfn_SendCommandFile)(h, szBuffer), h);
+								m_Progress.StepIt();
+								UpdateWindow();
+							}
+						}
+					}
+
+					if (!bErrors)
+					{
+						// get a snapshot
+						if (m_CheckSnapshot.GetCheck())
+						{
+							m_Snapshot.GetWindowText(szBuffer, sizeof(szBuffer));
+							if (*szBuffer)
+							{
+								DeleteFile(szBuffer);
+								Evaluate((*pfn_GetSnapshot)(h, &pFile, &pInfo, &pData, &lSize), h);
+
+								if (!bErrors)
+									if (!WriteBitmap(szBuffer, pFile, pInfo, pData, lSize))
+										bErrors = true;
+
+								m_Progress.StepIt();
+								UpdateWindow();
+							}
+						}
+					}
+
+					// decrement the iteration count
+					itoa(iMax - i - 1, szRemaining, 10);
+					m_Iterations.SetWindowText(szRemaining);
+					UpdateWindow();
+				}
+
+				// disconnect
+				Evaluate((*pfn_Disconnect)(h), h); // start of list
+				m_Progress.SetPos(100);
+				m_Iterations.SetWindowText(szPrevious);
+			}
+
+			// close logging
+			if (m_ChkLogtofile.GetCheck())
+				if (pfn_CloseConnectionLogging)	// doesn't exist in 3.2
+					(*pfn_CloseConnectionLogging)();
+		}
+		else
+			MessageBox("STAT.DLL could not be loaded successfully", NULL, MB_OK|MB_ICONERROR);
+
+		// finished
+		if (inst)
+			FreeLibrary(inst);
+	}
+
+	if (m_ChkLogtofile.GetCheck() && (0 != logFile.GetLength()))
+	{
+		if ((bErrors && (IDYES == AfxMessageBox("Do you wish to view the log file?", MB_YESNO | MB_ICONINFORMATION | MB_DEFBUTTON1))) ||
+			(!bErrors && (IDYES == AfxMessageBox("All tests completed successfully.  Do you wish to view the log file?", MB_YESNO | MB_ICONINFORMATION | MB_DEFBUTTON2))))
+		{
+			CString logFileDirectory;
+			GetLogFolder(logFileDirectory);
+			::ShellExecute(GetSafeHwnd(), NULL, logFile, NULL, 
+				logFileDirectory, SW_SHOW);
+		}
+	}
+	else
+	{
+		if (!bErrors)
+			AfxMessageBox("All tests completed successfully.", MB_OK | MB_ICONINFORMATION);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+int CDlltestDlg::GetIncrement()
+{
+	int increment = 0;
+
+	if (m_CheckRawCmd.GetCheck())
+		increment++;
+
+	if (m_CheckCmdFile.GetCheck())
+		increment++;
+
+	if (m_CheckSnapshot.GetCheck())
+		increment++;
+
+	m_Iterations.GetWindowText(szBuffer, sizeof(szBuffer));
+	int iMax = atoi(szBuffer);
+	if (iMax)
+		increment *= iMax;
+
+	// for Connect()/Disconnect()
+	increment++;
+
+	return (int) 100 / increment;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::LoadEntrypoint(HINSTANCE inst, FARPROC *fn, const char *name)
+{
+	if (!*fn)
+		*fn = GetProcAddress(inst, name);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+bool CDlltestDlg::LoadFunctionEntrypoints(HINSTANCE inst)
+{
+	// get
+	LoadEntrypoint(inst, (FARPROC *)&pfn_Version, "Version");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_GetError, "GetError");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_SetConnectionLogging, "SetConnectionLogging");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_CloseConnectionLogging, "CloseConnectionLogging");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_Connect, "Connect");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_Disconnect, "Disconnect");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_SetCommandDelay, "SetCommandDelay");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_SetCommandLogging, "SetCommandLogging");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_SetImageVerification, "SetImageVerification");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_SendRawCommand, "SendRawCommand");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_SendCommandFile, "SendCommandFile");
+	LoadEntrypoint(inst, (FARPROC *)&pfn_GetSnapshot, "GetSnapshot");
+
+
+	// check
+	if (pfn_Version && pfn_GetError && pfn_SetConnectionLogging && pfn_Connect && pfn_Disconnect &&
+		pfn_SetCommandDelay && pfn_SetCommandLogging && pfn_GetSnapshot && pfn_CloseConnectionLogging &&
+		pfn_SetImageVerification && pfn_SendRawCommand && pfn_SendCommandFile )
+	{
+		return true;
+	}
+
+	MessageBox("Not all required STAT entrypoints could be located.  This application is compatible with STAT DLL 3.3 (September 2002) and later.", NULL, MB_OK|MB_ICONERROR);
+	return false;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::Evaluate(int ret, int handle)
+{
+	if (!ret)
+	{
+		if (m_Link.GetCurSel() == 1)
+			strcpy(szBuffer, GetError(handle));
+		else
+			strcpy(szBuffer, pfn_GetError(handle));
+
+		bErrors = true;
+		MessageBox(szBuffer, NULL, MB_OK|MB_ICONERROR);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+bool CDlltestDlg::WriteBitmap(char *file, TBitmapFileHeader *fileheader, TBitmapInfoHeader * bmpHeader, char *bmpBits, unsigned long lSize)
+{
+	bool success = false;
+
+	// write the whole lot out to file
+	HANDLE infile;
+	if (INVALID_HANDLE_VALUE != (infile = CreateFile(file,
+										   GENERIC_WRITE,
+										   0, 
+										   NULL, 
+										   CREATE_ALWAYS,
+										   FILE_ATTRIBUTE_NORMAL,
+										   0)))
+	{
+		DWORD dwBytesWritten = 0;
+
+		// write the file info
+		if (WriteFile(infile, (LPVOID *)fileheader, sizeof(TBitmapFileHeader), &dwBytesWritten, NULL) &&
+			dwBytesWritten == sizeof(TBitmapFileHeader))
+		{
+			// write the bitmap info
+			if (WriteFile(infile, (LPVOID *)bmpHeader, sizeof(TBitmapInfoHeader), &dwBytesWritten, NULL) &&
+				dwBytesWritten == sizeof(TBitmapInfoHeader))
+			{
+				// write the bitmap data
+				if (WriteFile(infile, (LPVOID *)bmpBits, lSize, &dwBytesWritten, NULL) &&
+					dwBytesWritten == lSize)
+				{
+					success = true;
+				}
+			}
+		}
+
+		CloseHandle(infile);
+	}
+
+	return success;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnChangeConnection() 
+{
+	ChangeConnection(0);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::ChangeConnection(int iSelection) 
+{
+	switch(m_Connection.GetCurSel())
+	{
+	case 0:	// socket
+		m_Address.EnableWindow();
+		m_Platform.EnableWindow(FALSE);
+		break;
+	
+	case 1:	// serial
+	case 2:	// infra-red
+	case 3:	// bluetooth
+	case 4:	// USB
+		m_Platform.ResetContent();
+		m_Platform.AddString("COM1");
+		m_Platform.AddString("COM2");
+		m_Platform.AddString("COM3");
+		m_Platform.AddString("COM4");
+		m_Platform.AddString("COM5");
+		m_Platform.AddString("COM6");
+		m_Platform.AddString("COM7");
+		m_Platform.SetCurSel(iSelection);
+		m_Platform.EnableWindow(TRUE);
+		m_Address.EnableWindow(FALSE);
+		break;
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::SaveSettings()
+{
+	(*szBuffer) = (char)0;
+	m_Iterations.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_ITERATIONS,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_Delay.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_DELAY,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_LogFile.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_LOGFILE,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_CmdFile.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_CMDFILE,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_RawCmd.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_RAWCMD,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_Fudge.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_FUDGE,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_Snapshot.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_SNAPSHOT,ST_TEST_KEY);
+
+
+	(*szBuffer) = (char)0;
+	m_RefDir.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_REFDIR,ST_TEST_KEY);
+
+	(*szBuffer) = (char)0;
+	m_Address.GetWindowText(szBuffer, sizeof(szBuffer));
+	statIniFile.WriteKey(szBuffer,ST_ADDRESS,ST_TEST_KEY);
+
+	_ltot( m_Link.GetCurSel(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_LINK,ST_TEST_KEY);
+
+	_ltot( m_Connection.GetCurSel(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_CONNECTIONDLL,ST_TEST_KEY);
+
+	_ltot( m_Platform.GetCurSel(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_PLATFORM,ST_TEST_KEY);
+
+	_ltot( m_CheckRawCmd.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_CHKRAWCMD,ST_TEST_KEY);
+
+	_ltot( m_CheckCmdFile.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_CHKCMDFILE,ST_TEST_KEY);
+
+	_ltot( m_CheckVerification.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_CHKVERIF,ST_TEST_KEY);
+
+	_ltot( m_RemoveImages.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_VERIFYREMOVEIMAGES,ST_TEST_KEY);
+
+	_ltot( m_CheckSnapshot.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_CHKSNAP,ST_TEST_KEY);
+
+	_ltot( m_ChkLogtofile.GetCheck(), szBuffer, 10);
+	statIniFile.WriteKey(szBuffer,ST_CHKLOGTOFILE,ST_TEST_KEY);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::ReadSettings()
+{
+	long lCount = 0;
+	statIniFile.SetIniFileName(STAT_INI_NAME);
+	*(szBuffer) = (char)0;
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+		CString setting;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_ITERATIONS,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			if (_ttoi(setting)<1)
+				setting=_T("1");
+
+			m_Iterations.SetWindowText(setting);
+		}
+
+
+		setting=statIniFile.GetKeyValue(ST_DELAY,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			int iPos = _ttoi(setting);
+			if (iPos < 100)
+				setting= _T("100");
+
+			if (iPos > 30000)
+				setting= _T("30000");
+
+			m_Delay.SetWindowText(setting);
+		}
+
+	// logging settings
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_LOGFILE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			m_LogFile.SetWindowText(setting);
+		}
+
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_CHKLOGTOFILE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount = _ttoi(setting);
+			m_ChkLogtofile.SetCheck(lCount);
+		}
+
+
+
+	// command file settings
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_CMDFILE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			m_CmdFile.SetWindowText(setting);
+		}
+
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_CHKCMDFILE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount = _ttoi(setting);
+			m_CheckCmdFile.SetCheck(lCount);
+		}
+
+	// raw command settings
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_RAWCMD,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			m_RawCmd.SetWindowText(setting);
+		}
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_CHKRAWCMD,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			m_CheckRawCmd.SetCheck(lCount);
+		}
+
+
+	// snapshot settings
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_SNAPSHOT,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			m_Snapshot.SetWindowText(setting);
+		}
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_CHKSNAP,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			m_CheckSnapshot.SetCheck(lCount);
+		}
+
+
+	// image verification settings
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_FUDGE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			m_Fudge.SetWindowText(setting);
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_REFDIR,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			m_RefDir.SetWindowText(setting);
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_CHKVERIF,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			m_CheckVerification.SetCheck(lCount);
+		}
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_VERIFYREMOVEIMAGES,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			m_RemoveImages.SetWindowText(setting);
+		}
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_VERIFYREMOVEIMAGES,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			m_RemoveImages.SetCheck(lCount);
+		}
+
+
+	// connection settings
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_LINK,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			m_Link.SetCurSel(lCount);
+		}
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_CONNECTIONDLL,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			m_Connection.SetCurSel(lCount);
+		}
+		setting.Empty();
+		lCount=0;
+		setting=statIniFile.GetKeyValue(ST_PLATFORM,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lCount=_ttol(setting);
+			ChangeConnection(lCount);
+		}
+		else
+			ChangeConnection(0);
+		
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_ADDRESS,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			m_Address.SetWindowText(setting);
+		}
+	}
+	// enable/disable accordingly
+	OnCheckcmdfile();
+	OnCheckrawcmd();
+	OnChecksnapshot();
+	OnCheckverification();
+
+	bRunning = false;
+
+	UpdateWindow();
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnOK() 
+{
+	CWaitCursor oWait;
+	SaveSettings();
+	CDialog::OnOK();
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnResetsettings() 
+{
+
+	GetDlgItem(IDC_LOGFILE)->SetWindowText("statdllv4cdecltest.log");
+	m_ChkLogtofile.SetCheck(TRUE);
+	OnChklogtofile();
+
+	GetDlgItem(IDC_ADDRESS)->SetWindowText("");
+	GetDlgItem(IDC_DELAY)->SetWindowText("100");
+	GetDlgItem(IDC_ITERATIONS)->SetWindowText("1");
+	m_Link.SetCurSel(0);
+	m_Connection.SetCurSel(0);
+	ChangeConnection(0);
+
+	UpdateWindow();
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnResettests() 
+{
+	// set some default values
+
+	GetDlgItem(IDC_CMDFILE)->SetWindowText("statdllv4test.txt");
+
+	// tests
+	GetDlgItem(IDC_ITERATIONS)->SetWindowText("1");
+	GetDlgItem(IDC_RAWCMD)->SetWindowText("<B><S><E>");
+	GetDlgItem(IDC_REFDIR)->SetWindowText("refimages");
+	GetDlgItem(IDC_FUDGE)->SetWindowText("20");
+	GetDlgItem(IDC_SNAPSHOT)->SetWindowText("mysnapshot.bmp");
+
+	m_CheckCmdFile.SetCheck(TRUE);
+	m_CheckVerification.SetCheck(TRUE);
+	m_RemoveImages.SetCheck(TRUE);
+	m_CheckSnapshot.SetCheck(TRUE);
+	m_CheckRawCmd.SetCheck(TRUE);
+	OnCheckcmdfile();
+	OnCheckrawcmd();
+	OnChecksnapshot();
+	OnCheckverification();
+
+	UpdateWindow();
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnBrowselog() 
+{
+	// use the folder of the current script as a starting point
+	m_LogFile.GetWindowText(szBuffer, sizeof(szBuffer));
+	CString buf = szBuffer;
+	if (!buf.IsEmpty())
+	{
+		int index = buf.ReverseFind('\\');
+		if (index != -1)
+		{
+			CString folder = buf.Left(index);
+			SetCurrentDirectory(folder.GetBuffer(0));
+		}
+	}
+
+	CFileDialog dlgStatFileOpen(TRUE, 
+								NULL, 
+								NULL, 
+								OFN_PATHMUSTEXIST, 
+								_T("Log Files (*.log)|*.log|All Files (*.*)|*.*||"));
+
+	// new script file to use
+	if (dlgStatFileOpen.DoModal() == IDOK)	//when ok is pressed
+		m_LogFile.SetWindowText(dlgStatFileOpen.GetPathName());
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnChklogtofile() 
+{
+	if (m_ChkLogtofile.GetCheck())
+	{
+		m_LogFile.EnableWindow(TRUE);
+		m_BrowseLog.EnableWindow(TRUE);
+	}
+	else
+	{
+		m_LogFile.EnableWindow(FALSE);
+		m_BrowseLog.EnableWindow(FALSE);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnCheckcmdfile() 
+{
+	if (m_CheckCmdFile.GetCheck())
+	{
+		m_CmdFile.EnableWindow(TRUE);
+		m_BrowseCmdFile.EnableWindow(TRUE);
+	}
+	else
+	{
+		m_CmdFile.EnableWindow(FALSE);
+		m_BrowseCmdFile.EnableWindow(FALSE);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnCheckrawcmd() 
+{
+	if (m_CheckRawCmd.GetCheck())
+	{
+		m_RawCmd.EnableWindow(TRUE);
+	}
+	else
+	{
+		m_RawCmd.EnableWindow(FALSE);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnChecksnapshot() 
+{
+	if (m_CheckSnapshot.GetCheck())
+	{
+		m_Snapshot.EnableWindow(TRUE);
+		m_BrowseSnapshot.EnableWindow(TRUE);
+	}
+	else
+	{
+		m_Snapshot.EnableWindow(FALSE);
+		m_BrowseSnapshot.EnableWindow(FALSE);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnCheckverification() 
+{
+	if (m_CheckVerification.GetCheck())
+	{
+		m_RefDir.EnableWindow(TRUE);
+		m_Fudge.EnableWindow(TRUE);
+		m_BrowseRefImages.EnableWindow(TRUE);
+		m_RemoveImages.EnableWindow(TRUE);
+	}
+	else
+	{
+		m_RefDir.EnableWindow(FALSE);
+		m_Fudge.EnableWindow(FALSE);
+		m_BrowseRefImages.EnableWindow(FALSE);
+		m_RemoveImages.EnableWindow(FALSE);
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnBrowsecmdfile() 
+{
+	// use the folder of the current script as a starting point
+	m_CmdFile.GetWindowText(szBuffer, sizeof(szBuffer));
+	CString buf = szBuffer;
+	if (!buf.IsEmpty())
+	{
+		int index = buf.ReverseFind('\\');
+		if (index != -1)
+		{
+			CString folder = buf.Left(index);
+			SetCurrentDirectory(folder.GetBuffer(0));
+		}
+	}
+
+	CFileDialog dlgStatFileOpen(TRUE, 
+								NULL, 
+								NULL, 
+								OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, 
+								_T("Script Files (*.txt)|*.txt|All Files (*.*)|*.*||"));
+
+	// new script file to use
+	if (dlgStatFileOpen.DoModal() == IDOK)	//when ok is pressed
+		m_CmdFile.SetWindowText(dlgStatFileOpen.GetPathName());
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnBrowsesnapshot() 
+{
+	// use the folder of the current script as a starting point
+	m_Snapshot.GetWindowText(szBuffer, sizeof(szBuffer));
+	CString buf = szBuffer;
+	if (!buf.IsEmpty())
+	{
+		int index = buf.ReverseFind('\\');
+		if (index != -1)
+		{
+			CString folder = buf.Left(index);
+			SetCurrentDirectory(folder.GetBuffer(0));
+		}
+	}
+
+	CFileDialog dlgStatFileOpen(TRUE, 
+								NULL, 
+								NULL, 
+								OFN_PATHMUSTEXIST,
+								_T("Bitmap Files (*.bmp)|*.txt|All Files (*.*)|*.*||"));
+
+	// new script file to use
+	if (dlgStatFileOpen.DoModal() == IDOK)	//when ok is pressed
+		m_Snapshot.SetWindowText(dlgStatFileOpen.GetPathName());
+}
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+void CDlltestDlg::OnBrowserefimages() 
+{
+	TCHAR chName[MAX_PATH];
+
+	BROWSEINFO bi = {0};
+	bi.hwndOwner = m_hWnd;
+	bi.lpszTitle = _T("Please select folder where the reference bitmap files are stored...");
+
+	LPITEMIDLIST lpIDList = ::SHBrowseForFolder(&bi); //now display dialog box 
+
+	::SHGetPathFromIDList(lpIDList, chName); //Converts an item identifier list to a file system path
+
+	m_RefDir.SetWindowText(chName);	//pastes location into edit box
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Set up image verification
+void CDlltestDlg::EnableFields(bool bEnable)
+{
+	GetDlgItem(IDC_LINK)->EnableWindow(bEnable);
+	GetDlgItem(IDC_DELAY)->EnableWindow(bEnable);
+//	GetDlgItem(IDC_ITERATIONS)->EnableWindow(bEnable);
+	GetDlgItem(IDC_RESETSETTINGS)->EnableWindow(bEnable);
+	GetDlgItem(IDC_CONNECTION)->EnableWindow(bEnable);
+	GetDlgItem(IDC_PLATFORM)->EnableWindow(bEnable);
+	GetDlgItem(IDC_ADDRESS)->EnableWindow(bEnable);
+	GetDlgItem(IDC_CHKLOGTOFILE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_LOGFILE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_BROWSELOG)->EnableWindow(bEnable);
+
+	GetDlgItem(IDC_CHECKRAWCMD)->EnableWindow(bEnable);
+	GetDlgItem(IDC_RAWCMD)->EnableWindow(bEnable);
+	GetDlgItem(IDC_CHECKCMDFILE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_CMDFILE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_BROWSECMDFILE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_CHECKSNAPSHOT)->EnableWindow(bEnable);
+	GetDlgItem(IDC_SNAPSHOT)->EnableWindow(bEnable);
+	GetDlgItem(IDC_BROWSESNAPSHOT)->EnableWindow(bEnable);
+	GetDlgItem(IDC_CHECKVERIFICATION)->EnableWindow(bEnable);
+	GetDlgItem(IDC_OVERWRITE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_REFDIR)->EnableWindow(bEnable);
+	GetDlgItem(IDC_BROWSEREFIMAGES)->EnableWindow(bEnable);
+	GetDlgItem(IDC_FUDGE)->EnableWindow(bEnable);
+	GetDlgItem(IDC_RESETTESTS)->EnableWindow(bEnable);
+
+	if (bEnable)
+	{
+		OnChklogtofile();
+		OnCheckcmdfile();
+		OnCheckrawcmd();
+		OnChecksnapshot();
+		OnCheckverification();
+
+		m_Run.SetWindowText(_T("Run"));
+		bRunning = false;
+	}
+	else
+	{
+		m_Run.SetWindowText(_T("Stop"));
+		bRunning = true;
+	}
+
+	UpdateWindow();
+}
+
+void CDlltestDlg::GetLogFolder(CString& logFileFolder) const
+{
+	// Get the log file folder location.
+	// If this is specified in the 'ini' file then we
+	// use the specified location.
+	// if it is not specified in the 'ini' file then we
+	// use a default value.
+
+	logFileFolder.Empty();
+
+	if(statIniFile.SectionExists(ST_TEST_KEY))
+	{
+		CString setting;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_LOGFILEPATH,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			logFileFolder = setting;
+	}
+
+	if(logFileFolder.IsEmpty())
+	{
+		logFileFolder = STAT_LOGFILEPATH_VALUE;
+	}
+}
+
+void CDlltestDlg::GetLogFilePath(const char* logFileName, CString& logFilePath) const
+{
+	// There are a mixture of method calls in this window
+	// that specify logging.
+	// Also, in this window we allow the user to specify a file
+	// name or a full path in the interface.
+	// Because of this we have a mix of specifying log file details
+	// with or without a full path.
+	// This function will create a full path for the log file from the
+	// name passed.  If the name passed already has a folder
+	// specified (at least on '\' characters) then we copy
+	// that to the out parameter.
+	// If the name passed does not have a folder specification
+	// within it then we prepend the log file folder.
+
+	static const char folder = '\\';
+
+	if(NULL != ::strchr(logFileName, folder))
+	{
+		logFilePath = logFileName;
+	}
+	else
+	{
+		GetLogFolder(logFilePath);
+		logFilePath += "\\";
+		logFilePath += logFileName;
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/src/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// stdafx.cpp : source file that includes just the standard includes
+//	dlltest.pch will be the pre-compiled header
+//	stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltester/src/utils.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,519 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+// CUtils.cpp : Handy bits and pieces for apps
+//
+
+#include "stdafx.h"
+#include <windows.h>
+#include <tchar.h>
+#include "Utils.h"
+
+CUtils::CUtils()
+: m_hMutex((HANDLE)0)
+{
+    // open the Service Control Manager
+    hSCM = OpenSCManager(NULL,						// local machine
+                         NULL,						// ServicesActive database
+                         SC_MANAGER_ALL_ACCESS);	// full access
+}
+
+CUtils::~CUtils()
+{
+    if (hSCM)
+	    CloseServiceHandle(hSCM);
+
+	if (m_hMutex)
+		CloseHandle(m_hMutex);
+}
+
+
+// attempts to create a mutex for this process.
+// if it fails, another process of the same name is already running
+bool CUtils::AlreadyRunning(LPCTSTR szAppName)
+{
+	m_hMutex = CreateMutex(NULL, FALSE, szAppName);
+	if ((!m_hMutex) || (WaitForSingleObject( m_hMutex, 0 ) == WAIT_TIMEOUT))
+    {
+		return true;   
+    }
+
+	return false;
+}
+
+
+// invokes an application then waits for it to exit
+bool CUtils::CallProcessAndWait(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory, bool bRunMinimised)
+{
+	bool valid = false;
+	STARTUPINFO startInfo = {0};
+	startInfo.cb = sizeof(STARTUPINFO);
+	retCode = -1;
+
+	// run window minimised and not active
+	if (bRunMinimised)
+	{
+		startInfo.dwFlags = STARTF_USESHOWWINDOW;
+		startInfo.wShowWindow = SW_SHOWMINIMIZED | SW_SHOWMINNOACTIVE;
+	}
+
+	PROCESS_INFORMATION procInfo = {0};
+
+	// event attributes for the child process
+	SECURITY_ATTRIBUTES eventAttr;
+	eventAttr.nLength = sizeof(eventAttr);
+	eventAttr.lpSecurityDescriptor = NULL;
+	eventAttr.bInheritHandle = TRUE;
+
+	// NOTE: if passing a command line, include the application name in szCommandLine and pass NULL for szApplication
+	if (CreateProcess(szApplication, szCommandLine, NULL, NULL, FALSE, NULL, NULL,
+					  szDirectory, &startInfo, &procInfo))
+	{
+		if (WAIT_OBJECT_0 == WaitForSingleObject(procInfo.hProcess, INFINITE))
+		{
+			GetExitCodeProcess(procInfo.hProcess, &retCode);
+			CloseHandle(procInfo.hThread);
+			CloseHandle(procInfo.hProcess);
+			valid = true;
+		}
+	}
+	else
+		_GetWindowsError();
+
+	return valid;
+}
+
+
+bool CUtils::CallProcess(LPCTSTR szApplication, LPTSTR szCommandLine, LPCTSTR szDirectory)
+{
+	bool valid = false;
+	STARTUPINFO startInfo = {0};
+	startInfo.cb = sizeof(STARTUPINFO);
+
+	PROCESS_INFORMATION procInfo = {0};
+
+	// event attributes for the child process
+	SECURITY_ATTRIBUTES eventAttr;
+	eventAttr.nLength = sizeof(eventAttr);
+	eventAttr.lpSecurityDescriptor = NULL;
+	eventAttr.bInheritHandle = TRUE;
+
+	if (CreateProcess(szApplication, szCommandLine, NULL, NULL, FALSE, NULL, NULL,
+					  szDirectory, &startInfo, &procInfo))
+	{
+		CloseHandle(procInfo.hThread);
+		CloseHandle(procInfo.hProcess);
+		valid = true;
+	}
+	else
+		_GetWindowsError();
+
+	return valid;
+}
+
+// requests an NT service to perform a particular request
+bool CUtils::ServiceRequest(const char *szServiceName, const unsigned int iRequest)
+{
+	bool valid = false;
+
+    if (hSCM)
+	{
+		switch(iRequest)
+		{
+		case REQ_START:
+			if (Validate(hSCM, szServiceName, SERVICE_INACTIVE))
+			{
+				SC_HANDLE hService = OpenService(hSCM, szServiceName, SERVICE_ALL_ACCESS);
+				if (hService) 
+				{
+					DealWithDependentServices(szServiceName, iRequest);
+
+					if (StartService(hService, 0, NULL))
+						valid = true;
+
+					CloseServiceHandle(hService);
+				}
+				else
+					_GetWindowsError();
+			}
+			else
+			{
+				valid = true;	// already started
+			}
+			break;
+		case REQ_STOP:
+			if (Validate(hSCM, szServiceName, SERVICE_ACTIVE))
+			{
+				SC_HANDLE hService = OpenService(hSCM, szServiceName, SERVICE_STOP);
+				if (hService) 
+				{
+					DealWithDependentServices(szServiceName, iRequest);
+
+					SERVICE_STATUS status;
+					if (ControlService(hService, SERVICE_CONTROL_STOP, &status))
+						valid = true;
+
+					CloseServiceHandle(hService);
+				}
+				else
+					_GetWindowsError();
+			}
+			else
+			{
+				valid = true;	// already stopped
+			}
+			break;
+		default:
+			break;
+		};
+
+    }
+	return valid;
+}
+
+
+
+// recurses through a directory structure, performing an action on the files/directories within
+unsigned int CUtils::RecurseDir(const char *szDirectory, const unsigned int iCommand)
+{
+	iFileCommand = iCommand;
+	iFileCount = 0;
+
+	Recurse(szDirectory);
+
+	return iFileCount;
+}
+
+
+// adds a backslash to a path if it doesn't already have one
+void CUtils::AddSlash(char *szPath)
+{
+	if (*(szPath + strlen(szPath) - 1) != '\\')
+		strcat(szPath, "\\");
+}
+
+
+bool CUtils::ListServices(DWORD dwState)
+{
+	return Validate(hSCM, NULL, dwState, true);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Private Methods
+//
+////////////////////////////////////////////////////////////////////////////////////////////////
+
+bool CUtils::Validate(SC_HANDLE hSCM, const char *szServiceName, DWORD dwState, bool bDisplayOnly)
+{
+	bool valid = false;
+	DWORD dwBytes = 0;
+	DWORD dwNumServices = 0;
+	DWORD dwResumeHandle = 0;
+	static ENUM_SERVICE_STATUS status[200];
+
+	// get list of services in particular state
+	if (EnumServicesStatus(hSCM,							// handle
+						 SERVICE_WIN32,						// service
+						 dwState,							// state
+						 (ENUM_SERVICE_STATUS *)status,		// returned info
+						 200 * sizeof(ENUM_SERVICE_STATUS),	// length of buffer
+						 &dwBytes,							// returned length
+						 &dwNumServices,					// number services returned
+						 &dwResumeHandle))					// point to continue
+	{
+		if (bDisplayOnly)
+		{
+			printf("\n\nServices\n========\n\n");
+		}
+
+		for (DWORD i=0;i<dwNumServices;i++)
+		{
+			if (bDisplayOnly)
+			{
+				if (status[i].ServiceStatus.dwCurrentState == SERVICE_RUNNING)
+					printf("STARTED  %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+				else if (status[i].ServiceStatus.dwCurrentState == SERVICE_STOPPED)
+					printf("STOPPED  %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+				else if (status[i].ServiceStatus.dwCurrentState == SERVICE_PAUSED)
+					printf("PAUSED   %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+				else
+					printf("PENDING  %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+			}
+			else
+			{
+				if (stricmp(status[i].lpServiceName, szServiceName) == 0)
+				{
+					valid = true;
+					break;
+				}
+			}
+		}
+	}
+
+	// check the driver list, just in case it's in there...
+	if (!valid)
+	{
+		if (EnumServicesStatus(hSCM,							// handle
+							 SERVICE_DRIVER,					// driver
+							 dwState,							// state
+							 (ENUM_SERVICE_STATUS *)status,		// returned info
+							 200 * sizeof(ENUM_SERVICE_STATUS),	// length of buffer
+							 &dwBytes,							// returned length
+							 &dwNumServices,					// number services returned
+							 &dwResumeHandle))					// point to continue
+		{
+			if (bDisplayOnly)
+			{
+				printf("\n\nDrivers\n=======\n\n");
+			}
+
+			for (DWORD i=0;i<dwNumServices;i++)
+			{
+				if (bDisplayOnly)
+				{
+					if (status[i].ServiceStatus.dwCurrentState == SERVICE_RUNNING)
+						printf("STARTED  %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+					else if (status[i].ServiceStatus.dwCurrentState == SERVICE_STOPPED)
+						printf("STOPPED  %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+					else if (status[i].ServiceStatus.dwCurrentState == SERVICE_PAUSED)
+						printf("PAUSED   %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+					else
+						printf("PENDING  %s  (%s)\n", status[i].lpDisplayName, status[i].lpServiceName);
+				}
+				else
+				{
+					if (stricmp(status[i].lpServiceName, szServiceName) == 0)
+					{
+						valid = true;
+						break;
+					}
+				}
+			}
+		}
+	}
+
+	return valid;
+}
+
+
+void
+CUtils::Recurse(const char * rootDir)
+{
+    char fullname[MAX_PATH + 1];
+	HANDLE hFind;
+	
+	sprintf( fullname, "%s\\*", rootDir );
+	hFind = FindFirstFile(fullname, &ffd);
+
+	if(hFind != INVALID_HANDLE_VALUE)
+	{
+		do
+		{
+	        sprintf( fullname, "%s\\%s", rootDir, ffd.cFileName );
+
+			// directory so recurse into it
+			if(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+			{
+				// ignore current and previous dirs
+				if ((stricmp (ffd.cFileName, ".") != 0) && (strcmp (ffd.cFileName, "..") != 0))
+				{
+					Recurse(fullname);
+
+					// remove it
+					if (iFileCommand == DELETEALL)
+						if (RemoveDirectory(fullname))
+							iFileCount++;
+				}
+			}
+			else
+			{ 
+				// remove now empty directory
+				if (iFileCommand == DELETEALL || iFileCommand == DELETEFILESONLY)
+					if (DeleteFile( fullname ))
+						iFileCount++;
+
+				// clear the attributes
+				if (iFileCommand == REMOVEALLATTRIBUTES)
+					if (SetFileAttributes(fullname, FILE_ATTRIBUTE_NORMAL))
+						iFileCount++;
+			}
+		}
+		while(FindNextFile(hFind, &ffd));
+
+		FindClose( hFind );
+	}
+
+	// remove this root now we are finished with it
+	if (iFileCommand == DELETEALL)
+		if (RemoveDirectory(rootDir))
+			iFileCount++;
+}
+
+
+void
+CUtils::DealWithDependentServices(const char *szServiceName, const unsigned int iRequest)
+{
+	DWORD dwBytes = 0;
+	DWORD dwNumServices = 0;
+	DWORD dwResumeHandle = 0;
+	ENUM_SERVICE_STATUS status[100];
+
+	// service may have dependent services so stop them first
+	SC_HANDLE hService = OpenService(hSCM, szServiceName, SERVICE_ENUMERATE_DEPENDENTS);
+	if (hService) 
+	{
+		if (EnumDependentServices(hService, 
+								SERVICE_ACTIVE,
+								(ENUM_SERVICE_STATUS *)status,		// returned info
+								100 * sizeof(ENUM_SERVICE_STATUS),	// length of buffer
+								&dwBytes,							// returned length
+								&dwNumServices))					// number services returned
+		{
+			for (DWORD i=0;i<dwNumServices;i++)
+			{
+				// recurse until we stop the last dependant
+				ServiceRequest(status[i].lpServiceName, iRequest);
+			}
+		}
+
+		CloseServiceHandle(hService);
+
+		// if there were dependents, allow some time register service stops
+		if (dwNumServices)
+			Sleep(2000);
+	}
+	else
+		_GetWindowsError();
+}
+
+void
+CUtils::_GetWindowsError()
+{
+	LPVOID lpSysError;
+	DWORD dwRet = GetLastError();
+
+	FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+				   NULL,
+				   dwRet,
+				   MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+				   ( LPTSTR ) &lpSysError,
+				   0,
+				   NULL );
+
+	if (lpSysError)
+		_tcscpy(szError, ( LPTSTR )lpSysError);
+
+	LocalFree( lpSysError );
+}
+
+LPTSTR
+CUtils::GetWindowsError()
+{
+	return szError;
+}
+
+LPTSTR
+CUtils::GetWindowsErrorNow()
+{
+	_GetWindowsError();
+	return szError;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Trim the text of unwanted characters
+//
+void
+CUtils::TrimTabsCRAndWhitespace(char *szBuffer)
+{
+	// strip any unwanted chars off the end of each value
+	char *ptr = szBuffer + strlen(szBuffer) - 1;
+	if (ptr && (*ptr))
+	{
+		while ((*ptr) == '\r' || (*ptr) == '\n' || (*ptr) == '\t' || (*ptr) == ' ')
+			ptr--;
+
+		*(ptr + 1) = (char)0;
+	}
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Trim the buffered text to the first EOL and adjust the file pointer to suit
+// If EOL's included, include all up to the next occurance of text or EOF
+//
+int
+CUtils::TrimBufferToFirstEOL(HANDLE mmphndl, char *szBuffer, bool bIncludeCR)
+{
+	int count = 0;
+	int length = strlen(szBuffer);
+	int actualend = 0;
+
+	// move to first CR
+	while (*(szBuffer + count) && (*(szBuffer + count) != '\r') && (*(szBuffer + count) != '\n'))
+		count++;
+
+
+	// move to after CRs
+	actualend = count;
+	while ((*(szBuffer + actualend) == '\r') || (*(szBuffer + actualend) == '\n'))
+		actualend++;
+
+	if (count)
+	{
+		// include the CRs
+		if (bIncludeCR)
+			count = actualend;
+
+		// terminate the string at our desired point
+		*(szBuffer + count) = (char)0;
+
+		// set file pointer accordingly
+		if (mmphndl)
+			SetFilePointer(mmphndl, 0 - (length - actualend), NULL, FILE_CURRENT);
+	}
+
+	return count;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Trim the buffered text to the last EOL and adjust the file pointer to suit
+//
+void
+CUtils::TrimBufferToLastEOL(HANDLE mmphndl, char *szBuffer)
+{
+	// move back to last CR
+	char *end = szBuffer + strlen(szBuffer) - 1;
+	while ((end != szBuffer) && (*end != '\r') && (*end != '\n'))
+		end--;
+
+	// NULL-terminate line and adjust file pointer
+	if (end != (szBuffer + strlen(szBuffer) - 1))
+	{
+		int diff = (szBuffer + strlen(szBuffer) - 1) - end;
+		(*end) = (char)0;
+
+		// back up the file pointer to the end of the last line
+		if (mmphndl)
+			SetFilePointer(mmphndl, 0 - diff, NULL, FILE_CURRENT);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/dlltest_multithreaded.dep	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,26 @@
+# Microsoft Developer Studio Generated Dependency File, included by dlltest_multithreaded.mak
+
+.\src\dlltest_multithreaded.cpp : \
+	"..\..\source\lib\inc\INI.h"\
+	".\inc\dlltest_worker.h"\
+	".\inc\STATTask.h"\
+	".\inc\StdAfx.h"\
+	
+
+.\src\dlltest_worker.cpp : \
+	"..\..\source\lib\inc\INI.h"\
+	"..\..\source\lib\inc\statcommon.h"\
+	"..\..\source\lib\inc\statexp.h"\
+	".\inc\dlltest_worker.h"\
+	".\inc\STATTask.h"\
+	".\inc\StdAfx.h"\
+	
+
+.\src\STATTask.cpp : \
+	".\inc\STATTask.h"\
+	".\inc\StdAfx.h"\
+	
+
+.\src\StdAfx.cpp : \
+	".\inc\StdAfx.h"\
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/dlltest_multithreaded.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,143 @@
+# Microsoft Developer Studio Project File - Name="dlltest_multithreaded" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=dlltest_multithreaded - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "dlltest_multithreaded.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "dlltest_multithreaded.mak" CFG="dlltest_multithreaded - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "dlltest_multithreaded - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "dlltest_multithreaded - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "dlltest_multithreaded"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "dlltest_multithreaded - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fr /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\lib\STATDll.lib ..\..\lib\STAT.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"Release\STATDllTestMT.exe" /OPT:NOREF
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=copy release\STATDllTestMT.exe \epoc32\tools\stat\STATDllTestMT.exe
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "dlltest_multithreaded - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\lib\STATDlld.lib ..\..\lib\STATd.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"Debug\STATDllTestMTd.exe"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "dlltest_multithreaded - Win32 Release"
+# Name "dlltest_multithreaded - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\dlltest_multithreaded.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\dlltest_multithreaded.dep
+# End Source File
+# Begin Source File
+
+SOURCE=.\dlltest_multithreaded.mak
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\dlltest_worker.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\STATTask.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\inc\dlltest_worker.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\lib\inc\statcommon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\lib\inc\statexp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\STATTask.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inc\StdAfx.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/dlltest_multithreaded.mak	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,242 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on dlltest_multithreaded.dsp
+!IF "$(CFG)" == ""
+CFG=dlltest_multithreaded - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to dlltest_multithreaded - Win32 Debug.
+!ENDIF 
+
+!IF "$(CFG)" != "dlltest_multithreaded - Win32 Release" && "$(CFG)" != "dlltest_multithreaded - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "dlltest_multithreaded.mak" CFG="dlltest_multithreaded - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "dlltest_multithreaded - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "dlltest_multithreaded - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+!ERROR An invalid configuration is specified.
+!ENDIF 
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "dlltest_multithreaded - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\STATDllTestMT.exe" "$(OUTDIR)\dlltest_multithreaded.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\dlltest_multithreaded.obj"
+	-@erase "$(INTDIR)\dlltest_multithreaded.pch"
+	-@erase "$(INTDIR)\dlltest_multithreaded.sbr"
+	-@erase "$(INTDIR)\dlltest_worker.obj"
+	-@erase "$(INTDIR)\dlltest_worker.sbr"
+	-@erase "$(INTDIR)\STATTask.obj"
+	-@erase "$(INTDIR)\STATTask.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(OUTDIR)\dlltest_multithreaded.bsc"
+	-@erase "$(OUTDIR)\STATDllTestMT.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest_multithreaded.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\dlltest_multithreaded.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\dlltest_multithreaded.sbr" \
+	"$(INTDIR)\dlltest_worker.sbr" \
+	"$(INTDIR)\STATTask.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\dlltest_multithreaded.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\lib\STATDll.lib ..\..\lib\STAT.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"$(OUTDIR)\STATDllTestMT.exe" /OPT:NOREF 
+LINK32_OBJS= \
+	"$(INTDIR)\dlltest_multithreaded.obj" \
+	"$(INTDIR)\dlltest_worker.obj" \
+	"$(INTDIR)\STATTask.obj" \
+	"$(INTDIR)\StdAfx.obj"
+
+"$(OUTDIR)\STATDllTestMT.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+SOURCE="$(InputPath)"
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+$(DS_POSTBUILD_DEP) : "$(OUTDIR)\STATDllTestMT.exe" "$(OUTDIR)\dlltest_multithreaded.bsc"
+   copy release\STATDllTestMT.exe \epoc32\tools\stat\STATDllTestMT.exe
+	echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ELSEIF  "$(CFG)" == "dlltest_multithreaded - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "$(OUTDIR)\STATDllTestMTd.exe" "$(OUTDIR)\dlltest_multithreaded.bsc"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\dlltest_multithreaded.obj"
+	-@erase "$(INTDIR)\dlltest_multithreaded.pch"
+	-@erase "$(INTDIR)\dlltest_multithreaded.sbr"
+	-@erase "$(INTDIR)\dlltest_worker.obj"
+	-@erase "$(INTDIR)\dlltest_worker.sbr"
+	-@erase "$(INTDIR)\STATTask.obj"
+	-@erase "$(INTDIR)\STATTask.sbr"
+	-@erase "$(INTDIR)\StdAfx.obj"
+	-@erase "$(INTDIR)\StdAfx.sbr"
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(OUTDIR)\dlltest_multithreaded.bsc"
+	-@erase "$(OUTDIR)\STATDllTestMTd.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MTd /W3 /GX /Zi /Od /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest_multithreaded.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\dlltest_multithreaded.bsc" 
+BSC32_SBRS= \
+	"$(INTDIR)\dlltest_multithreaded.sbr" \
+	"$(INTDIR)\dlltest_worker.sbr" \
+	"$(INTDIR)\STATTask.sbr" \
+	"$(INTDIR)\StdAfx.sbr"
+
+"$(OUTDIR)\dlltest_multithreaded.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+    $(BSC32) @<<
+  $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\lib\STATDlld.lib ..\..\lib\STATd.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"$(OUTDIR)\STATDllTestMTd.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\dlltest_multithreaded.obj" \
+	"$(INTDIR)\dlltest_worker.obj" \
+	"$(INTDIR)\STATTask.obj" \
+	"$(INTDIR)\StdAfx.obj"
+
+"$(OUTDIR)\STATDllTestMTd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("dlltest_multithreaded.dep")
+!INCLUDE "dlltest_multithreaded.dep"
+!ELSE 
+!MESSAGE Warning: cannot find "dlltest_multithreaded.dep"
+!ENDIF 
+!ENDIF 
+
+
+!IF "$(CFG)" == "dlltest_multithreaded - Win32 Release" || "$(CFG)" == "dlltest_multithreaded - Win32 Debug"
+SOURCE=.\src\dlltest_multithreaded.cpp
+
+"$(INTDIR)\dlltest_multithreaded.obj"	"$(INTDIR)\dlltest_multithreaded.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dlltest_multithreaded.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\dlltest_worker.cpp
+
+"$(INTDIR)\dlltest_worker.obj"	"$(INTDIR)\dlltest_worker.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dlltest_multithreaded.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\STATTask.cpp
+
+"$(INTDIR)\STATTask.obj"	"$(INTDIR)\STATTask.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dlltest_multithreaded.pch"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\StdAfx.cpp
+
+!IF  "$(CFG)" == "dlltest_multithreaded - Win32 Release"
+
+CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest_multithreaded.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\dlltest_multithreaded.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF  "$(CFG)" == "dlltest_multithreaded - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MTd /W3 /GX /Zi /Od /I ".\inc" /I "..\..\source\lib\inc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\dlltest_multithreaded.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\dlltest_multithreaded.pch" : $(SOURCE) "$(INTDIR)"
+	$(CPP) @<<
+  $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF 
+
+
+!ENDIF 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:  
+//
+
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+
+* which accompanies this distribution, and is available
+
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+
+TOOLS
+
+PRJ_MMPFILES
+// Extension Makefile
+makefile statdlltestermt.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/group/statdlltestermt.mk	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,82 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+# which accompanies this distribution, and is available
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# Typically C:\apps\MSVC6\VC98\Bin
+COMPILER=nmake
+
+# Called with
+#
+# $(PLATFORM) = TOOLS
+# $(CFG)      = DEB, REL
+
+BLD	:  
+	@echo BLD called with $(PLATFORM)$(CFG)
+	
+# release version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (dlltester_multithreaded)
+	"$(COMPILER)" /A /NOLOGO /f "dlltest_multithreaded.mak" CFG="dlltest_multithreaded - Win32 Release"
+	
+	echo ** DLL MULTI-THREADED TESTER (RELEASE) compiled successfully
+
+!endif
+
+# debug version
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+
+# Go up one level to access the makefile
+	cd ".."
+
+# Execute the command line compiler (dlltester_multithreaded)
+	"$(COMPILER)" /A /NOLOGO /f "dlltest_multithreaded.mak" CFG="dlltest_multithreaded - Win32 Debug"
+	
+	echo ** DLL MULTI-THREADED TESTER (DEBUG) compiled successfully
+
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	-rmdir "..\Release" /q /s
+!endif
+
+CLEAN :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "DEB"
+	-rmdir "..\Debug" /q /s
+!endif
+
+RELEASABLES :
+!if "$(PLATFORM)"=="TOOLS" && "$(CFG)" == "REL"
+	@echo $(EPOCROOT)epoc32\tools\STAT\STATDllTestMT.exe
+!endif
+
+SAVESPACE : BLD
+
+MAKMAKE LIB CLEANLIB RESOURCE FREEZE FINAL : 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/inc/dlltest_worker.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     include file for worker class								*
+*/
+
+
+
+
+#include <stat.h>
+#include <stattask.h>
+#include <ini.h>
+#include "STATTask.h"
+
+#define MAX_CONNECTIONS 25
+#define X_MAXENTRYLEN MAX_PATH + 1
+/////////////////////////////////////////////////////////////////////////
+// Task initialisation info
+typedef struct STATTaskInfo
+{
+	int iterations;
+	int delay;
+	long verify;
+	long removeImages;
+	int fudge;
+	TCHAR *pLogfile;
+	TCHAR *pCommand;
+	TCHAR *pSnapshot;
+	TCHAR *pRefdir;
+	STATCONNECTTYPE connectType;
+	char szAddress[256];
+} STATTASKINFO;
+
+
+/////////////////////////////////////////////////////////////////////////
+// Main worker class
+class dlltest_worker
+{
+public:
+	dlltest_worker();
+	~dlltest_worker();
+	bool Prepare();
+	int WorkPending();
+	bool Run();
+	void Finish();
+
+private:
+	void GetTaskInfo(int index);
+	void ParseConnection(char *pConnection, STATCONNECTTYPE *pType, char **ppAddress);
+
+	STATTask *pDeviceTask[MAX_CONNECTIONS];				// device connections
+	STATTASKINFO TaskInfo[MAX_CONNECTIONS];				// info associated with device connections
+	char szConections[MAX_CONNECTIONS][X_MAXENTRYLEN];	// device connection configuration
+	int iterations;										// number of times to run test
+	int delay;											// command delay
+	long lConectionCount;								// number of device connections on this PC
+	long verify;										// verify images?
+	long removeImages;									// remove existing images before verification?
+	int fudge;											// percentage image difference
+	TCHAR szLogfile[256];								// log file
+	TCHAR szCommand[2048];								// command to execute
+	TCHAR szSnapshot[256];								// file name of saved snapshot
+	TCHAR szRefdir[256];								// location of reference images
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/inc/stattask.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#ifndef STATTASK_H
+#define STATTASK_H
+
+// pointer to our thread procedure
+typedef DWORD (WINAPI *ThreadProc) (LPVOID);
+
+class STATTask
+{
+public:
+	STATTask(const ThreadProc pFunc, void *pMember, char *pConection = NULL);
+	~STATTask();
+	bool Start();
+	bool StillActive(DWORD timeout = 5);
+	bool Kill();
+	void * Member() { return theMember; }
+	char * Connection() { return szConection; }
+
+private:
+	HANDLE hThreadHandle;				// handle to this thread
+	ThreadProc pfThreadProc;
+	void *theMember;					// pointer to associated object
+	char *szConection;					// connection string
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/inc/stdafx.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+
+#if !defined(AFX_STDAFX_H__50FF2A1F_EA69_11D6_BC86_00B0D065107F__INCLUDED_)
+#define AFX_STDAFX_H__50FF2A1F_EA69_11D6_BC86_00B0D065107F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <afx.h>
+#include <oaidl.h>
+#include <afxwin.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__50FF2A1F_EA69_11D6_BC86_00B0D065107F__INCLUDED_)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/src/dlltest_multithreaded.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "dlltest_worker.h"
+
+int main(int argc, char* argv[])
+{
+	dlltest_worker oWorker;
+	if (oWorker.Prepare())
+	{
+		int count = 0;
+		while (count = oWorker.WorkPending())
+		{
+			printf("Waiting for %d threads...\r\n", count);
+			Sleep(3000);
+		}
+
+		oWorker.Finish();
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/src/dlltest_worker.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,372 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include <statcommon.h>
+#include "dlltest_worker.h"
+#include <stattask.h>
+#include <statexp.h>
+
+//////////////////////////////////////////////////////////////////////////
+// Write the contents of a screenshot out to file
+bool WriteBitmap(char *file, TBitmapFileHeader *fileheader, TBitmapInfoHeader * bmpHeader, char *bmpBits, unsigned long lSize)
+{
+	bool success = false;
+
+	// write the whole lot out to file
+	HANDLE infile;
+	if (INVALID_HANDLE_VALUE != (infile = CreateFile(file,
+										   GENERIC_WRITE,
+										   0, 
+										   NULL, 
+										   CREATE_ALWAYS,
+										   FILE_ATTRIBUTE_NORMAL,
+										   0)))
+	{
+		DWORD dwBytesWritten = 0;
+
+		// write the file info
+		if (WriteFile(infile, (LPVOID *)fileheader, sizeof(TBitmapFileHeader), &dwBytesWritten, NULL) &&
+			dwBytesWritten == sizeof(TBitmapFileHeader))
+		{
+			// write the bitmap info
+			if (WriteFile(infile, (LPVOID *)bmpHeader, sizeof(TBitmapInfoHeader), &dwBytesWritten, NULL) &&
+				dwBytesWritten == sizeof(TBitmapInfoHeader))
+			{
+				// write the bitmap data
+				if (WriteFile(infile, (LPVOID *)bmpBits, lSize, &dwBytesWritten, NULL) &&
+					dwBytesWritten == lSize)
+				{
+					success = true;
+				}
+			}
+		}
+
+		CloseHandle(infile);
+	}
+
+	return success;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+// This thread function handles the processing of a script by a single
+// connection
+DWORD WINAPI
+STATDeviceThreadProcedure(LPVOID lpParameter)
+{
+	DWORD valid = true;
+
+	STATTASKINFO *pWorker = (STATTASKINFO *)lpParameter;
+	if (pWorker)
+	{
+		int h = ConnectMT(pWorker->connectType, pWorker->szAddress);
+		if (h)
+		{
+			printf("Version %s\r\n", Version());
+			valid = SetCommandLogging(h, pWorker->pLogfile, NULL);
+			valid = SetCommandDelay(h, pWorker->delay);
+
+			if (valid)
+				if (pWorker->verify)
+					valid = SetImageVerification(h, pWorker->pRefdir, pWorker->removeImages?true:false, pWorker->fudge);
+
+			if (valid)
+			{
+				for (int i=0;i<pWorker->iterations;i++)
+				{
+					//valid = SendRawCommand(h, pWorker->pCommand);
+					valid = SendCommandFile(h, pWorker->pCommand);
+					if (!valid)
+					{
+						printf("[%d] bad command(%s)\r\n", h, GetError(h));
+						break;
+					}
+
+					/*struct TBitmapFileHeader *pFile = NULL;
+					struct TBitmapInfoHeader *pInfo = NULL;
+					char *pData = NULL;
+					unsigned long lSize = 0;
+
+					valid = GetSnapshot(h, &pFile, &pInfo, &pData, &lSize);
+					if (valid)
+						valid = WriteBitmap(pWorker->pSnapshot, pFile, pInfo, pData, lSize);
+					if (!valid)
+					{
+						printf("[%d] bad command(%s)\r\n", h, GetError(h));
+						break;
+					}*/
+				}
+			}
+
+			Disconnect(h);
+		}
+		else
+			printf("Bad connection (%s)\r\n", GetError());
+	}
+	else
+		printf("Bad parameter\r\n");
+
+	return (DWORD)valid;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Constructor
+dlltest_worker::dlltest_worker()
+: iterations(1), delay(100), lConectionCount(0), verify(0), removeImages(0), fudge(0)
+{
+	memset(szLogfile, 0, sizeof(szLogfile));
+	memset(szCommand, 0, sizeof(szCommand));
+	memset(szSnapshot, 0, sizeof(szSnapshot));
+	memset(szRefdir, 0, sizeof(szRefdir));
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Destructor
+dlltest_worker::~dlltest_worker()
+{
+	Finish();
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Get the settings and start the worker threads
+bool dlltest_worker::Prepare()
+{
+	CStatIniFile statIniFile;
+	statIniFile.SetIniFileName(STAT_INI_NAME);
+	if(statIniFile.SectionExists(ST_TEST_KEY) )
+	{
+		CString setting;
+		TCHAR szBuffer[2048];
+		long lCount = 0;
+		*(szBuffer) = (TCHAR)0;
+
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_ITERATIONS,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			if (_ttoi(setting)<1)
+				setting=_T("1");
+
+			iterations=_ttoi(setting);
+		}
+
+		setting=statIniFile.GetKeyValue(ST_DELAY,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			int iPos = _ttoi(setting);
+			if (iPos < 100)
+				setting= _T("100");
+
+			if (iPos > 30000)
+				setting= _T("30000");
+
+			delay=_ttoi(setting);
+		}
+
+	// logging settings
+		strcpy(szLogfile,(LPCSTR)statIniFile.GetKeyValue(ST_LOGFILE,ST_TEST_KEY));
+
+	// raw command
+		strcpy(szCommand,(LPCSTR)statIniFile.GetKeyValue(ST_CMDFILE,ST_TEST_KEY));
+
+	// snapshot settings
+		strcpy(szSnapshot,(LPCSTR)statIniFile.GetKeyValue(ST_SNAPSHOT,ST_TEST_KEY));
+
+	// image verification settings
+		verify=0;
+		setting=statIniFile.GetKeyValue(ST_CHKVERIF,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			verify=_ttol(setting);
+
+		}
+		removeImages=0;
+		setting=statIniFile.GetKeyValue(ST_VERIFYREMOVEIMAGES,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			removeImages=_ttol(setting);
+
+		}
+		strcpy(szRefdir,(LPCSTR)	statIniFile.GetKeyValue(ST_REFDIR,ST_TEST_KEY));
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_FUDGE,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+			fudge = _ttoi(setting);
+
+	// connection settings
+
+		lConectionCount = 0;
+		setting.Empty();
+		setting=statIniFile.GetKeyValue(ST_CONNECTIONIDX,ST_TEST_KEY);
+		if(!setting.IsEmpty())
+		{
+			lConectionCount = _ttol(setting);
+
+		}
+		if(statIniFile.SectionExists(ST_CONNECTION_LIST) )
+		{
+			for( int i=0;i<lConectionCount;++i)
+			{
+				TCHAR buf[6];
+				_ltot(i+1, buf, 10);
+				setting.Empty();
+				setting=statIniFile.GetKeyValue(buf,ST_CONNECTION_LIST);
+				if(!setting.IsEmpty())
+					strcpy(szConections[i],(LPCSTR)(setting));
+			}
+		}
+	}
+	// turn on high-level logging
+	SetConnectionLogging(szLogfile);
+
+	// start the threads
+	int i;
+	for (i=0;i<lConectionCount;i++)
+	{
+		GetTaskInfo(i);
+		pDeviceTask[i] = new STATTask(STATDeviceThreadProcedure, &TaskInfo[i]);
+		if (pDeviceTask[i])
+		{
+			if (!pDeviceTask[i]->Start())
+			{
+				delete pDeviceTask[i];
+				pDeviceTask[i] = NULL;
+			}
+		}
+	}
+
+	// wait a bit to allow the threads to start
+	Sleep(500);
+
+	return true;
+}
+
+
+/////////////////////////////////////////////////////////////////////////
+// Check to see if all our jobs have finished
+int dlltest_worker::WorkPending()
+{
+	int i;
+	int count = 0;
+	for (i=0;i<lConectionCount;i++)
+	{
+		if (pDeviceTask[i] && pDeviceTask[i]->StillActive())
+		{
+			count++;
+		}
+	}
+
+	return count;
+}
+
+/////////////////////////////////////////////////////////////////////////
+// Release any resources
+void dlltest_worker::Finish()
+{
+	// kill the threads
+	int i;
+	for (i=0;i<lConectionCount;i++)
+	{
+		if (pDeviceTask[i])
+		{
+			pDeviceTask[i]->Kill();
+			delete pDeviceTask[i];
+			pDeviceTask[i] = NULL;
+		}
+	}
+
+	// turn off high-level logging
+	CloseConnectionLogging();
+}
+
+
+/////////////////////////////////////////////////////////////////////////
+// PRIVATE METHODS
+/////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////
+// Set task information for a single thread
+void dlltest_worker::GetTaskInfo(int index)
+{
+	STATCONNECTTYPE type;
+	char *addr;
+	ParseConnection(szConections[index], &type, &addr);
+
+	TaskInfo[index].connectType = type;
+	TaskInfo[index].delay = delay;
+	TaskInfo[index].fudge = fudge;
+	TaskInfo[index].iterations = iterations;
+	TaskInfo[index].removeImages = removeImages;
+	TaskInfo[index].pCommand = szCommand;
+	TaskInfo[index].pLogfile = szLogfile;
+	TaskInfo[index].pRefdir = szRefdir;
+	TaskInfo[index].pSnapshot = szSnapshot;
+	TaskInfo[index].verify = verify;
+	strcpy(TaskInfo[index].szAddress, addr);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// Split a connection registry entry into its respective parts
+void dlltest_worker::ParseConnection(char *pConnection, STATCONNECTTYPE *pType, char **ppAddress)
+{
+	(*pType) = SymbianInvalid;
+	(*ppAddress) = NULL;
+
+	static char szConnection[256];
+	memset(szConnection, 0, sizeof(szConnection));
+	strcpy(szConnection, pConnection);
+
+	char *p = strchr(szConnection, ':');
+	if (p)
+	{
+		(*p) = (char)0;
+		(*ppAddress) = p + 1;
+
+		if (stricmp(szConnection, "SymbianSocket") == 0)
+		{
+			(*pType) = SymbianSocket;
+		}
+		else if (stricmp(szConnection, "SymbianSerial") == 0)
+		{
+			(*pType) = SymbianSerial;
+		}
+		else if (stricmp(szConnection, "SymbianInfrared") == 0)
+		{
+			(*pType) = SymbianInfrared;
+		}
+		else if (stricmp(szConnection, "SymbianBluetooth") == 0)
+		{
+			(*pType) = SymbianBluetooth;
+		}
+		else if (stricmp(szConnection, "SymbianUSB") == 0)
+		{
+			(*pType) = SymbianUSB;
+		}
+
+		(*p) = ':';
+	}
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/src/stattask.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "stdafx.h"
+#include "STATTask.h"
+
+//////////////////////////////////////////////////////////////////////////
+// Constructor
+// Takes 3 parameters: 
+// 1) Pointer to function to start the thread in
+// 2) Pointer to class object to use within the thread
+// 3) Optional string identifier
+//////////////////////////////////////////////////////////////////////////
+STATTask::STATTask(const ThreadProc pFunc, void *pMember, char *pConnection)
+{
+	pfThreadProc = pFunc;
+	theMember = pMember;
+	szConection = NULL;
+
+	if (pConnection)
+	{
+		szConection = new char[strlen(pConnection) + 1];
+		if (szConection)
+			strcpy(szConection, pConnection);
+	}
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+// Destructor
+STATTask::~STATTask()
+{
+	Kill();
+
+	if (szConection)
+		delete [] szConection;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+// Create the thread
+bool STATTask::Start()
+{
+	bool valid = true;
+
+	// event attributes for the child process
+	SECURITY_ATTRIBUTES eventAttr;
+	eventAttr.nLength = sizeof(eventAttr);
+	eventAttr.lpSecurityDescriptor = NULL;
+	eventAttr.bInheritHandle = TRUE;
+
+	// spawn a thread to do the processing
+	DWORD dwThreadID;
+	if (!(hThreadHandle = CreateThread( NULL,			// security attributes
+										0,				// stack size
+										pfThreadProc,	// proc to call
+										theMember,		// proc parameter
+										0,				// creation flags
+										&dwThreadID)))	// thread identifier
+	{
+		valid = false;
+	}
+
+	return valid;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+// Check to see if thread has finished processing
+bool STATTask::StillActive(DWORD timeout)
+{
+	bool valid = false;
+
+	if (hThreadHandle)
+	{
+		if (WAIT_TIMEOUT == WaitForSingleObject(hThreadHandle, timeout))
+		{
+			valid = true;
+		}
+	}
+
+	return valid;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+// Kill the thread
+bool STATTask::Kill()
+{
+	bool valid = true;
+
+	if (hThreadHandle)
+	{
+		if (!TerminateThread(hThreadHandle, 0))
+		{
+			valid = false;
+		}
+
+		hThreadHandle = 0;
+	}
+
+	return valid;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/dlltestermt/src/stdafx.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     implementation file for including standard include files	*
+*/
+
+
+
+
+#include "stdafx.h"
+
+// : reference any additional headers you need in STDAFX.H
+// and not in this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/desktop/testsource/testsource.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,85 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "STATDll"=..\source\dll\STATdll.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+    begin source code control
+    Perforce Project
+    ..\source\dll
+    end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "STATLib"=..\source\lib\STATLib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+    begin source code control
+    Perforce Project
+    ..\source\lib
+    end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "dlltest"=.\dlltester\dlltest.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+    begin source code control
+    Perforce Project
+    .\dlltester
+    end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "dlltest_multithreaded"=.\dlltestermt\dlltest_multithreaded.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+    begin source code control
+    Perforce Project
+    .\dlltestermt
+    end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+    begin source code control
+    Perforce Project
+    .
+    end source code control
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/group/release.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,5 @@
+NOTESRC_RELEASER
+Nokia Ltd. 
+
+NOTESRC_RELEASE_REASON
+STAT release.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/perl/stat.pl	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,172 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+# which accompanies this distribution, and is available
+
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+use Win32::API;
+use StatAPI;
+
+########################################
+# Set up initial data
+# You will want to change:
+#  - def_connection
+#  - def_codetype
+#  - loglevel
+########################################
+
+my $result = 1;
+my $dll = "stat.dll";
+# For the connection, refer to the enumeration in stat.h.
+my $def_connection = 2;
+my $def_codetype = "COM1";
+my $logfile = "C:\\apps\\stat\\LogFiles\\stat_perl.log";
+# For log level, specify 2 for command line testing, specify 3 for automatic testing.
+my $loglevel = 2;
+my $senddir = "/";  # (must end in 'slash')
+my $recvdir = "Recvd/";
+my $commondir = "Common/";
+my $hndl = 0;		# a handle to a remote device connection
+
+########################################
+# Set options from parameters
+########################################
+
+if (@ARGV > 4)
+	{
+		print "Usage : perl stat.pl [connection type <";
+		print $def_connection;
+		print ">] [connection data<";
+		print $def_codetype;
+		print ">] [log level<";
+		print $loglevel;
+		print ">]\n";
+		exit 0;
+	}
+
+if (@ARGV > 0)
+	{
+		$def_connection = @ARGV[0];
+	}
+
+if (@ARGV > 1)
+	{
+		$def_codetype = @ARGV[1];
+	}
+
+if (@ARGV > 2)
+	{
+		$loglevel = @ARGV[2];
+	}
+
+########################################
+# Create the argument list
+########################################
+
+my @arglist = ($dll, $def_connection, $def_codetype, $loglevel, $logfile , $senddir, $recvdir, $commondir);
+
+########################################
+# Create the connection
+########################################
+
+print "==========================\n";
+print "STAT API Connectivity Test\n";
+print "==========================\n\n";
+
+# set folders
+Symbian::StatAPI::set_dll_folder("\\epoc32\\tools\\stat");
+
+# initialise
+Symbian::StatAPI::initialise(@arglist) or goto scripterror;	# initialise the DLL
+
+# connect to a device
+$hndl = Symbian::StatAPI::connect_to_target();
+$hndl or goto scripterror;
+
+Symbian::StatAPI::set_connection_logging();
+
+Symbian::StatAPI::set_command_logging($hndl);
+
+########################################
+# The script
+########################################
+
+Symbian::StatAPI::get_screenshot($hndl);
+
+Symbian::StatAPI::basic_key_sequence($hndl,'b');
+
+Symbian::StatAPI::get_device_info($hndl);
+
+Symbian::StatAPI::start_application($hndl,'Z:\Sys\Bin\Contacts.app','Test');
+Symbian::StatAPI::control_keystroke($hndl,'Menu');
+Symbian::StatAPI::control_keystroke($hndl,'RightArrow');
+Symbian::StatAPI::basic_key_sequence($hndl,'1');
+Symbian::StatAPI::basic_key_sequence($hndl,'Os');
+Symbian::StatAPI::control_keystroke($hndl,'DownArrow');
+Symbian::StatAPI::basic_key_sequence($hndl,'Symbian');
+Symbian::StatAPI::combination_keystroke($hndl,'Ctrl+S');
+Symbian::StatAPI::get_screenshot($hndl);
+Symbian::StatAPI::combination_keystroke($hndl,'Ctrl+E');
+
+Symbian::StatAPI::start_application($hndl,'Z:\Sys\Bin\Agenda.app','Test');
+Symbian::StatAPI::combination_keystroke($hndl,'Shift+Ctrl+E');
+Symbian::StatAPI::control_keystroke($hndl,'Enter');
+Symbian::StatAPI::basic_key_sequence($hndl,'My Birthday');
+Symbian::StatAPI::control_keystroke($hndl,'DownArrow');
+Symbian::StatAPI::control_keystroke($hndl,'DownArrow');
+Symbian::StatAPI::control_keystroke($hndl,'DownArrow');
+Symbian::StatAPI::control_keystroke($hndl,'LeftArrow');
+Symbian::StatAPI::control_keystroke($hndl,'Enter');
+Symbian::StatAPI::get_screenshot($hndl);
+Symbian::StatAPI::combination_keystroke($hndl,'Ctrl+E');
+
+Symbian::StatAPI::start_application($hndl,'Z:\Sys\Bin\TimeW.app');
+Symbian::StatAPI::combination_keystroke($hndl,'Ctrl+Shift+K');
+Symbian::StatAPI::get_screenshot($hndl);
+Symbian::StatAPI::combination_keystroke($hndl,'Ctrl+E');
+
+Symbian::StatAPI::get_screenshot($hndl);
+
+Symbian::StatAPI::copy_testfile_to_target($hndl,'StdAfx.sbr','C:\System\StdAfx.sb_');
+Symbian::StatAPI::copy_from_target($hndl,'C:\System\StdAfx.sb_');
+Symbian::StatAPI::remove_file($hndl,'C:\System\StdAfx.sb_');
+
+goto endscript;
+
+########################################
+# Error handling routine
+########################################
+scripterror:
+print "\nScript aborted due to error:\n" . Symbian::StatAPI::get_last_error($hndl) . "\n";
+$result = 0;
+
+########################################
+# Finish
+########################################
+endscript:
+$hndl and Symbian::StatAPI::disconnect_from_target($hndl) and print "Disconnected OK\n";
+Symbian::StatAPI::close_connection_logging();		# close log file
+
+exit ($result);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/file_transfer.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,10 @@
+<B>
+<YC:\Logs\>
+<TEmpty.txt,C:\Logs\Empty.txt>
+<RC:\Logs\Empty.txt,Recvd>
+<YC:\STAT\Data\>
+<TStdAfx.sbr,C:\STAT\Data\StdAfx.sbr>
+<RC:\STAT\Data\StdAfx.sbr,Recvd>
+<UC:\STAT\Data\StdAfx.sbr>
+<ZC:\STAT\Data\>
+<E>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/hamlet.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,56 @@
+/*********************************************************
+* AUTO-GENERATED COMMENT BLOCK - DO NOT MODIFY
+**********************************************************
+*
+* HAMLET.TXT
+*
+* Author : Sanjeet Matharu
+* Version : 1.0
+* Description: 
+*
+* Sample STAT script to demonstrate multiline text input
+*
+* (C) Copyright Symbian 2001/2002
+*********************************************************/
+
+<B>
+<Az:\system\apps\jotter\jotter.app,Hamlet>
+<KHamlet - ACT III, scene 1. By William Shakespeare
+
+To be, or not to be: that is the question;
+Whether 'tis nobler in the mind to suffer
+The slings and arrows of outrageous fortune,
+Or to take arms against a sea of troubles,
+And by opposing end them? To die: to sleep;
+No more; and, by a sleep to say we end
+The heartache and the thousand natural shocks
+That flesh is heir to, 'tis a consummation
+Devoutly to be wish'd. To die, to sleep;
+To sleep; perchance to dream: ay there's the rub;
+For in that sleep of death what dreams may come
+When we have shuffled off this mortal coil,
+Must give us pause. There's the respect
+That makes calamity of so long life;
+For who bear the whips and scorns of time,
+The oppressor's wrong, the proud man's contumely,
+The pangs of dispriz'd love, the law's delay,
+The insolence of office, and the spurns
+That patient merit of the unworthy takes,
+When he himself might his quietus make
+
+With a bare bodkin? Who would fardels bear,
+To grunt and sweat under a weary life,
+But that the dread of something after death,
+The undiscover'd country from whose bourn
+No traveller returns, puzzles the will,
+And makes us rather bear those ills we have,
+Than fly to others that we know not of?
+Thus conscience doth make cowards of us all;
+And thus the native hue of resolution
+Is sicklied o'er with the pale cast of thought,
+And enterprises of great pith and moment
+With this regard their currents turn awry,
+
+And lose the name of action.>
+<S>
+<E>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/prepare.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,45 @@
+/*********************************************************
+* AUTO-GENERATED COMMENT BLOCK - DO NOT MODIFY
+**********************************************************
+*
+* PREPARE.TXT
+*
+* Author : Phil Hodgson
+* Version : 1.0
+* Description: 
+*
+* Sets a few things on the target prior to testing
+*
+* (C) Copyright Symbian 2001/2002
+*********************************************************/
+
+<B>					/* begin script */
+
+/* Disable screen power off */
+<MCtrl+S><P200>				/* system */
+<LDownArrow><P200>			/* navigate */
+<LDownArrow><P200>			/* navigate */
+<LRightArrow><P200>			/* navigate */
+<LEnter><P200>				/* set */
+<LDownArrow><P200>			/* navigate */
+<LDownArrow><P200>			/* navigate */
+<LDownArrow><P200>			/* navigate */
+<LRightArrow><P200>			/* navigate */
+<LEnter><P200>				/* set */
+<LEscape><P200>				/* exit */
+
+/* Show system and hidden files */
+<MCtrl+K><P200>				/* system */
+<LRightArrow><P200>			/* navigate */
+<LDownArrow><P200>			/* navigate */
+<LRightArrow><P200>			/* navigate */
+<LEnter><P200>				/* set */
+
+/* change to ROM drive */
+<MCtrl+Tab><P200>			/* system */
+<LUpArrow><P200>			/* navigate */
+<LUpArrow><P200>			/* navigate */
+<LLeftArrow><P200>			/* navigate */
+<LEnter><P200>				/* set */
+
+<E>					/* end script */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/sample.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,70 @@
+/*********************************************************
+* AUTO-GENERATED COMMENT BLOCK - DO NOT MODIFY
+**********************************************************
+*
+* SAMPLE.TXT
+*
+* Author : Phil Hodgson
+* Version : 1.0
+* Description: 
+*
+* Basic Functionality Test for all STAT commands
+*
+* (C) Copyright Symbian 2001/2002
+*********************************************************/
+
+<B>					/* begin script */
+<D>					/* device information */
+<#image C:>				/* set image dir */
+<S>					/* take screenshot */
+<SMyScreenshot>				/* take screenshot and give it a name */
+<Az:\system\apps\word\word.app>		/* start word with default doc */
+<P2000>					/* pause */
+<C>					/* close app */
+<Az:\system\apps\word\word.app,sample>	/* start Word */
+<P2000>					/* pause */
+<KTo be, or not to be>			/* type some text */
+<P1000>					/* pause */
+<LEnter>				/* newline */
+<P1000>					/* pause */
+<LEnter>				/* newline */
+<P1000>					/* pause */
+<HA,2000>				/* hold down the 'A' key for 2 seconds */
+<P1000>					/* pause */
+<LEnter>				/* newline */
+<P1000>					/* pause */
+<MCtrl+S>				/* save file */
+<P1000>					/* pause */
+<S>					/* take screenshot */
+<C>					/* close app */
+<P2000>					/* pause */
+<Fz:\system\apps\word\word.app,sample>	/* restart app */
+<P2000>					/* pause */
+<K - That is the question>		/* type some more text */
+<P1000>					/* pause */
+<MCtrl+S>				/* save file */
+<P1000>					/* pause */
+<S>					/* take screenshot */
+<C>					/* close app */
+<P1000>					/* pause */
+<Tmyfile.abc,c:\myfile.xyz>		/* transfer to target */
+<P1000>					/* pause */
+<Rc:\myfile.xyz,>			/* retrieve (move) from target */
+<P1000>					/* pause */
+<Xz:\system\apps\word\word.app,>	/* retrieve (copy) from target */
+<P1000>					/* pause */
+<I260,25>				/* touch screen */
+<P3000>					/* pause */
+<LEscape>				/* escape */
+<P2000>					/* pause */
+<UC:\sample>				/* delete a file */
+<P2000>					/* pause */
+<Nc:\newfolder\>			/* create folder */
+<P2000>					/* pause */
+<Zc:\newfolder\>			/* delete folder */
+<P1000>					/* pause */
+<!>					/* start eshell */
+<Kdir>					/* directory listing */
+<LEnter>				/* newline */
+<!!>					/* close eshell */
+<E>					/* end script */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/simpleword.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,49 @@
+/*********************************************************
+* AUTO-GENERATED COMMENT BLOCK - DO NOT MODIFY
+**********************************************************
+*
+* SIMPLEWORD.TXT
+*
+* Author : Tim Eades
+* Version : 1.0
+* Description: 
+*
+* Basic Functionality Test for Word application
+*
+* (C) Copyright Symbian 2001/2002
+*********************************************************/
+
+<B>
+/* Basic Functionality Test for Word */
+
+<Az:\system\apps\word\word.app,sample>		/* open Word */
+<MCtrl+T>					/* hide side menu */
+
+/* Passage from Hamlet to be typed to screen */
+
+<KTo be, or not to be>  			/* type some text */
+<P1000>
+<MCtrl+S>					/* save */
+<P500>
+<C>						/* close */
+<P500>
+<Fz:\system\apps\word\word.app,sample>		/* re-open */
+<P500>
+<C>						/* close */
+<E>						/* end */
+
+
+	/* None of the following is read! */
+	/* Saving document to Documents Folder */
+<LMenu><P5000>
+<LDownArrow><P5000>
+<LDownArrow><P5000>
+<LDownArrow><P5000>
+<LDownArrow><P5000>
+<LRightArrow><P5000>
+<LEnter><P5000>
+<KTim><P5000>
+<LDownArrow><P5000>
+<Kd><P5000>
+<LEnter><P2000>
+<E>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/statdlltest.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,16 @@
+/*********************************************************
+* AUTO-GENERATED COMMENT BLOCK - DO NOT MODIFY
+**********************************************************
+*
+* STATDLLV3TEST.TXT
+*
+* Author : Phil Hodgson
+* Version : 1.0
+* Description: 
+*
+* Takes a screenshot - for use with statdlltest.exe
+*
+* (C) Copyright Symbian 2001/2002
+*********************************************************/
+
+<B><S><E>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/various.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,48 @@
+/*********************************************************
+* AUTO-GENERATED COMMENT BLOCK - DO NOT MODIFY
+**********************************************************
+*
+* VARIOUS.TXT
+*
+* Author : Sanjeet Matharu
+* Version : 1.0
+* Description: 
+*
+* Basic testing of starting applications
+*
+* (C) Copyright Symbian 2001/2002
+*********************************************************/
+<B>
+<D>
+<Az:\System\Apps\Agenda\Agenda.app,Harris>
+<LMenu>
+<S>
+<LEscape>
+<MShift+Ctrl+Y>
+<S>
+<I288,41>
+<S>
+<LEscape>
+<MShift+Ctrl+W>
+<MCtrl+G>
+<K14042001>
+<LEnter>
+<S>
+<KMy Birthday>
+<S>
+<I297,87>
+<S>
+<LEnter>
+<S>
+<Az:\system\apps\word\word.app,Rubbish>
+<KThis is a test>
+<S>
+<Az:\system\apps\sheet\sheet.app,sheet test>
+<S>
+<Az:\system\apps\jotter\jotter.app,jotter test>
+<KThis is a test. What happens if I enter quite a long string as a set of key-press events? I wonder if 'punctuation' and other ! symbols are allowed? Boing.>
+<S>
+<Az:\system\apps\web\web.app><Kn><S>
+<I283,14>
+<S>
+<E>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/various_eka1.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,32 @@
+<B>
+<Kb>
+<D>
+<AZ:\Sys\Bin\Contacts.app,Test>
+<LMenu>
+<LRightArrow>
+<K1>
+<KOs>
+<LDownArrow>
+<KSymbian>
+<MCtrl+S>
+<S>
+<MCtrl+E>
+<AZ:\Sys\Bin\Agenda.app,Test>
+<MShift+Ctrl+E>
+<LEnter>
+<KMy Birthday>
+<LDownArrow>
+<LDownArrow>
+<LDownArrow>
+<LLeftArrow>
+<LEnter>
+<S>
+<MCtrl+E>
+<AZ:\Sys\Bin\TimeW.app>
+<MCtrl+Shift+K>
+<S>
+<MCtrl+E>
+<TRecvd\StdAfx.sbr,C:\System\StdAfx.sb_>
+<RC:\System\StdAfx.sb_,Recvd>
+<UC:\System\StdAfx.sb_>
+<E>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/stat/scripts/standard/various_eka2.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,21 @@
+<B>
+<Kb>
+<D>
+<AZ:\Sys\Bin\Contacts.exe,Test>
+<LMenu>
+<LRightArrow>
+<K1>
+<KOs>
+<LDownArrow>
+<KSymbian>
+<MCtrl+S>
+<S>
+<MCtrl+E>
+<AZ:\Sys\Bin\TimeW.exe>
+<MCtrl+Shift+K>
+<S>
+<MCtrl+E>
+<TRecvd\StdAfx.sbr,C:\System\StdAfx.sb_>
+<RC:\System\StdAfx.sb_,Recvd>
+<UC:\System\StdAfx.sb_>
+<E>
Binary file testtoolsconn/wintap/bin/ethertap.pdd has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/OemWin2k.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,172 @@
+; ****************************************************************************
+; * Copyright (C) 2002-2005 OpenVPN Solutions LLC                            *
+; *  This program is free software; you can redistribute it and/or modify    *
+; *  it under the terms of the GNU General Public License version 2          *
+; *  as published by the Free Software Foundation.                           *
+; ****************************************************************************
+
+; SYNTAX CHECKER
+; cd \WINDDK\3790\tools\chkinf
+; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf
+; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm
+
+;*********************************************************
+; Note to Developers:
+;
+; If you are bundling the TAP-Win32 driver with your app,
+; you should try to rename it in such a way that it will
+; not collide with other instances of TAP-Win32 defined
+; by other apps.  Multiple versions of the TAP-Win32
+; driver, each installed by different apps, can coexist
+; on the same machine if you follow these guidelines:
+;
+; (1) Rename all tapXXXX instances in this file to
+;     something different (use at least 5 characters
+;     for this name!)
+; (2) Change the "!define TAP" definition in openvpn.nsi
+;     to match what you changed tapXXXX to.
+; (3) Change TARGETNAME in SOURCES to match what you
+;     changed tapXXXX to.
+; (4) Change TAP_COMPONENT_ID in common.h to match what
+;     you changed tapXXXX to.
+; (5) Change SZDEPENDENCIES in service.h to match what
+;     you changed tapXXXX to.
+; (6) Change DeviceDescription and Provider strings.
+; (7) Change PRODUCT_STRING in constants.h to what you
+;     set DeviceDescription to.
+;
+;*********************************************************
+
+[Version]
+   Signature = "$Windows NT$"
+   CatalogFile = tap.cat
+   ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
+   Provider = %Provider%
+   Class = Net
+
+; This version number should match the version
+; number given in SOURCES.
+   DriverVer=05/15/2004,8.00.00.0001
+
+[Strings]
+   DeviceDescription = "TAP-Win32 Adapter V8"
+   Provider = "TAP-Win32 Provider"
+
+;----------------------------------------------------------------
+;                      Manufacturer + Product Section (Done)
+;----------------------------------------------------------------
+[Manufacturer]
+   %Provider% = tap0801
+
+[tap0801]
+   %DeviceDescription% = tap0801.ndi, tap0801
+
+;---------------------------------------------------------------
+;                             Driver Section (Done)
+;---------------------------------------------------------------
+
+;----------------- Characteristics ------------
+;    NCF_PHYSICAL = 0x04
+;    NCF_VIRTUAL = 0x01
+;    NCF_SOFTWARE_ENUMERATED = 0x02
+;    NCF_HIDDEN = 0x08
+;    NCF_NO_SERVICE = 0x10
+;    NCF_HAS_UI = 0x80
+;----------------- Characteristics ------------
+
+[tap0801.ndi]
+   CopyFiles       = tap0801.driver, tap0801.files
+   AddReg          = tap0801.reg
+   AddReg          = tap0801.params.reg
+   Characteristics = 0x81
+
+[tap0801.ndi.Services]
+   AddService = tap0801,        2, tap0801.service
+
+[tap0801.reg]
+   HKR, Ndi,            Service,      0, "tap0801"
+   HKR, Ndi\Interfaces, UpperRange,   0, "ndis5"
+   HKR, Ndi\Interfaces, LowerRange,   0, "ethernet"
+   HKR, ,               Manufacturer, 0, "%Provider%"
+   HKR, ,               ProductName,  0, "%DeviceDescription%"
+
+[tap0801.params.reg]
+   HKR, Ndi\params\MTU,                ParamDesc, 0, "MTU"
+   HKR, Ndi\params\MTU,                Type,      0, "int"
+   HKR, Ndi\params\MTU,                Default,   0, "1500"
+   HKR, Ndi\params\MTU,                Optional,  0, "0"
+   HKR, Ndi\params\MTU,                Min,       0, "100"
+   HKR, Ndi\params\MTU,                Max,       0, "1500"
+   HKR, Ndi\params\MTU,                Step,      0, "1"
+   HKR, Ndi\params\MediaStatus,        ParamDesc, 0, "Media Status"
+   HKR, Ndi\params\MediaStatus,        Type,      0, "enum"
+   HKR, Ndi\params\MediaStatus,        Default,   0, "1"
+   HKR, Ndi\params\MediaStatus,        Optional,  0, "0"
+   HKR, Ndi\params\MediaStatus\enum,   "0",       0, "Application Controlled"
+   HKR, Ndi\params\MediaStatus\enum,   "1",       0, "Always Connected"
+   HKR, Ndi\params\MAC,                ParamDesc, 0, "MAC Address"
+   HKR, Ndi\params\MAC,                Type,      0, "edit"
+   HKR, Ndi\params\MAC,                Optional,  0, "1"
+
+;----------------------------------------------------------------
+;                             Service Section
+;----------------------------------------------------------------
+
+;---------- Service Type -------------
+;    SERVICE_KERNEL_DRIVER     = 0x01
+;    SERVICE_WIN32_OWN_PROCESS = 0x10
+;---------- Service Type -------------
+
+;---------- Start Mode ---------------
+;    SERVICE_BOOT_START   = 0x0
+;    SERVICE_SYSTEM_START = 0x1
+;    SERVICE_AUTO_START   = 0x2
+;    SERVICE_DEMAND_START = 0x3
+;    SERVICE_DISABLED     = 0x4
+;---------- Start Mode ---------------
+
+[tap0801.service]
+   DisplayName = %DeviceDescription%
+   ServiceType = 1
+   StartType = 3
+   ErrorControl = 1
+   LoadOrderGroup = NDIS
+   ServiceBinary = %12%\tap0801.sys
+
+;-----------------------------------------------------------------
+;                                File Installation
+;-----------------------------------------------------------------
+
+;----------------- Copy Flags ------------
+;    COPYFLG_NOSKIP = 0x02
+;    COPYFLG_NOVERSIONCHECK = 0x04
+;----------------- Copy Flags ------------
+
+; SourceDisksNames
+; diskid = description[, [tagfile] [, <unused>, subdir]]
+; 1 = "Intel Driver Disk 1",e100bex.sys,,
+
+[SourceDisksNames]
+   1 = %DeviceDescription%, tap0801.sys
+
+; SourceDisksFiles
+; filename_on_source = diskID[, [subdir][, size]]
+; e100bex.sys = 1,, ; on distribution disk 1
+
+[SourceDisksFiles]
+tap0801.sys = 1
+
+[DestinationDirs]
+   tap0801.files  = 11
+   tap0801.driver = 12
+
+[tap0801.files]
+;   TapPanel.cpl,,,6   ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+;   cipsrvr.exe,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+[tap0801.driver]
+   tap0801.sys,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+;---------------------------------------------------------------
+;                                      End
+;---------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/license.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,569 @@
+OpenVPN License 
+COPYING
+OpenVPN (TM) -- An Open Source VPN daemon
+
+Copyright (C) 2002-2008 OpenVPN Technologies, Inc. 
+ info@openvpn.net
+ 
+This distribution contains multiple components, some
+of which fall under different licenses.  By using OpenVPN
+or any of the bundled components enumerated below, you
+agree to be bound by the conditions of the license for
+each respective component.
+
+OpenVPN trademark
+-----------------
+
+  "OpenVPN" is a trademark of OpenVPN Solutions LLC.
+
+
+OpenVPN license:
+----------------
+
+  OpenVPN is distributed under the GPL license version 2 (see Below).
+
+  Special exception for linking OpenVPN with OpenSSL:
+
+  In addition, as a special exception, OpenVPN Solutions LLC gives
+  permission to link the code of this program with the OpenSSL
+  library (or with modified versions of OpenSSL that use the same
+  license as OpenSSL), and distribute linked combinations including
+  the two.  You must obey the GNU General Public License in all
+  respects for all of the code used other than OpenSSL.  If you modify
+  this file, you may extend this exception to your version of the
+  file, but you are not obligated to do so.  If you do not wish to
+  do so, delete this exception statement from your version.
+
+LZO license:
+------------
+
+  LZO is Copyright (C) Markus F.X.J. Oberhumer,
+  and is licensed under the GPL.
+
+  Special exception for linking OpenVPN with both OpenSSL and LZO:
+
+  Hereby I grant a special exception to the OpenVPN project 
+  (http://openvpn.net/) to link the LZO library with 
+  the OpenSSL library (http://www.openssl.org).
+ 
+  Markus F.X.J. Oberhumer
+
+TAP-Win32 Driver license:
+-------------------------
+
+  The TAP-Win32 driver is derived from the CIPE-Win32
+  kernel driver, Copyright (C) Damion K. Wilson,
+  and is licensed under the GPL.
+
+Windows DDK Samples:
+--------------------
+
+  The Windows binary distribution includes devcon.exe, a
+  Microsoft DDK sample which is redistributed under the terms
+  of the DDK EULA.
+
+NSIS License:
+-------------
+
+  Copyright (C) 2002-2003 Joost Verburg
+
+  This software is provided 'as-is', without any express or implied
+  warranty. In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute
+  it freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; 
+     you must not claim that you wrote the original software.
+     If you use this software in a product, an acknowledgment in the
+     product documentation would be appreciated but is not required.
+  2. Altered versions must be plainly marked as such,
+     and must not be misrepresented as being the original software.
+  3. This notice may not be removed or altered from any distribution.
+
+OpenSSL License:
+----------------
+
+  The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
+  the OpenSSL License and the original SSLeay license apply to the toolkit.
+  See below for the actual license texts. Actually both licenses are BSD-style
+  Open Source licenses. In case of any license issues related to OpenSSL
+  please contact 
+ openssl-core@openssl.org.
+
+/* ====================================================================
+ * Copyright (c) 1998-2003 The OpenSSL Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    
+ openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ *    nor may "OpenSSL" appear in their names without prior written
+ *    permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (
+ eay@cryptsoft.com).  This product includes software written by Tim
+ * Hudson (
+ tjh@cryptsoft.com).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young (
+ eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (
+ eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (
+ tjh@cryptsoft.com).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (
+ eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (
+ tjh@cryptsoft.com)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+GNU Public License (GPL)
+------------------------
+
+  OpenVPN, LZO, and the TAP-Win32 distributions are
+  licensed under the GPL version 2 (see COPYRIGHT.GPL).
+
+  In the Windows binary distribution of OpenVPN, the
+  GPL is reproduced below.
+
+________________________________________
+COPYRIGHT.GPL
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License version 2
+    as published by the Free Software Foundation.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+________________________________________
+Copyright ?? 2002-2006 by OpenVPN Technologies, Inc. < info@openvpn.net >. OpenVPN is a trademark of OpenVPN Technologies, Inc.
Binary file testtoolsconn/wintap/driver/tap0801.sys has changed
Binary file testtoolsconn/wintap/driver/tap0901.cat has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/tap0901.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,187 @@
+; ****************************************************************************
+; * Copyright (C) 2002-2008 Telethra, Inc.                            *
+; *  This program is free software; you can redistribute it and/or modify    *
+; *  it under the terms of the GNU General Public License version 2          *
+; *  as published by the Free Software Foundation.                           *
+; ****************************************************************************
+
+; SYNTAX CHECKER
+; cd \WINDDK\3790\tools\chkinf
+; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf
+; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm
+
+; INSTALL/REMOVE DRIVER
+;   tapinstall install OemWin2k.inf TAP0901
+;   tapinstall update OemWin2k.inf TAP0901
+;   tapinstall remove TAP0901
+
+;*********************************************************
+; Note to Developers:
+;
+; If you are bundling the TAP-Win32 driver with your app,
+; you should try to rename it in such a way that it will
+; not collide with other instances of TAP-Win32 defined
+; by other apps.  Multiple versions of the TAP-Win32
+; driver, each installed by different apps, can coexist
+; on the same machine if you follow these guidelines.
+; NOTE: these instructions assume you are editing the
+; generated OemWin2k.inf file, not the source
+; OemWin2k.inf.in file which is preprocessed by winconfig
+; and uses macro definitions from settings.in.
+;
+; (1) Rename all tapXXXX instances in this file to
+;     something different (use at least 5 characters
+;     for this name!)
+; (2) Change the "!define TAP" definition in openvpn.nsi
+;     to match what you changed tapXXXX to.
+; (3) Change TARGETNAME in SOURCES to match what you
+;     changed tapXXXX to.
+; (4) Change TAP_COMPONENT_ID in common.h to match what
+;     you changed tapXXXX to.
+; (5) Change SZDEPENDENCIES in service.h to match what
+;     you changed tapXXXX to.
+; (6) Change DeviceDescription and Provider strings.
+; (7) Change PRODUCT_STRING in constants.h to what you
+;     set DeviceDescription to.
+;
+;*********************************************************
+
+[Version]
+   Signature = "$Windows NT$"
+   CatalogFile = tap0901.cat
+   ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
+   Provider = %Provider%
+   Class = Net
+
+; This version number should match the version
+; number given in SOURCES.
+   DriverVer=01/22/2008,9.00.00.4
+
+[Strings]
+   DeviceDescription = "TAP-Win32 Adapter V9"
+   Provider = "TAP-Win32 Provider V9"
+
+;----------------------------------------------------------------
+;                      Manufacturer + Product Section (Done)
+;----------------------------------------------------------------
+[Manufacturer]
+   %Provider% = tap0901
+
+[tap0901]
+   %DeviceDescription% = tap0901.ndi, tap0901
+
+;---------------------------------------------------------------
+;                             Driver Section (Done)
+;---------------------------------------------------------------
+
+;----------------- Characteristics ------------
+;    NCF_PHYSICAL = 0x04
+;    NCF_VIRTUAL = 0x01
+;    NCF_SOFTWARE_ENUMERATED = 0x02
+;    NCF_HIDDEN = 0x08
+;    NCF_NO_SERVICE = 0x10
+;    NCF_HAS_UI = 0x80
+;----------------- Characteristics ------------
+
+[tap0901.ndi]
+   CopyFiles       = tap0901.driver, tap0901.files
+   AddReg          = tap0901.reg
+   AddReg          = tap0901.params.reg
+   Characteristics = 0x81
+
+[tap0901.ndi.Services]
+   AddService = tap0901,        2, tap0901.service
+
+[tap0901.reg]
+   HKR, Ndi,            Service,      0, "tap0901"
+   HKR, Ndi\Interfaces, UpperRange,   0, "ndis5"
+   HKR, Ndi\Interfaces, LowerRange,   0, "ethernet"
+   HKR, ,               Manufacturer, 0, "%Provider%"
+   HKR, ,               ProductName,  0, "%DeviceDescription%"
+
+[tap0901.params.reg]
+   HKR, Ndi\params\MTU,                  ParamDesc, 0, "MTU"
+   HKR, Ndi\params\MTU,                  Type,      0, "int"
+   HKR, Ndi\params\MTU,                  Default,   0, "1500"
+   HKR, Ndi\params\MTU,                  Optional,  0, "0"
+   HKR, Ndi\params\MTU,                  Min,       0, "100"
+   HKR, Ndi\params\MTU,                  Max,       0, "1500"
+   HKR, Ndi\params\MTU,                  Step,      0, "1"
+   HKR, Ndi\params\MediaStatus,          ParamDesc, 0, "Media Status"
+   HKR, Ndi\params\MediaStatus,          Type,      0, "enum"
+   HKR, Ndi\params\MediaStatus,          Default,   0, "0"
+   HKR, Ndi\params\MediaStatus,          Optional,  0, "0"
+   HKR, Ndi\params\MediaStatus\enum,     "0",       0, "Application Controlled"
+   HKR, Ndi\params\MediaStatus\enum,     "1",       0, "Always Connected"
+   HKR, Ndi\params\MAC,                  ParamDesc, 0, "MAC Address"
+   HKR, Ndi\params\MAC,                  Type,      0, "edit"
+   HKR, Ndi\params\MAC,                  Optional,  0, "1"
+   HKR, Ndi\params\AllowNonAdmin,        ParamDesc, 0, "Non-Admin Access"
+   HKR, Ndi\params\AllowNonAdmin,        Type,      0, "enum"
+   HKR, Ndi\params\AllowNonAdmin,        Default,   0, "1"
+   HKR, Ndi\params\AllowNonAdmin,        Optional,  0, "0"
+   HKR, Ndi\params\AllowNonAdmin\enum,   "0",       0, "Not Allowed"
+   HKR, Ndi\params\AllowNonAdmin\enum,   "1",       0, "Allowed"
+
+;----------------------------------------------------------------
+;                             Service Section
+;----------------------------------------------------------------
+
+;---------- Service Type -------------
+;    SERVICE_KERNEL_DRIVER     = 0x01
+;    SERVICE_WIN32_OWN_PROCESS = 0x10
+;---------- Service Type -------------
+
+;---------- Start Mode ---------------
+;    SERVICE_BOOT_START   = 0x0
+;    SERVICE_SYSTEM_START = 0x1
+;    SERVICE_AUTO_START   = 0x2
+;    SERVICE_DEMAND_START = 0x3
+;    SERVICE_DISABLED     = 0x4
+;---------- Start Mode ---------------
+
+[tap0901.service]
+   DisplayName = %DeviceDescription%
+   ServiceType = 1
+   StartType = 3
+   ErrorControl = 1
+   LoadOrderGroup = NDIS
+   ServiceBinary = %12%\tap0901.sys
+
+;-----------------------------------------------------------------
+;                                File Installation
+;-----------------------------------------------------------------
+
+;----------------- Copy Flags ------------
+;    COPYFLG_NOSKIP = 0x02
+;    COPYFLG_NOVERSIONCHECK = 0x04
+;----------------- Copy Flags ------------
+
+; SourceDisksNames
+; diskid = description[, [tagfile] [, <unused>, subdir]]
+; 1 = "Intel Driver Disk 1",e100bex.sys,,
+
+[SourceDisksNames]
+   1 = %DeviceDescription%, tap0901.sys
+
+; SourceDisksFiles
+; filename_on_source = diskID[, [subdir][, size]]
+; e100bex.sys = 1,, ; on distribution disk 1
+
+[SourceDisksFiles]
+tap0901.sys = 1
+
+[DestinationDirs]
+   tap0901.files  = 11
+   tap0901.driver = 12
+
+[tap0901.files]
+;   TapPanel.cpl,,,6   ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+;   cipsrvr.exe,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+[tap0901.driver]
+   tap0901.sys,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+;---------------------------------------------------------------
+;                                      End
+;---------------------------------------------------------------
Binary file testtoolsconn/wintap/driver/tap0901.sys has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/tapinstaller.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,215 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <windows.h>
+#include <stdio.h>
+#include <setupapi.h>
+#include <cfgmgr32.h>
+#include <malloc.h>
+#include <newdev.h>
+
+#ifdef _UNICODE
+#define UPDATEDRIVERFORPLUGANDPLAYDEVICES "UpdateDriverForPlugAndPlayDevicesW"
+#else
+#define UPDATEDRIVERFORPLUGANDPLAYDEVICES "UpdateDriverForPlugAndPlayDevicesA"
+#endif
+
+typedef BOOL (WINAPI *PUPDATEDRIVERFORPLUGANDPLAYDEVICES)(HWND hwndParent,
+                                                         LPCTSTR HardwareId,
+                                                         LPCTSTR FullInfPath,
+                                                         DWORD InstallFlags,
+                                                         PBOOL bRebootRequired OPTIONAL
+                                                         );
+
+int UpdateDevice(LPCTSTR inf, LPCTSTR hwid)
+{
+    HMODULE hMod = NULL;
+    int nRet = -1;
+    PUPDATEDRIVERFORPLUGANDPLAYDEVICES pUpdate;
+    BOOL bReboot = FALSE;
+    DWORD dwFlags = 0;
+    DWORD res;
+    TCHAR InfPath[MAX_PATH];
+
+    res = GetFullPathName(inf,MAX_PATH,InfPath,NULL);
+    if((res < MAX_PATH) && (res != 0)) {
+		if(GetFileAttributes(InfPath) != (DWORD)(-1)) {
+			inf = InfPath;
+			dwFlags |= INSTALLFLAG_FORCE;
+
+			hMod = LoadLibrary(TEXT("newdev.dll"));
+			if(hMod) {
+				pUpdate = (PUPDATEDRIVERFORPLUGANDPLAYDEVICES)GetProcAddress(hMod,UPDATEDRIVERFORPLUGANDPLAYDEVICES);
+				if(pUpdate)
+				{
+					if(pUpdate(NULL,hwid,inf,dwFlags,&bReboot)) {
+						nRet = 0;
+					}
+				}
+			}
+		}
+	}
+
+    if(hMod) {
+        FreeLibrary(hMod);
+    }
+
+    return -1;
+}
+
+
+
+int install(LPCTSTR inf, LPCTSTR hwid)
+{
+	
+    HDEVINFO hDeviceInfoSet = INVALID_HANDLE_VALUE;
+    SP_DEVINFO_DATA DeviceInfoData;
+    GUID ClassGUID;
+    TCHAR ClassName[MAX_CLASS_NAME_LEN];
+    TCHAR hwIdList[LINE_LEN+4];
+    TCHAR InfPath[MAX_PATH];
+    int nRet = -1;
+    DWORD flags = 0;
+
+    if(GetFullPathName(inf,MAX_PATH,InfPath,NULL) < MAX_PATH) {
+		
+		ZeroMemory(hwIdList,sizeof(hwIdList));
+		lstrcpyn(hwIdList,hwid,LINE_LEN);
+
+		if (SetupDiGetINFClass(InfPath,&ClassGUID,ClassName,sizeof(ClassName)/sizeof(ClassName[0]),0))
+		{
+
+			hDeviceInfoSet = SetupDiCreateDeviceInfoList(&ClassGUID,0);
+			if(hDeviceInfoSet != INVALID_HANDLE_VALUE)
+			{
+
+				DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
+				if (SetupDiCreateDeviceInfo(hDeviceInfoSet,
+					ClassName,
+					&ClassGUID,
+					NULL,
+					0,
+					DICD_GENERATE_ID,
+					&DeviceInfoData))
+				{
+
+					if(SetupDiSetDeviceRegistryProperty(hDeviceInfoSet,
+						&DeviceInfoData,
+						SPDRP_HARDWAREID,
+						(LPBYTE)hwIdList,
+						(lstrlen(hwIdList)+1+1)*sizeof(TCHAR)))
+					{
+
+						if (SetupDiCallClassInstaller(DIF_REGISTERDEVICE,
+							hDeviceInfoSet,
+							&DeviceInfoData))
+						{
+							// update the driver for the device we just created
+							//
+							nRet = UpdateDevice(inf,hwid);
+						}
+					}
+				}
+
+				if (hDeviceInfoSet != INVALID_HANDLE_VALUE) {
+					SetupDiDestroyDeviceInfoList(hDeviceInfoSet);
+				}
+			}
+		}
+	}
+	return nRet;
+}
+
+
+
+BOOL IsWow64()
+{
+	typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE hProcess, BOOL *Wow64Process);
+	BOOL bIsWow64 = FALSE;
+	LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress( GetModuleHandle("kernel32"),"IsWow64Process");
+	if( NULL != fnIsWow64Process)
+	{
+		if( !fnIsWow64Process( GetCurrentProcess(), &bIsWow64))
+		{
+		// handle error
+		}
+	}
+	return bIsWow64;
+}
+
+void CreateChildProcessAndWaitUntilDone(const LPSTR strCmdLine) 
+{
+	PROCESS_INFORMATION piProcInfo; 
+	STARTUPINFO siStartInfo;
+
+	// Set up members of STARTUPINFO structure.
+	siStartInfo.cb = sizeof(STARTUPINFO); 
+	siStartInfo.lpReserved = NULL;
+	siStartInfo.lpReserved2 = NULL; 
+	siStartInfo.cbReserved2 = 0;
+	siStartInfo.lpDesktop = NULL; 
+	siStartInfo.dwFlags = 0;
+
+
+	// Create the child process.
+	CreateProcess(
+		NULL,
+		strCmdLine,
+		NULL, // process security attributes
+		NULL, // primary thread security attributes
+		0, // handles are inherited
+		0, // creation flags
+		NULL, // use parent's environment
+		NULL, // use parent's current directory
+		&siStartInfo, // STARTUPINFO pointer
+		&piProcInfo); // receives PROCESS_INFORMATION
+
+	// Wait for the processs to finish
+	DWORD rc = WaitForSingleObject(
+	piProcInfo.hProcess, // process handle
+	INFINITE); 
+}
+void main(int argc, LPTSTR argv[])
+{
+	int a=0;
+
+	if(IsWow64())
+	{
+		SetCurrentDirectory("x64driver");
+		CreateChildProcessAndWaitUntilDone("tapinstaller.x64.exe");
+	}
+	else 
+	{
+		OSVERSIONINFO ver;
+		ver.dwOSVersionInfoSize = sizeof(ver);
+		GetVersionEx(&ver);
+		if(ver.dwMajorVersion == 6)
+		{
+			LPTSTR inf="tap0901.inf";
+			LPTSTR hwid = "tap0901";
+			install(inf,hwid);
+		}
+		else 
+		{
+			LPTSTR inf="OemWin2k.inf";
+			LPTSTR hwid = "tap0801";
+			install(inf,hwid);
+		}
+	}
+	return;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/tapinstaller.dsp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="installer" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=installer - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "tapinstaller.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "tapinstaller.mak" CFG="installer - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "installer - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "installer - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "installer - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setupapi.lib /nologo /subsystem:console /machine:I386 /out:"tapinstaller.exe"
+
+!ELSEIF  "$(CFG)" == "installer - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setupapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "installer - Win32 Release"
+# Name "installer - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\tapinstaller.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/tapinstaller.dsw	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "installer"=.\tapinstaller.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Binary file testtoolsconn/wintap/driver/tapinstaller.exe has changed
Binary file testtoolsconn/wintap/driver/wintap-config.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/wintap.configure.nsh	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,99 @@
+
+DetailPrint "Checking if wintap is installed..."
+
+!ifndef ClassGUID
+!define ClassGUID "{4d36e972-e325-11ce-bfc1-08002be10318}"
+!endif
+  
+push $0
+push $1
+push $2
+push $4
+
+${GetParameters} $1
+
+${If} $1 =~ "/NOWINTAP"
+  DetailPrint "Wintap installation overridden - skipping installation..."
+  GoTo end
+${EndIf}
+
+;checking if wintap is installed
+#IntOp $0 $0 & 0
+ClearErrors
+/*next:
+  IntFmt $1 "%04d" $0
+  ReadRegStr $2 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}\$1" "NetCfgInstanceId"
+  ReadRegStr $4 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}\$1" "DriverDesc"
+  StrCmp "TAP-Win32 Adapter V8" $4 found
+  IntOp $0 $0 + 1
+*/
+
+StrCpy $0 0
+StrCpy $7 0 
+/*loop:
+  
+  StrCmp $1 "" notfound
+  ReadRegStr $2 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}\$1" "NetCfgInstanceId"
+  ReadRegStr $4 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}\$1" "DriverDesc"
+  StrCmp "TAP-Win32 Adapter V8" $4 found
+  StrCpy $6 $1
+  IntOp $6 $6 + 1 
+  IntOp $0 $0 + 1
+  GoTo loop
+done:*/
+
+EnumRegKey $1 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}" $0
+IntOp $6 $1 + 1 
+${While} $1 != ""
+  ReadRegStr $2 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}\$1" "NetCfgInstanceId"
+  ReadRegStr $4 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}\$1" "DriverDesc"
+  StrCmp "TAP-Win32 Adapter V8" $4 found
+  IntOp $0 $0 + 1
+  EnumRegKey $1 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}" $0
+  IntFmt $7 "%04d" $6
+  ${If} "$7" == "$1" 
+      IntOp $6 $6 + 1 
+  ${EndIf}
+${EndWhile}
+GoTo notfound
+;an error means that we trie to browse through not existing keys 
+;- search was finished, wintap is not there
+#IfErrors notfound next
+
+;if found skipping installation
+found:
+  DetailPrint "Wintap found - skipping installation..."
+  GoTo end
+  
+;if not found we install it
+notfound:
+  DetailPrint "Wintap not found - starting installation. Please wait."
+
+  ;a variable to contain the next entry that will be created by the driver installer
+  #IntOp $0 $6
+  IntFmt $0 "%04d" $6
+  
+  ;launch the tapinstall (devcon) or do something to install the driver
+  SetOutPath "$INSTDIR\driver" ;working directory must be tap installer directory
+  nsExec::ExecToLog "$INSTDIR\driver\tapinstaller"
+  
+  ;rename network connection to TAP-Win32
+  ReadRegStr $3 HKLM "SYSTEM\CurrentControlSet\Control\Class\${ClassGUID}\$0" "NetCfgInstanceId"
+  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Network\${ClassGUID}\$3\Connection" "Name" "TAP-Win32"
+
+  ;message to wait, as the following step takes a stupid amount of time
+  ;and it seems that the PC is doing nothing
+  DetailPrint "Configuring TAP-Win32 Adapter..."
+  DetailPrint "The process will take a while, please wait..."
+
+  ;set TAP-Win32 ip's using netsh
+  nsExec::ExecToLog "netsh interface ip set address TAP-Win32 static 192.168.0.1 255.255.255.0"
+  
+  DetailPrint "Wintap installation completed..."
+  
+end:
+  pop $4
+  pop $2
+  pop $1
+  pop $0
+  DetailPrint "========================================="
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/wintap.uninstaller.nsh	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,3 @@
+RMDir /r "$INSTDIR\driver"
+
+!insertmacro ShowWarningMessage "Please uninstall WinTAP manually from 'Device Manager'." ${WARNING_CODE}
Binary file testtoolsconn/wintap/driver/x64driver/tap0901.cat has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/driver/x64driver/tap0901.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,187 @@
+; ****************************************************************************
+; * Copyright (C) 2002-2008 Telethra, Inc.                            *
+; *  This program is free software; you can redistribute it and/or modify    *
+; *  it under the terms of the GNU General Public License version 2          *
+; *  as published by the Free Software Foundation.                           *
+; ****************************************************************************
+
+; SYNTAX CHECKER
+; cd \WINDDK\3790\tools\chkinf
+; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf
+; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm
+
+; INSTALL/REMOVE DRIVER
+;   tapinstall install OemWin2k.inf TAP0901
+;   tapinstall update OemWin2k.inf TAP0901
+;   tapinstall remove TAP0901
+
+;*********************************************************
+; Note to Developers:
+;
+; If you are bundling the TAP-Win32 driver with your app,
+; you should try to rename it in such a way that it will
+; not collide with other instances of TAP-Win32 defined
+; by other apps.  Multiple versions of the TAP-Win32
+; driver, each installed by different apps, can coexist
+; on the same machine if you follow these guidelines.
+; NOTE: these instructions assume you are editing the
+; generated OemWin2k.inf file, not the source
+; OemWin2k.inf.in file which is preprocessed by winconfig
+; and uses macro definitions from settings.in.
+;
+; (1) Rename all tapXXXX instances in this file to
+;     something different (use at least 5 characters
+;     for this name!)
+; (2) Change the "!define TAP" definition in openvpn.nsi
+;     to match what you changed tapXXXX to.
+; (3) Change TARGETNAME in SOURCES to match what you
+;     changed tapXXXX to.
+; (4) Change TAP_COMPONENT_ID in common.h to match what
+;     you changed tapXXXX to.
+; (5) Change SZDEPENDENCIES in service.h to match what
+;     you changed tapXXXX to.
+; (6) Change DeviceDescription and Provider strings.
+; (7) Change PRODUCT_STRING in constants.h to what you
+;     set DeviceDescription to.
+;
+;*********************************************************
+
+[Version]
+   Signature = "$Windows NT$"
+   CatalogFile = tap0901.cat
+   ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
+   Provider = %Provider%
+   Class = Net
+
+; This version number should match the version
+; number given in SOURCES.
+   DriverVer=01/22/2008,9.00.00.4
+
+[Strings]
+   DeviceDescription = "TAP-Win32 Adapter V9"
+   Provider = "TAP-Win32 Provider V9"
+
+;----------------------------------------------------------------
+;                      Manufacturer + Product Section (Done)
+;----------------------------------------------------------------
+[Manufacturer]
+   %Provider% = tap0901, NTamd64
+
+[tap0901.NTamd64]
+   %DeviceDescription% = tap0901.ndi, tap0901
+
+;---------------------------------------------------------------
+;                             Driver Section (Done)
+;---------------------------------------------------------------
+
+;----------------- Characteristics ------------
+;    NCF_PHYSICAL = 0x04
+;    NCF_VIRTUAL = 0x01
+;    NCF_SOFTWARE_ENUMERATED = 0x02
+;    NCF_HIDDEN = 0x08
+;    NCF_NO_SERVICE = 0x10
+;    NCF_HAS_UI = 0x80
+;----------------- Characteristics ------------
+
+[tap0901.ndi]
+   CopyFiles       = tap0901.driver, tap0901.files
+   AddReg          = tap0901.reg
+   AddReg          = tap0901.params.reg
+   Characteristics = 0x81
+
+[tap0901.ndi.Services]
+   AddService = tap0901,        2, tap0901.service
+
+[tap0901.reg]
+   HKR, Ndi,            Service,      0, "tap0901"
+   HKR, Ndi\Interfaces, UpperRange,   0, "ndis5"
+   HKR, Ndi\Interfaces, LowerRange,   0, "ethernet"
+   HKR, ,               Manufacturer, 0, "%Provider%"
+   HKR, ,               ProductName,  0, "%DeviceDescription%"
+
+[tap0901.params.reg]
+   HKR, Ndi\params\MTU,                  ParamDesc, 0, "MTU"
+   HKR, Ndi\params\MTU,                  Type,      0, "int"
+   HKR, Ndi\params\MTU,                  Default,   0, "1500"
+   HKR, Ndi\params\MTU,                  Optional,  0, "0"
+   HKR, Ndi\params\MTU,                  Min,       0, "100"
+   HKR, Ndi\params\MTU,                  Max,       0, "1500"
+   HKR, Ndi\params\MTU,                  Step,      0, "1"
+   HKR, Ndi\params\MediaStatus,          ParamDesc, 0, "Media Status"
+   HKR, Ndi\params\MediaStatus,          Type,      0, "enum"
+   HKR, Ndi\params\MediaStatus,          Default,   0, "0"
+   HKR, Ndi\params\MediaStatus,          Optional,  0, "0"
+   HKR, Ndi\params\MediaStatus\enum,     "0",       0, "Application Controlled"
+   HKR, Ndi\params\MediaStatus\enum,     "1",       0, "Always Connected"
+   HKR, Ndi\params\MAC,                  ParamDesc, 0, "MAC Address"
+   HKR, Ndi\params\MAC,                  Type,      0, "edit"
+   HKR, Ndi\params\MAC,                  Optional,  0, "1"
+   HKR, Ndi\params\AllowNonAdmin,        ParamDesc, 0, "Non-Admin Access"
+   HKR, Ndi\params\AllowNonAdmin,        Type,      0, "enum"
+   HKR, Ndi\params\AllowNonAdmin,        Default,   0, "1"
+   HKR, Ndi\params\AllowNonAdmin,        Optional,  0, "0"
+   HKR, Ndi\params\AllowNonAdmin\enum,   "0",       0, "Not Allowed"
+   HKR, Ndi\params\AllowNonAdmin\enum,   "1",       0, "Allowed"
+
+;----------------------------------------------------------------
+;                             Service Section
+;----------------------------------------------------------------
+
+;---------- Service Type -------------
+;    SERVICE_KERNEL_DRIVER     = 0x01
+;    SERVICE_WIN32_OWN_PROCESS = 0x10
+;---------- Service Type -------------
+
+;---------- Start Mode ---------------
+;    SERVICE_BOOT_START   = 0x0
+;    SERVICE_SYSTEM_START = 0x1
+;    SERVICE_AUTO_START   = 0x2
+;    SERVICE_DEMAND_START = 0x3
+;    SERVICE_DISABLED     = 0x4
+;---------- Start Mode ---------------
+
+[tap0901.service]
+   DisplayName = %DeviceDescription%
+   ServiceType = 1
+   StartType = 3
+   ErrorControl = 1
+   LoadOrderGroup = NDIS
+   ServiceBinary = %12%\tap0901.sys
+
+;-----------------------------------------------------------------
+;                                File Installation
+;-----------------------------------------------------------------
+
+;----------------- Copy Flags ------------
+;    COPYFLG_NOSKIP = 0x02
+;    COPYFLG_NOVERSIONCHECK = 0x04
+;----------------- Copy Flags ------------
+
+; SourceDisksNames
+; diskid = description[, [tagfile] [, <unused>, subdir]]
+; 1 = "Intel Driver Disk 1",e100bex.sys,,
+
+[SourceDisksNames]
+   1 = %DeviceDescription%, tap0901.sys
+
+; SourceDisksFiles
+; filename_on_source = diskID[, [subdir][, size]]
+; e100bex.sys = 1,, ; on distribution disk 1
+
+[SourceDisksFiles]
+tap0901.sys = 1
+
+[DestinationDirs]
+   tap0901.files  = 11
+   tap0901.driver = 12
+
+[tap0901.files]
+;   TapPanel.cpl,,,6   ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+;   cipsrvr.exe,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+[tap0901.driver]
+   tap0901.sys,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+;---------------------------------------------------------------
+;                                      End
+;---------------------------------------------------------------
Binary file testtoolsconn/wintap/driver/x64driver/tap0901.sys has changed
Binary file testtoolsconn/wintap/driver/x64driver/tapinstaller.x64.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/group/bld.inf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,52 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRJ_PLATFORMS
+WINSCW
+
+PRJ_EXPORTS
+../driver/wintap-config.doc             /epoc32/engineeringtools/driver/wintap-config.doc
+../driver/license.txt	                /epoc32/engineeringtools/driver/license.txt
+../driver/OemWin2k.inf			/epoc32/engineeringtools/driver/OemWin2k.inf
+../driver/tap0801.sys			/epoc32/engineeringtools/driver/tap0801.sys
+../driver/tap0901.inf			/epoc32/engineeringtools/driver/tap0901.inf
+../driver/tap0901.sys			/epoc32/engineeringtools/driver/tap0901.sys
+../driver/tap0901.cat			/epoc32/engineeringtools/driver/tap0901.cat
+../driver/tapinstaller.exe		/epoc32/engineeringtools/driver/tapinstaller.exe
+../driver/x64driver/tap0901.inf			/epoc32/engineeringtools/driver/x64driver/tap0901.inf
+../driver/x64driver/tap0901.sys			/epoc32/engineeringtools/driver/x64driver/tap0901.sys
+../driver/x64driver/tap0901.cat			/epoc32/engineeringtools/driver/x64driver/tap0901.cat
+../driver/x64driver/tapinstaller.x64.exe	/epoc32/engineeringtools/driver/x64driver/tapinstaller.x64.exe
+../driver/wintap.configure.nsh		/epoc32/engineeringtools/driver/wintap.configure.nsh
+../driver/wintap.uninstaller.nsh	/epoc32/engineeringtools/driver/wintap.uninstaller.nsh
+
+#if defined(WINS)||defined(WINSCW)
+
+#ifdef INSTALLER
+
+PRJ_MMPFILES
+wintaplibinst.mmp
+ethertap.mmp
+
+#else
+
+PRJ_MMPFILES
+wintaplib.mmp
+ethertap.mmp
+
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/group/ethertap.mmp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#include "kernel/kern_ext.mmh"
+
+target                  ethertap.pdd
+targettype              pdd
+
+userinclude             ../inc
+
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+systeminclude           /epoc32/include/platform/drivers
+
+sourcepath              ../src
+source                  ethertap.cpp
+capability              all
+
+staticlibrary           wintap.lib
+
+start wins
+win32_library		kernel32.lib
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/group/release.txt	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,5 @@
+NOTESRC_RELEASER
+Symbian Software Ltd. 
+
+NOTESRC_RELEASE_REASON
+WinTap release.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/group/wintap.mrp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+component	ana_testexec_testtoolsconn_wintap
+source	/src/tools/ana/testexec/testtoolsconn/wintap
+binary	/src/tools/ana/testexec/testtoolsconn/wintap/group	all
+exports	/src/tools/ana/testexec/testtoolsconn/wintap/group
+notes_source    /src/tools/ana/testexec/testtoolsconn/wintap/group/release.txt
+#notes_source    ./release.txt
+
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr T 
+
+# == end auto-inserted section ==
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/group/wintap.tdf	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tool name="WinTap" 
+	description="WinTap is a tool that is used to provide internet connectivity between the device and the workstation"  
+	version="2.1.2001" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="TDF_v1.1.xsd">
+  <properties>
+    <property name="visible" type="toolLogic" value="false"></property>
+  </properties>
+  <templates>
+    <template type="nsis" operation="uninstall" name="\epoc32\engineeringtools\driver\wintap.uninstaller.nsh" output="wintap.uninstaller.nsh">
+    </template>
+    <template type="nsis" operation="configure" name="\epoc32\engineeringtools\driver\wintap.configure.nsh" output="wintap.configure.nsh">
+    </template>
+  </templates>
+  <files>
+    <file source="\epoc32\engineeringtools\driver\license.txt" target="$INSTDIR\driver"/>
+    <file source="\epoc32\engineeringtools\driver\OemWin2k.inf" target="$INSTDIR\driver"/>
+    <file source="\epoc32\engineeringtools\driver\tap0801.sys" target="$INSTDIR\driver"/>
+    <file source="\epoc32\engineeringtools\driver\tap0901.cat" target="$INSTDIR\driver"/>
+    <file source="\epoc32\engineeringtools\driver\tap0901.sys" target="$INSTDIR\driver"/>
+    <file source="\epoc32\engineeringtools\driver\tap0901.inf" target="$INSTDIR\driver"/>
+    <file source="\epoc32\engineeringtools\driver\x64driver\tap0901.cat" target="$INSTDIR\driver\x64driver"/>
+    <file source="\epoc32\engineeringtools\driver\x64driver\tap0901.sys" target="$INSTDIR\driver\x64driver"/>
+    <file source="\epoc32\engineeringtools\driver\x64driver\tap0901.inf" target="$INSTDIR\driver\x64driver"/>
+    <file source="\epoc32\engineeringtools\driver\x64driver\tapinstaller.x64.exe" target="$INSTDIR\driver\x64driver"/>
+    <file source="\epoc32\engineeringtools\driver\tapinstaller.exe" target="$INSTDIR\driver"/>
+    <file source="\epoc32\release\winscw\udeb\wintap.lib" target="$EPOCROOT\epoc32\release\winscw\udeb"/>
+    <file source="\epoc32\release\winscw\udeb\ethertap.pdd" target="$EPOCROOT\epoc32\release\winscw\udeb"/>
+    <file source="\epoc32\release\winscw\urel\wintap.lib" target="$EPOCROOT\epoc32\release\winscw\urel"/>
+    <file source="\epoc32\release\winscw\urel\ethertap.pdd" target="$EPOCROOT\epoc32\release\winscw\urel"/>
+    <file source="\epoc32\release\winscw\urel\ethertap.pdd.map" target="$EPOCROOT\epoc32\release\winscw\urel"/>
+  </files>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/group/wintaplib.mmp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+target		wintap.lib
+TARGETTYPE	lib
+
+sourcepath	../src
+source		wintap.cpp
+
+userinclude ../inc
+userinclude /epoc32/include
+
+start wins
+win32_library           kernel32.lib
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/group/wintaplibinst.mmp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+target		wintap.lib
+TARGETTYPE	lib
+sourcepath	../src
+source		wintap.cpp
+
+userinclude ../inc
+userinclude /epoc32/include
+
+start wins
+win32_library           kernel32.lib
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/inc/wintap.h	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <windows.h>
+#include <time.h>
+#include <IPHlpApi.h>
+
+#include <winioctl.h>
+
+// TAP driver definitions
+#define TAP_IOCTL_GET_LASTMAC		CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 0 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_GET_MAC			CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 1 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_SET_STATISTICS	CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_GET_VERSION		CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_GET_MTU			CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_GET_INFO			CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_CONFIG_POINT_TO_POINT		CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_SET_MEDIA_STATUS	CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_CONFIG_DHCP_MASQ	CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define TAP_IOCTL_GET_LOG_LINE		CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, 9 , METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// TAP -v8 ioctls
+#define TAP_CONTROL_CODE(request,method) \
+  CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
+
+#define TAP_IOCTL_GET_MAC_V8               TAP_CONTROL_CODE (1, METHOD_BUFFERED)
+#define TAP_IOCTL_GET_VERSION_V8           TAP_CONTROL_CODE (2, METHOD_BUFFERED)
+#define TAP_IOCTL_GET_MTU_V8               TAP_CONTROL_CODE (3, METHOD_BUFFERED)
+#define TAP_IOCTL_GET_INFO_V8              TAP_CONTROL_CODE (4, METHOD_BUFFERED)
+#define TAP_IOCTL_CONFIG_POINT_TO_POINT_V8 TAP_CONTROL_CODE (5, METHOD_BUFFERED)
+#define TAP_IOCTL_SET_MEDIA_STATUS_V8      TAP_CONTROL_CODE (6, METHOD_BUFFERED)
+#define TAP_IOCTL_CONFIG_DHCP_MASQ_V8      TAP_CONTROL_CODE (7, METHOD_BUFFERED)
+#define TAP_IOCTL_GET_LOG_LINE_V8          TAP_CONTROL_CODE (8, METHOD_BUFFERED)
+#define TAP_IOCTL_CONFIG_DHCP_SET_OPT_V8   TAP_CONTROL_CODE (9, METHOD_BUFFERED)
+
+
+// Redefinition
+typedef struct _PACKET
+	{	
+	OVERLAPPED			OverLapped;	///< MUST BE FIRST
+	void			*	Buffer; 	///< ptr to buffer
+	DWORD				Length;
+	unsigned int		Queued;
+	} PACKET, *PPACKET;
+
+typedef void (*TIsr)(void const* aObject, int aErr, u_char* pkt_data, DWORD* aLength);
+
+void SetIsr(void * aObject, TIsr aIsr);
+int InitDriver(HANDLE& iWinTapHandle, HANDLE& iThreadHandle, PACKET& iWritePacket, IP_ADAPTER_INFO& iAdapterinfo);
+void DoClose(HANDLE& iWinTapHandle, HANDLE& iThreadHandle, PACKET& iWritePacket);
+int DoSend(PACKET& iWritePacket, HANDLE& iWinTapHandle);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/src/ethertap.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,761 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+/** @file wins/specific/ethernet.cpp
+ * PDD for the Ethernet under the windows emulator
+ */
+
+#include <e32cmn.h>
+
+#include "wintap.h"
+
+#ifdef _WIN32_WINNT
+#undef _WIN32_WINNT
+#endif
+
+#include <ethernet.h>
+#include <nk_priv.h>
+#include <nk_plat.h>
+#include <property.h>
+
+#define OUTPUT_ERROR(_x)	//OutputError(_x)
+/*
+void  OutputError(const char * aErrString)
+    {
+    unsigned long	error;
+    TCHAR*	Buffer[512];
+	
+    error = GetLastError();
+	
+    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,NULL,error,LANG_NEUTRAL,Buffer,256,NULL);
+	
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("%S", aErrString));
+    __KTRACE_OPT(KHARDWARE, Kern::Printf(" -> "));
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("%S", Buffer));
+	}
+*/
+
+/** @addtogroup enet Ethernet Drivers
+ *  Kernel Ethernet Support
+ */
+
+/** @addtogroup enet_pdd Driver PDD's
+ * @ingroup enet
+ */
+
+/** @addtogroup enet_byplatform Ethernet support by platform
+ * @ingroup enet
+ */
+
+/** @addtogroup enet_wins WINS (Emulator) Ethernet support
+ * @ingroup enet_byplatform
+ */
+
+
+// strings potentially written to epoc.ini by netcards.exe
+#define	KEpocIniEthSpeed10Mbps	"10Mbps"
+#define	KEpocIniEthSpeed100Mbps	"100Mbps"
+
+// entries in epoc.ini file:
+#define	KEpocIniEthSpeedEntry	"ETHER_SPEED"
+#define	KEpocIniEthNIFEntry	"ETHER_NIF"
+#define	KEpocIniEthMACEntry	"ETHER_MAC"
+
+#define KEthDrvPanicCategory "D32ETHER"
+
+#define KLocalDriverNameMax				256
+
+// Figure this out later
+_LIT(KPddName, "Ethernet.Wins");
+
+// needs ldd version..
+const TInt KMinimumLddMajorVersion=1;
+const TInt KMinimumLddMinorVersion=0;
+const TInt KMinimumLddBuild=122;
+
+/** @addtogroup enet_windows Windows Emulator Ethernet Pdd
+ * @ingroup enet_pdd
+ * @ingroup enet_wins
+ * @{
+ */
+
+/**
+ * The Windows specific Ethernet physical device (factory) class 
+ * @internalTechnology belongs to PDD which sits internally in kernel 
+ */
+class DDriverEthernet : public DPhysicalDevice
+    {
+public:
+
+    /**
+     * The constructor
+     * Sets the drivers version number. Limits possible
+	 * number of units to one only (unit 0)
+     */
+    DDriverEthernet();
+
+    /**
+     * Inherited from DPhysicalDevice.
+	 * Install the driver by setting it's name
+	 * @return KErrNone on success, other error code on failure
+     */
+    virtual TInt Install();
+
+    /**
+     * Inherited from DPhysicalDevice.
+	 * Get the Capabilites of the driver
+     * NOT supported but required as implementation of
+	 * pure virtual in base class
+     */
+    virtual void GetCaps(TDes8 &aDes) const;
+
+    /**
+     * Inherited from DPhysicalDevice.
+	 * Create a channel to a device
+	 * @param aChannel a reference to a newly created channel object
+	 * @param aUnit a unit for which the channel is being created
+	 * @param anInfo pointer to a descriptor with additional info (may be NULL)
+	 * @param aVer a requested version
+     * @return KErrNone on success, other error code on failure
+     */
+    virtual TInt Create(DBase*& aChannel, TInt aUnit, 
+						const TDesC8* anInfo, const TVersion &aVer);
+
+    /**
+     * Inherited from DPhysicalDevice.
+	 * Validate that the info supplied would create a valid channel
+	 * @param aUnit a unit for which validation is not used
+	 * @param anInfo pointer to a descriptor with additional info (may be NULL)
+	 * @param aVer a version to be validated
+     * @return KErrNone if valid, KErrNotSupported otherwise
+	 */
+    virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion &aVer);
+	};
+
+
+/**
+ * The WINS specific Ethernet channel class for the libpcap library
+ * @internalTechnology belongs to PDD which sits internally in kernel 
+ */
+class DEthernetWins : public DEthernet
+    {
+    friend void Isr(void const* aObject, TInt aErr, u_char* pkt_data, DWORD* aLength);
+
+public:
+
+	enum TWinsEtherPanic
+	{
+	EBadMacAddress = 1, // means bad MAC address in ini file or entry for it missing or ini file missing
+	ENoNetInterface, // means entry for network interface name missing in ini file or ini file missing
+	EPcapNull	// means Wpcap couldn't be initialised - potentially not installed or name of network interface in ini file wrong
+	};
+
+    /**
+     * The Constructor.
+     */
+    DEthernetWins();
+
+    /**
+     * The Destructor.
+     */
+    ~DEthernetWins();
+
+    /**
+     * The DoCreate Method.
+     * Sets up the channel as part of the object creation
+     * and retrieves the MAC address from epoc.ini file.
+	 * Also creates wpcap handler and thread for wpcap loop.
+	 * @pre epoc32\\data\\epoc.ini must exist with entries: "ETHER-NIF=..", "ETHER-MAC=..", "ETHER-SPEED=.."
+	 * @param aUnit a unit for which the channel is being created
+	 * @panic D32ETHER reason: (1) can't get proper MAC address (2) can't get
+	 * network interface name (3) can't initialise wpcap
+	 * @return KErrNone on success, other error code on failure
+	 */
+    TInt DoCreate(TInt aUnit); 
+
+    /**
+     * DEthernet implementation.
+	 * Start the receiver.
+     * Resumes pcap thread. Sets status to ready.
+	 * @return KErrNone on success or suitable error code on failure
+     */
+    virtual TInt Start();
+
+    /**
+     * DEthernet implementation.
+	 * Stop the receiver.
+     * @param aMode possible values are: EStopNormal (=0), EStopEmergency (=1)
+	 * @post pcap thread suspended, status set to not ready
+     */
+    virtual void Stop(TStopMode aMode);
+
+    /**
+     * DEthernet implementation.
+	 * Validates a new configuration - should be called before Configure()
+     * @param aConfig is the configuration to be validated
+     * @return KErrNone if aConfig valid, KErrNotSupported otherwise
+     * @see Configure()
+     */
+    virtual TInt ValidateConfig(const TEthernetConfigV01 &aConfig) const;
+
+    /**
+     * DEthernet implementation.
+	 * Configure the PDD and pcap library
+     * Reconfigure the library using the new configuration supplied.
+	 * Sets pcap filter to read only frames with destination address set to
+	 * broadcast, multicast or MAC addresss from defaultConfig.
+     * This will not change the MAC address.
+     * @param aConfig The new configuration
+	 * @return KErrNone on success, suitable error code otherwise
+     * @see ValidateConfig()
+     * @see MacConfigure()
+     */
+    virtual TInt Configure(TEthernetConfigV01 &aConfig);
+
+    /**
+     * DEthernet implementation.
+	 * Change the MAC address - writes new MAC address in defaultConfig.
+	 * If new settings are to have any effect then pcap filter
+	 * ought to be set again which is done by 'Configure()'
+	 * @param aConfig a configuration structure containing the new MAC
+     * @see Configure()
+     */
+    virtual void MacConfigure(TEthernetConfigV01 &aConfig);
+
+	/**
+     * DEthernet implementation.
+	 * Get the current config from defaultConfig member varaiable
+	 * which is assumed to be up to date.
+     * Fills in the following fields:
+     * The Transmit Speed
+     * The Duplex Setting
+     * The MAC address
+     * @param aConfig is a TEthernetConfigV01 reference that will be filled in
+     */
+    virtual void GetConfig(TEthernetConfigV01 &aConfig) const;
+
+	/**
+     * DEthernet implementation.
+	 * Dummy method, required as pure virtual in base class
+     */
+    virtual void CheckConfig(TEthernetConfigV01 &aConfig);
+
+	/**
+     * DEthernet implementation.
+	 * Should query the capabilites.
+     * NOT supported but required as pure virtual in base class
+     */
+    virtual void Caps(TDes8 &aCaps) const;
+
+    /**
+     * DEthernet implementation.
+	 * Transmit data via wpcap
+     * @param aBuffer reference to the data to be sent
+     * @return KErrNone on success, other error code on failure
+     */
+    virtual TInt Send(TBuf8<KMaxEthernetPacket+32> &aBuffer);
+
+    /**
+     * DEthernet implementation.
+	 * Retrieve data
+     * Pull the received data out of the pcap library and into the supplied buffer. 
+     * Need to be told if the buffer is OK 
+     * @param aBuffer Reference to the buffer to be used to store the data in
+     * @param okToUse Bool to indicate if the buffer is usable
+     * @return KErrNone on success, other error code on failure
+     */
+    virtual TInt ReceiveFrame(TBuf8<KMaxEthernetPacket+32> &aBuffer, TBool okToUse);
+
+	/**
+     * DEthernet implementation.
+	 * Disables all IRQ's 
+     * @return The IRQ level before it was changed
+     * @see RestoreIrqs()
+     */
+    virtual TInt DisableIrqs();
+
+    /**
+     * DEthernet implementation.
+	 * Restore the IRQ's to the supplied level
+	 * @param aIrq The level to set the irqs to.
+     * @see DisableIrqs()
+     */
+    virtual void RestoreIrqs(TInt aIrq);
+
+	/**
+     * DEthernet implementation.
+	 * Return the DFC Queue that this device should use
+     * @param aUnit a channel's unit number (ignored - only one unit possible)
+     * @return a DFC Queue to use
+     */
+    virtual TDfcQue* DfcQ(TInt aUnit);
+		
+private:
+
+	/**
+     * Read network interface to be used from configuration file. Panic if
+	 * pre-conditions are not satisfied.
+	 * @pre epoc32\\data\\epoc.ini must exist with entry: "ETHER-NIF=existing_nif_name"
+	 * @post network interface name put in a member variable: iNetInterfaceName
+	 * @panic D32ETHER reason: (2) can't get network interface name 
+     */
+	void  SetDriverName();
+
+	/**
+	 * Read MAC address from a configuration file and put it
+	 * into defaultConfig member variable checking before if the
+	 * one from the file is correct. Panic if pre-conditions are not satisfied
+	 * (although in case when MAC address is improper).
+	 * @pre epoc32\\data\\epoc.ini must exist with entry: "ETHER-MAC=proper_mac_address"
+	 * @panic D32ETHER reason: (3) can't initialise wpcap
+	 * @return KErrNone on success (panics on failure)
+	 */
+	TInt GetIfName();
+
+private:
+
+	HANDLE				iWinTapHandle;
+
+	PACKET 				iWritePacket;
+	PACKET				iReadPacket;
+   /**
+     * Id of the receiver - wpcap thread
+     */
+    unsigned long iWorkerThreadId;
+
+	/**
+     * Contains the handle to wpcap thread. 
+     */
+	HANDLE				iThreadHandle;
+
+    /**
+     * Stores the unit number (only one interface possible in 
+	 * this implementation, so it will have value "0")
+     */
+    TInt  iUnit;
+	
+    /**
+     * Is ETrue if the chip has been fully configured and is ready
+	 * for receiving frames. Is set to ETrue in Start(), to EFalse
+	 * in Stop(). Initialized in constructor as EFalse.
+     */
+    TBool iReady;
+
+    /**
+     * Contains the default/current configuration of the driver.
+	 * Updated whenever configuration is to be changed.
+     */
+    TEthernetConfigV01 defaultConfig;
+
+	/**
+     * Contains the network interface name to be used 
+	 * @see SetDriverName()
+     */
+	char	iNetInterfaceName[KLocalDriverNameMax];
+    };
+
+/** @} */ // End of wins ethernet pdd
+
+
+ 
+DDriverEthernet::DDriverEthernet()
+// Constructor
+    {
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DDriverEthernet::DDriverEthernet()"));
+    iUnitsMask=0x1;	// support unit 0 only
+    iVersion=TVersion(KEthernetMajorVersionNumber,
+                      KEthernetMinorVersionNumber,
+                      KEthernetBuildVersionNumber);
+	
+	}
+
+
+TInt DDriverEthernet::Install()
+// Install the driver
+    {
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DDriverEthernet::Install()"));
+    return SetName(&KPddName);
+    }
+
+
+void GetWinsEthernetsCaps(TDes8 &aCaps, TInt aUnit=0)
+    {
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("GetWinsEthernetsCaps(TDes8 &aCaps, TInt aUnit)"));
+    TEthernetCaps capsBuf;
+	
+	aUnit=0;
+
+    aCaps.FillZ(aCaps.MaxLength());
+    aCaps=capsBuf.Left(Min(capsBuf.Length(),aCaps.MaxLength()));
+    }
+
+void PanicFromWinsEtherDrv(TInt aReason)
+	{
+	Kern::Fault(KEthDrvPanicCategory, aReason);
+	}
+
+void DDriverEthernet::GetCaps(TDes8 &aDes) const
+// Return the driver's capabilities
+    {
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DDriverEthernet::GetCaps(TDes8 &aDes) const"));
+    GetWinsEthernetsCaps(aDes);	
+    }
+
+
+TInt DDriverEthernet::Create(DBase*& aChannel, 
+                             TInt aUnit, 
+                             const TDesC8* aInfo, 
+                             const TVersion& aVer)
+// Create a driver
+    {
+    __KTRACE_OPT(KHARDWARE, 
+		Kern::Printf("DDriverEthernet::Create(DBase*& aChannel, TInt aUnit, const TDesC8* nInfo, const TVersion& aVer)"));
+	
+    TInt ret;
+
+	ret = Validate( aUnit, aInfo, aVer);
+	if ( KErrNone != ret )
+		return ret;
+
+	ret = KErrNoMemory;
+
+	DEthernetWins* ptrPdd = new DEthernetWins;
+	
+	if ( ptrPdd )
+        {
+        ret = ptrPdd->DoCreate(aUnit);
+        if ( ret != KErrNone)
+			{
+            delete ptrPdd;
+			}	
+		else
+			aChannel = ptrPdd;
+        }
+
+	
+    return ret;
+    }
+
+
+TInt DDriverEthernet::Validate(TInt aUnit, 
+                               const TDesC8* /*aInfo*/, 
+                               const TVersion& aVer)
+//	Validate the requested configuration
+    {
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DDriverEthernet::Validate(TInt aUnit, const TDesC8* /*aInfo*/, const TVersion& aVer)"));
+    if ((!Kern::QueryVersionSupported(iVersion,aVer)) || 
+        (!Kern::QueryVersionSupported(aVer,TVersion(KMinimumLddMajorVersion,
+                                                    KMinimumLddMinorVersion,
+                                                    KMinimumLddBuild))))
+		{
+        return KErrNotSupported;
+		}
+    
+	if (aUnit != 0)
+		{
+        return KErrNotSupported;
+		}
+
+	return KErrNone;
+    }
+
+
+DEthernetWins::DEthernetWins()
+// Constructor
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::DEthernetWins()"));
+
+    iReady = EFalse;
+    
+	// set default configuration - must be set before DoCreate gets called
+	defaultConfig.iEthSpeed  = KEthSpeedUnknown;
+    defaultConfig.iEthDuplex = KEthDuplexUnknown;
+							
+	// MAC address initially set to NULL
+	defaultConfig.iEthAddress[0] = 0; 
+    defaultConfig.iEthAddress[1] = 0; 
+    defaultConfig.iEthAddress[2] = 0; 
+	defaultConfig.iEthAddress[3] = 0; 
+    defaultConfig.iEthAddress[4] = 0; 
+    defaultConfig.iEthAddress[5] = 0; 
+	
+	iNetInterfaceName[0] = '\0';
+	}
+
+TDfcQue* DEthernetWins::DfcQ(TInt /*aUnit*/)
+// Return the DFC queue to be used for this device
+	{
+    __KTRACE_OPT(KHARDWARE, 
+		Kern::Printf("DEthernetWins::DfcQ(TInt )"));
+    return Kern::DfcQue0();
+	}
+
+
+TInt DEthernetWins::Start()
+// Start receiving frames
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::Start()"));
+
+	TInt32 ret;
+	
+	// Start thread
+	// ResumeThread() - from MSDN help:
+	// This function decrements a thread’s suspend count. 
+	// When the suspend count is decremented to zero, 
+	// the execution of the thread is resumed. 
+	// Return value: The thread’s previous suspend count indicates success. 0xFFFFFFFF indicates failure
+	ret = ResumeThread( iThreadHandle );
+	if( (0xFFFFFFFF == ret) )//|| (ret > 1) )
+		return KErrGeneral;
+	
+    iReady = ETrue;
+
+    return KErrNone;
+	}
+
+
+void DEthernetWins::Stop(TStopMode aMode)
+// Stop receiving frames
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::Stop(TStopMode aMode)"));
+
+	
+    switch (aMode)
+		{
+        case EStopNormal:
+        case EStopEmergency:
+			SuspendThread(iThreadHandle);
+			iReady = EFalse;
+			break;
+		default:
+			SuspendThread(iThreadHandle);
+			iReady = EFalse;
+			break;
+		}
+
+	}
+
+
+TInt DEthernetWins::ValidateConfig(const TEthernetConfigV01 &aConfig) const
+// Validate a config structure.
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::ValidateConfig(const TEthernetConfigV01 &aConfig) const"));
+    switch(aConfig.iEthSpeed)
+        {
+        case KEthSpeedUnknown:
+		case KEthSpeedAuto: 
+        case KEthSpeed10BaseT:
+        case KEthSpeed100BaseTX:
+			break;
+        default:		
+        	return KErrNotSupported;
+        }
+
+    switch(aConfig.iEthDuplex)
+        {
+        case KEthDuplexUnknown:
+		case KEthDuplexAuto:
+        case KEthDuplexHalf:
+        case KEthDuplexFull:
+			break;
+        default:
+        	return KErrNotSupported;
+        }
+
+    return KErrNone;
+	}
+
+
+void DEthernetWins::CheckConfig(TEthernetConfigV01& /*aConfig*/)
+// dummy implementation of pure virtual function
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::CheckConfig(TEthernetConfigV01& aConfig)"));
+	}
+
+TInt DEthernetWins::DisableIrqs()
+// Disable normal interrupts
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::DisableIrqs()"));
+    return NKern::DisableInterrupts(1);
+	}
+
+
+void DEthernetWins::RestoreIrqs(TInt aLevel)
+// Restore normal interrupts
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::RestoreIrqs(TInt aLevel)"));
+    NKern::RestoreInterrupts(aLevel);
+	}
+
+
+void DEthernetWins::MacConfigure(TEthernetConfigV01 &aConfig)
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::MacConfigure(TEthernetConfigV01 &aConfig)"));
+    defaultConfig.iEthAddress[0] = aConfig.iEthAddress[0]; 
+	defaultConfig.iEthAddress[1] = aConfig.iEthAddress[1];
+	defaultConfig.iEthAddress[2] = aConfig.iEthAddress[2];
+	defaultConfig.iEthAddress[3] = aConfig.iEthAddress[3];
+	defaultConfig.iEthAddress[4] = aConfig.iEthAddress[4];
+	defaultConfig.iEthAddress[5] = aConfig.iEthAddress[5];
+	}
+
+
+TInt DEthernetWins::Configure(TEthernetConfigV01 & /*aConfig*/)
+// Set a wpcap filter
+	{
+
+	__KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::Configure(TEthernetConfigV01 &aConfig)"));
+	
+    return KErrNone; 
+	}
+
+
+void DEthernetWins::GetConfig(TEthernetConfigV01 &aConfig) const
+// Get the current config from defaultConfig member
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::GetConfig(TEthernetConfigV01 &aConfig) const"));
+    aConfig = defaultConfig;
+	}
+
+
+void DEthernetWins::Caps(TDes8 &aCaps) const
+// return PDD's capabilites
+    {
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::Caps(TDes8 &aCaps) const"));
+    GetWinsEthernetsCaps(aCaps,iUnit); 
+    }
+
+TInt DEthernetWins::ReceiveFrame(TBuf8<KMaxEthernetPacket+32> &aBuffer, TBool okToUse)
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::ReceiveFrame(TBuf8<KMaxEthernetPacket+32> &aBuffer)"));
+
+	// If no buffer available dump frame
+    if(!okToUse)
+		{
+        return KErrGeneral;
+		}
+
+    aBuffer.Copy((u_char*)iReadPacket.Buffer, iReadPacket.Length);
+    aBuffer.SetLength(iReadPacket.Length);
+
+    return KErrNone;
+	}
+
+/**
+ * @addtogroup enet_windows
+ * @{
+ */
+
+/**
+ * Real entry point from the Kernel: return a new driver
+ * (Macro wrapping: EXPORT_C DPhysicalDevice *CreatePhysicalDevice() )
+ */
+DECLARE_STANDARD_PDD()
+	{
+	return new DDriverEthernet;
+	}
+
+/** @} */ // end of windows group
+
+/**
+ *
+ *	The start of most EtherTap specific routines
+ *
+ **/
+
+TInt DEthernetWins::DoCreate(TInt aUnit)//, const TDesC8* /*anInfo*/)
+// Sets up the PDD
+	{
+	__KTRACE_OPT(KHARDWARE, 
+		Kern::Printf("DEthernetWins::DoCreate(TInt aUnit, const TDesC8* /*anInfo*/)"));
+   
+	iUnit = aUnit;
+
+	SetIsr(this, &Isr);
+
+	IP_ADAPTER_INFO adapterinfo;
+
+	TInt ret = InitDriver(iWinTapHandle, iThreadHandle, iWritePacket, adapterinfo);
+
+	const char* speedProperty = Property::GetString(KEpocIniEthSpeedEntry);
+
+	if( (NULL==speedProperty) ? 0 : (0 == strcmp( speedProperty, KEpocIniEthSpeed10Mbps )) )
+		{
+		defaultConfig.iEthSpeed = KEthSpeed10BaseT;
+		}
+	else if ( (NULL==speedProperty) ? 0 : (0 == strcmp( speedProperty, KEpocIniEthSpeed100Mbps )) )
+		{
+		defaultConfig.iEthSpeed = KEthSpeed100BaseTX;
+		}
+	
+    defaultConfig.iEthAddress[0]	= adapterinfo.Address[0];
+    defaultConfig.iEthAddress[1]	= adapterinfo.Address[1];
+    defaultConfig.iEthAddress[2]	= (TUint8)(adapterinfo.Address[2] + 2);
+    defaultConfig.iEthAddress[3]	= adapterinfo.Address[3];
+    defaultConfig.iEthAddress[4]	= adapterinfo.Address[4];
+	defaultConfig.iEthAddress[5]	= adapterinfo.Address[5];
+
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::DoCreate %2x:%2x:%2x:%2x:%2x:%2x",
+                                         defaultConfig.iEthAddress[0], 
+                                         defaultConfig.iEthAddress[1],
+                                         defaultConfig.iEthAddress[2], 
+                                         defaultConfig.iEthAddress[3],
+                                         defaultConfig.iEthAddress[4], 
+                                         defaultConfig.iEthAddress[5]));
+
+	return ret;
+	}
+
+DEthernetWins::~DEthernetWins()
+// Destructor
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::~DEthernetWins()"));
+
+	DoClose(iWinTapHandle, iThreadHandle, iWritePacket);
+	}
+
+TInt DEthernetWins::Send(TBuf8<KMaxEthernetPacket+32> &aBuffer)
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::Send(TBuf8<KMaxEthernetPacket+32> &aBuffer)"));
+    iWritePacket.Length = aBuffer.Length();
+    iWritePacket.Buffer = (void *)aBuffer.Ptr();
+
+	return DoSend(iWritePacket, iWinTapHandle);
+	}
+
+void Isr(void const* aObject, TInt aErr, u_char* pkt_data, DWORD* aLength)
+	{
+    __KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::Isr() with error %d", aErr));
+	
+    //dummy line to avoid warning
+    if(aErr!=KErrNone){};
+    
+	DEthernetWins* eth = (DEthernetWins*)aObject;
+	StartOfInterrupt();
+
+	eth->iReadPacket.Length = *aLength;
+	eth->iReadPacket.Buffer = pkt_data;
+
+    eth->ReceiveIsr();
+	
+	EndOfInterrupt();
+
+    return;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/src/wintap.cpp	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,360 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "wintap.h"
+
+#include <assert.h>
+#include <stdio.h>
+
+#ifdef EKA2
+#include <platform/emulator.h>
+#endif
+/**
+ *
+ *	The start of most EtherTap specific routines
+ *
+ **/
+
+static TIsr GlobIsr = NULL;
+static void * GlobObj = NULL;
+
+static int MatchTunAdapter(const char* aDevName)
+	{
+	const char match[] = "TAP";
+	const char matchl[] = "tap";
+
+	// Check the first 3 charecters
+	if (aDevName[0] == match[0]
+		&& aDevName[1] == match[1]
+		&& aDevName[2] == match[2])
+		return 1;
+	else if (aDevName[0] == matchl[0]
+		&& aDevName[1] == matchl[1]
+		&& aDevName[2] == matchl[2])
+		return 1;
+	else
+		return 0;
+	}
+
+static int GetIfName(IP_ADAPTER_INFO& iAdapterinfo)
+	{
+	DWORD			numInterfaces;
+    HMODULE hModule = LoadLibraryA("iphlpapi.dll");
+    if(!hModule)
+        return -1;
+    DWORD (WINAPI * pfGetNumberOfInterfaces)(PDWORD) = (DWORD (WINAPI * )(PDWORD))GetProcAddress(hModule, "GetNumberOfInterfaces");
+    DWORD (WINAPI * pfGetAdaptersInfo)(PIP_ADAPTER_INFO,PULONG) = (DWORD (WINAPI *)(PIP_ADAPTER_INFO,PULONG))GetProcAddress(hModule, "GetAdaptersInfo");
+
+	// weiredness alert - windows returns found adapters+1
+	if (pfGetNumberOfInterfaces(&numInterfaces) != ERROR_SUCCESS)
+		return -1;
+
+	ULONG            ulOutBufLen;
+	ulOutBufLen = sizeof(IP_ADAPTER_INFO) * (numInterfaces);
+	
+	IP_ADAPTER_INFO  *pAdapterInfo = NULL;
+
+	pAdapterInfo = new IP_ADAPTER_INFO[numInterfaces];
+	
+	if (pAdapterInfo && (pfGetAdaptersInfo( pAdapterInfo, &ulOutBufLen) != ERROR_SUCCESS)) 
+		{
+		delete pAdapterInfo;
+		return -1;
+		}
+
+	IP_ADAPTER_INFO  *pCurAdapterInfo = pAdapterInfo;
+	int count = 1, matchCount = 0;
+	while (pCurAdapterInfo != NULL)
+		{	
+		// Optimize for when we already have the index
+		if (iAdapterinfo.Index == pCurAdapterInfo->Index)
+			{
+			matchCount++;
+			iAdapterinfo = *pCurAdapterInfo;
+			break;
+			}
+
+		if (MatchTunAdapter(pCurAdapterInfo->Description))
+			{
+			matchCount++;
+			iAdapterinfo = *pCurAdapterInfo;
+			}
+
+		pCurAdapterInfo = pCurAdapterInfo->Next;
+		count++;
+		}
+
+	if (matchCount == 0)
+		{
+		delete[] pAdapterInfo;
+		return -1;
+		}
+	else if (matchCount > 1)
+		{}
+	iAdapterinfo.Next = NULL;
+	delete[] pAdapterInfo;
+	return 0;
+	}
+
+static int WorkThread(HANDLE * iWinTapHandle);
+
+int InitDriver(HANDLE& iWinTapHandle, HANDLE& iThreadHandle, PACKET& iWritePacket, IP_ADAPTER_INFO& iAdapterinfo)
+// Sets up the PDD
+	{
+	int ret = 0;
+
+	if ((ret = GetIfName(iAdapterinfo)) != 0)
+		return ret;	
+
+	// Fromat the GUID to get the file name
+	char szFileName[256];	
+	sprintf(szFileName, ("%s%s%s"), ("\\\\.\\"), iAdapterinfo.AdapterName, (".tap"));
+
+	iWinTapHandle = CreateFileA(szFileName,
+								GENERIC_READ | GENERIC_WRITE,
+								FILE_SHARE_READ | FILE_SHARE_WRITE,
+								NULL,
+								OPEN_EXISTING,
+								FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
+								NULL);
+
+	if (iWinTapHandle == INVALID_HANDLE_VALUE)
+		{
+		//OUTPUT_ERROR("could not open file handle\n");
+		CloseHandle(iWinTapHandle);
+		ret = -1;
+		return ret;
+		}
+
+	
+	// set the device to connected
+	ULONG status = 1;
+	DWORD len;
+	if (!DeviceIoControl(iWinTapHandle,
+		TAP_IOCTL_SET_MEDIA_STATUS ,&status, sizeof(status), &status, sizeof(status), &len, NULL))
+		{
+		// FUDGE alert
+		if (!DeviceIoControl(iWinTapHandle,
+			TAP_IOCTL_SET_MEDIA_STATUS_V8 ,&status, sizeof(status), &status, sizeof(status), &len, NULL))
+			{
+			//OUTPUT_ERROR("Could not set media status to open\n");
+			return ret;
+			}
+		}
+	
+	// Call GetDriverName again, this time to reset the correct info for the connected Device
+	if((ret = GetIfName(iAdapterinfo)) != 0)
+		return ret;
+
+	iWritePacket.OverLapped.hEvent 		= CreateEvent(NULL, TRUE, FALSE, NULL);
+
+	u_long WorkerThreadId;
+	    
+	if ((iThreadHandle = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WorkThread, &iWinTapHandle,
+		CREATE_SUSPENDED,&WorkerThreadId)) != NULL)
+		{
+		ret = 0;
+		}
+	else
+		{
+		//OUTPUT_ERROR("CreateThread() failed to create worker thread");
+		}
+
+	return ret;
+	}
+
+void DoClose(HANDLE& iWinTapHandle, HANDLE& iThreadHandle, PACKET& iWritePacket)
+	{
+	if (iWinTapHandle != INVALID_HANDLE_VALUE)
+		{
+		// Cancel reads, Writes 
+		CancelIo(iWinTapHandle);
+
+		// Close read and write events
+		CloseHandle(iWritePacket.OverLapped.hEvent);
+		
+		// Close the read thread
+		if (!TerminateThread(iThreadHandle, 0))
+			{
+			//__KTRACE_OPT(KHARDWARE, Kern::Printf("Could not Terminate thread\n"));
+			}
+		CloseHandle(iThreadHandle);
+
+		DWORD status = 0, len;
+		if (!DeviceIoControl(iWinTapHandle,
+			TAP_IOCTL_SET_MEDIA_STATUS ,&status, sizeof(status), &status, sizeof(status), &len, NULL))
+			{
+			// Big fudge --
+			if (!DeviceIoControl(iWinTapHandle,
+				TAP_IOCTL_SET_MEDIA_STATUS_V8 ,&status, sizeof(status), &status, sizeof(status), &len, NULL))
+				{
+				//__KTRACE_OPT(KHARDWARE, Kern::Printf("Could not set media status to close\n"));
+				}
+			}
+
+		CloseHandle(iWinTapHandle);
+		iWinTapHandle = INVALID_HANDLE_VALUE;
+		}
+	}
+
+void SetIsr(void * aObject, TIsr aIsr)
+	{
+	assert(aIsr != NULL);
+	assert(aObject != NULL);
+	GlobObj = aObject;
+	GlobIsr = aIsr;
+	}
+
+static int WorkThread(HANDLE * iWinTapHandle)
+	{
+    //__KTRACE_OPT(KHARDWARE, Kern::Printf("WorkThread(DEthernetWins * aDEthernetWins)"));
+	int err = 0;
+
+	u_char			buffer[2000];
+	PACKET			m_ReadPacket;
+
+	m_ReadPacket.OverLapped.hEvent 		= CreateEvent(NULL, TRUE, FALSE, NULL);
+	
+	while( err == 0 )
+		{		
+		m_ReadPacket.OverLapped.Offset 		= 0;
+		m_ReadPacket.OverLapped.OffsetHigh 	= 0;
+		m_ReadPacket.OverLapped.Internal	= 0;
+		m_ReadPacket.OverLapped.InternalHigh= 0;
+		m_ReadPacket.Buffer					= buffer;
+		m_ReadPacket.Length					= 0;
+
+    	//__KTRACE_OPT(KHARDWARE, Kern::Printf("Starting to Read \n"));
+	    if (*iWinTapHandle != INVALID_HANDLE_VALUE)
+			{
+			if (!ReadFile(*iWinTapHandle, m_ReadPacket.Buffer, 2000, 
+				&(m_ReadPacket.Length), &m_ReadPacket.OverLapped))
+				{
+				if(GetLastError() != ERROR_IO_PENDING) 
+					{
+					//__KTRACE_OPT(KHARDWARE, Kern::Printf("m_ReadPacket() Failed "));
+					err = -3;
+					break;
+					}
+				
+				DWORD Result = WaitForSingleObject(m_ReadPacket.OverLapped.hEvent, INFINITE);
+
+				switch(Result)
+					{
+					// OVERLAPPED structure's event has been signaled. 
+					case WAIT_OBJECT_0:
+						if (GetOverlappedResult(*iWinTapHandle, &m_ReadPacket.OverLapped, 
+							&m_ReadPacket.Length, FALSE) == 0)
+							{
+    						//__KTRACE_OPT(KHARDWARE, Kern::Printf("** Error in m_ReadPacket() **\n"));
+							err = -3;
+							}
+						else
+							{
+							// m_ReadPacket operation completed successfully.
+    						//__KTRACE_OPT(KHARDWARE, Kern::Printf("** Completed in m_ReadPacket() **\n"));
+							err = 0;
+							}
+						break;
+					default:
+						 // An error has occurred in WaitForSingleObject.
+						 // This usually indicates a problem with the
+						// OVERLAPPED structure's event handle.
+						err = -3;
+						break;
+					}
+				}
+			else
+				{
+				err = 0;
+    			//__KTRACE_OPT(KHARDWARE, Kern::Printf("** Completed in m_ReadPacket() **\n"));
+				}			
+			}
+		else
+			{
+    		//__KTRACE_OPT(KHARDWARE, Kern::Printf("ReadPacket() No adaptor open\n"));
+			err = -1;
+			}
+		GlobIsr(GlobObj, err, buffer, &m_ReadPacket.Length);
+		}
+	CloseHandle(m_ReadPacket.OverLapped.hEvent);
+	return -3;
+	}
+
+int DoSend(PACKET& iWritePacket, HANDLE& iWinTapHandle)
+	{
+    //__KTRACE_OPT(KHARDWARE, Kern::Printf("DEthernetWins::Send(TBuf8<KMaxEthernetPacket+32> &aBuffer)"));
+    int err;
+    if ( iWinTapHandle != INVALID_HANDLE_VALUE )
+		{
+		iWritePacket.OverLapped.Offset 		= 0;
+		iWritePacket.OverLapped.OffsetHigh 	= 0;
+		iWritePacket.OverLapped.Internal		= 0;
+		iWritePacket.OverLapped.InternalHigh	= 0;
+		
+		if(!WriteFile(iWinTapHandle, iWritePacket.Buffer, iWritePacket.Length, NULL, &iWritePacket.OverLapped))
+			{
+			if(GetLastError() != ERROR_IO_PENDING) 
+				{
+				//__KTRACE_OPT(KHARDWARE, Kern::Printf("WriteFile() Failed  "));
+				err = -23; //KErrWrite
+				return err;
+				}
+			else	//Pending Write
+				{
+				DWORD written;
+				DWORD Result = WaitForSingleObject(iWritePacket.OverLapped.hEvent, INFINITE);
+				switch(Result)
+					{
+					// OVERLAPPED structure's event has been signaled. 
+					case WAIT_OBJECT_0:
+						if (!GetOverlappedResult(iWinTapHandle, &iWritePacket.OverLapped, &written, FALSE))
+							{
+			            	//__KTRACE_OPT(KHARDWARE, Kern::Printf("** Error in WritePacket() **\n"));
+							err = -23; //KErrWrite
+							}
+						else
+							{
+							// Write operation completed successfully.
+            				//__KTRACE_OPT(KHARDWARE, Kern::Printf("** Completed in WritePacket() **"));
+							err = 0;
+							}
+						break;
+					default:
+						 // An error has occurred in WaitForSingleObject.
+						 // This usually indicates a problem with the
+						// OVERLAPPED structure's event handle.
+						err = -23; //KErrWrite
+						break;
+					}
+				}
+			}
+		else //Write went fine
+			{
+            //__KTRACE_OPT(KHARDWARE, Kern::Printf("** Completed in WritePacket() **\n"));
+			err = 0;
+			}
+		}
+    else
+		{
+        //__KTRACE_OPT(KHARDWARE, Kern::Printf("WritePacket() No adaptor open\n"));
+		err = -12; //KErrPathNotFound
+		}
+    return err;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/utils/commdbupdate.pl	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,135 @@
+#
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+
+$#ARGV==6 or die "7 arguments required";
+
+my $input 		= $ARGV[0];
+my $output 		= $ARGV[1];
+my $ipAddress	= $ARGV[2];
+my $ipGateway 	= $ARGV[3];
+my $ipMask 		= $ARGV[4];
+my $ipDNS		= $ARGV[5];
+my $IpAddrFromServer  = $ARGV[6];
+
+my $writeEnabled = 1;		
+
+open INPUT, "<$input"  or die "Cannot open $input: $!";
+open OUTPUT,">$output" or die "Cannot open $output: $!";
+  
+my $iapTable = <<END;
+ 	 	<IAP operation=\"add\">
+ 		<Name>Ethernet WinTAP</Name>
+ 		<IAPService>LANService.Ethernet WinTAP</IAPService>
+ 		<IAPBearer>LANBearer.Ethernet WinTAP</IAPBearer>
+ 		<IAPNetwork>Network.Intranet</IAPNetwork>
+ 		<IAPNetworkWeighting>0</IAPNetworkWeighting>
+ 		<LocationRef>Location.Office</LocationRef>
+ 	</IAP>
+END
+
+my $lanBearerTable = <<END;
+	<LANBearer operation=\"add\">
+		<Name>Ethernet WinTAP</Name>
+		<Agent>nullagt.agt</Agent>
+		<IfName>ethint</IfName>
+		<LDDFilename>enet</LDDFilename>
+		<LDDName>=Ethernet</LDDName>
+		<PDDFilename>ethertap</PDDFilename>
+		<PDDName>Ethertap.Wins</PDDName>
+		<PacketDriverName>EtherPkt.drv</PacketDriverName>
+		<LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+		<LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+		<LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+END
+ 
+my $lanServiceTable = <<END;
+	<LANService operation="add">
+        <Name>Ethernet WinTAP</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>$ipMask</IpNetMask>
+        <IpGateway>$ipGateway</IpGateway>
+        <IpAddrFromServer>FALSE</IpAddrFromServer>
+        <IpAddr>$ipAddress</IpAddr>
+        <IpDNSAddrFromServer>$IpAddrFromServer</IpDNSAddrFromServer>
+        <IpNameServer1>$ipDNS</IpNameServer1>
+        <IpNameServer2>10.23.58.12</IpNameServer2>
+        <Ip6DNSAddrFromServer>FALSE</Ip6DNSAddrFromServer>
+    </LANService>
+END
+
+my $connectionPreferencesTable = <<END;
+    <ConnectionPreferences operation="add">
+        <Name>ConnectionPreferencesTable1</Name>
+        <Ranking>1</Ranking>
+        <Direction>OUTGOING</Direction>
+        <BearerSet>LAN</BearerSet>
+        <DialogPref>PROMPT</DialogPref>
+        <IAPRef>IAP.Ethernet WinTAP</IAPRef>
+    </ConnectionPreferences>
+END
+ 
+while (<INPUT>) 
+{	
+	 if($writeEnabled == 1)
+	 {
+	 	print OUTPUT;
+ 	 }
+	 
+	 #add IAPTable
+	 if(/<IAPTable>/)
+	 {
+	 	print "<IAPTable> found...";
+	 	print OUTPUT $iapTable;
+	 	print "updated\n";
+  	 }
+  	 
+  	  #add LANBearerTable
+	 if(/<LANBearerTable>/)
+	 {
+	 	print "<LANBearerTable> found...";
+	 	print OUTPUT $lanBearerTable;
+	 	print "updated\n";
+  	 }
+  	 
+  	 #add LANServiceTable
+	 if(/<LANServiceTable>/)
+	 {
+	 	print "<LANServiceTable> found...";
+	 	print OUTPUT $lanServiceTable;
+	 	print "updated\n";
+  	 }
+  	 
+  	  #add ConnectionPreferencesTable
+	 if(/<ConnectionPreferencesTable>/)
+	 {
+		$writeEnabled = 0;
+	 	print "<ConnectionPreferencesTable> found...";
+	 	print OUTPUT $connectionPreferencesTable;
+  	 }
+
+  	 if(/<\/ConnectionPreferencesTable>/)
+	 {
+		$writeEnabled = 1;
+	 	print OUTPUT;
+	 	print "updated\n";
+  	 }
+  	 
+}  	 
+  
+close INPUT;
+close OUTPUT;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testtoolsconn/wintap/utils/simplecommdb.xml	Mon Mar 08 15:04:18 2010 +0800
@@ -0,0 +1,1965 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+        CommDB Settings File
+        Copyright (c) 2003-2004, Symbian Ltd.
+        All Rights Reserved
+-->
+<CommDB:Config xmlns="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:CommDB="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:xlink="http://www.w3.org/1999/xlink"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="SymbianOS.Generic.Comms-Infras.CommDB CommDB.xsd">
+
+<InformationTable>
+</InformationTable>
+
+<NetworkTable>
+    <Network operation="add">
+        <Name>Intranet</Name>
+    </Network>
+    <Network operation="add">
+        <Name>mRouter</Name>
+    </Network>
+</NetworkTable>
+
+<IAPTable>
+    <IAP operation="add">
+        <Name>NT RAS with Null Modem</Name>
+        <IAPService>DialOutISP.NT RAS</IAPService>
+        <IAPBearer>ModemBearer.Null Modem 115200bps</IAPBearer>
+        <IAPNetwork>Network.Intranet</IAPNetwork>
+        <IAPNetworkWeighting>0</IAPNetworkWeighting>
+        <LocationRef>Location.Office</LocationRef>
+    </IAP>
+    <IAP operation="add">
+        <Name>Ethernet with DHCP</Name>
+        <IAPService>LANService.Ethernet Dynamic IP</IAPService>
+        <IAPBearer>LANBearer.EKA1 Emulator Ethernet</IAPBearer>
+        <IAPNetwork>Network.Intranet</IAPNetwork>
+        <IAPNetworkWeighting>0</IAPNetworkWeighting>
+        <LocationRef>Location.Office</LocationRef>
+    </IAP>
+</IAPTable>
+
+<ModemBearerTable>
+    <ModemBearer operation="template">
+        <Name>Default Modem</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>0</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>Null Modem 115200bps</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>TRUE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>US Robotics Sportster</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>244</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>AFTERDIALUNTILANSWER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT&amp;F1</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT&amp;d2</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>Dacom Surfer</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>244</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>AFTERDIALUNTILANSWER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT&amp;F</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT&amp;d2</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Infrared</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Serial</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>19200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Ericsson R520m via IR</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Ericsson R520m/T68i via Serial</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>19200</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <IspInitString>*99***1#</IspInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Motorola Mobile Phone via Serial</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>WinTunnel Modem</Name>
+        <Agent>null.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::6</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterWinsBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>WINS::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>WINSCSY</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterRs232Bearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterIrBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterBtBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>BTCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>BTCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterUsbBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>ACM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECACM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+</ModemBearerTable>
+
+<LANBearerTable>
+    <LANBearer operation="add">
+        <Name>EKA1 Target Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>EtherCard</LDDName>
+        <PDDFilename>EtherSmc</PDDFilename>
+        <PDDName>EtherCard.Smc</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 Emulator Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>Ethercard</LDDName>
+        <PDDFilename>etherwins</PDDFilename>
+        <PDDName>Ethercard.wins</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 WINTAP Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>Ethercard</LDDName>
+        <PDDFilename>ethertap</PDDFilename>
+        <PDDName>Ethertap.wins</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+</LANBearerTable>
+
+<LANServiceTable>
+    <LANService operation="add">
+        <Name>Ethernet Dynamic IP</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>10.32.194.254</IpGateway>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>10.32.194.251</IpAddr>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>194.72.6.51</IpNameServer1>
+        <IpNameServer2>194.72.6.52</IpNameServer2>
+        <ConfigDaemonManagerName>ConfigDaemonManager</ConfigDaemonManagerName>
+        <ConfigDaemonName>DhcpServ</ConfigDaemonName>
+    </LANService>
+    <LANService operation="add">
+        <Name>Ethernet Static 1</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>192.168.0.1</IpGateway>
+        <IpAddrFromServer>FALSE</IpAddrFromServer>
+        <IpAddr>192.168.0.2</IpAddr>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <IpNameServer1>10.16.59.15</IpNameServer1>
+        <IpNameServer2>10.23.58.12</IpNameServer2>
+        <Ip6DNSAddrFromServer>FALSE</Ip6DNSAddrFromServer>
+    </LANService>
+</LANServiceTable>
+
+<DialInISPTable>
+    <DialInISP operation="template">
+        <Name>Default Dial In ISP</Name>
+        <Description>Default Dial In ISP</Description>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+    <DialInISP operation="add">
+        <Name>Dial In ISP01</Name>
+        <Description>Dial In ISP01</Description>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+</DialInISPTable>
+
+<DialOutISPTable>
+    <DialOutISP operation="template">
+        <Name>Default Dial Out ISP</Name>
+        <Description>Default Dial Out ISP</Description>
+        <DefaultTelNum>Default Dial Out ISP</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>TRUE</PromptForLogin>
+        <LoginName>1</LoginName>
+        <LoginPass>1</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>0</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>1</IfAuthName>
+        <IfAuthPass>1</IfAuthPass>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>NT RAS</Name>
+        <Description>Test</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>TRUE</UseLoginScript>
+        <LoginScript>CHARMAP \[windows-1252\]\nLOOP 10\n{\nSEND &quot;CLIENT&quot;+&lt;0x0d&gt;\nWAIT 3\n{\n&quot;SERVER&quot; OK\n}\n}\nEXIT KErrNoAnswer$\n\nOK:\nEXIT\n</LoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP01</Name>
+        <Description>PlaceHolder for ISP01</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP02</Name>
+        <Description>PlaceHolder for ISP02</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP03</Name>
+        <Description>PlaceHolder for ISP03</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP04</Name>
+        <Description>PlaceHolder for ISP04</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP05</Name>
+        <Description>PlaceHolder for ISP05</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>mRouterDialOutIsp</Name>
+        <Description>mRouterDialOutIsp</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>IfAuthPass=</IfAuthName>
+        <IfAuthPass>AuthRetries=0</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+</DialOutISPTable>
+
+<AgentLookupTable>
+</AgentLookupTable>
+
+<CDMA2000PacketServiceTable>
+</CDMA2000PacketServiceTable>
+
+<DefaultCDMA2000Table>
+</DefaultCDMA2000Table>
+
+<ChargecardTable>
+    <Chargecard operation="add">
+        <Name>Dummy BT Chargecard</Name>
+        <AccountNumber>144,12345678</AccountNumber>
+        <Pin>0000</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>HFG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+    <Chargecard operation="add">
+        <Name>Dummy Mercury Chargecard</Name>
+        <AccountNumber>0500800800,,12345678</AccountNumber>
+        <Pin>****</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>J,K,0FG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+</ChargecardTable>
+
+<ConnectionPreferencesTable>
+</ConnectionPreferencesTable>
+
+<GlobalSettingsTable>
+    <GlobalSettings operation="add">
+        <Name>GlobalSettingsTable1</Name>
+        <WAPAccess>WAPAccessPoint.Default Dial In ISP</WAPAccess>
+        <RedialAttempts>3</RedialAttempts>
+        <SmsBearer>1</SmsBearer>
+        <SmsReceiveMode>2</SmsReceiveMode>
+        <GPRSAttachMode>1</GPRSAttachMode>
+        <AcceptIncomingGprs>1</AcceptIncomingGprs>
+        <GPRSClassCBearer>GSM</GPRSClassCBearer>
+        <ConnectionAttempts>2</ConnectionAttempts>
+        <ModemForDataAndFax>2</ModemForDataAndFax>
+        <ModemForPhoneServicesAndSMS>2</ModemForPhoneServicesAndSMS>
+        <LocationForDataAndFax>Location.Office</LocationForDataAndFax>
+        <LocationForPhoneServicesAndSMS>Location.Office</LocationForPhoneServicesAndSMS>
+        <DefaultNetwork>Network.Intranet</DefaultNetwork>
+        <BearerAvailabilityCheckTSY>mm</BearerAvailabilityCheckTSY>
+    </GlobalSettings>
+</GlobalSettingsTable>
+
+<IncomingGPRSTable>
+    <IncomingGPRS operation="add">
+        <Name>Incoming GPRS Settings PlaceHolder</Name>
+        <APN>Test</APN>
+        <PDPType>IPV4</PDPType>
+        <PDPAddress>0.0.0.0</PDPAddress>
+        <ReqPrecedence>1</ReqPrecedence>
+        <ReqDelay>1</ReqDelay>
+        <ReqReliability>1</ReqReliability>
+        <ReqPeakThroughput>1</ReqPeakThroughput>
+        <ReqMeanThroughput>1</ReqMeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>0.0.0.0</IpNameServer1>
+        <IpNameServer2>0.0.0.0</IpNameServer2>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+    </IncomingGPRS>
+</IncomingGPRSTable>
+
+<OutgoingGPRSTable>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS01</Name>
+        <APN>gprs01APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS02</Name>
+        <APN>gprs02APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS03</Name>
+        <APN>gprs03APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+</OutgoingGPRSTable>
+
+<DefaultGPRSTable>
+    <DefaultGPRS operation="add">
+        <Name>Dummy Default GPRS Settings</Name>
+        <Usage>1</Usage>
+        <APN>Access point name</APN>
+        <PDPType>IPV6</PDPType>
+        <PDPAddress>www.wid.com</PDPAddress>
+        <Precedence>1</Precedence>
+        <Delay>1</Delay>
+        <Reliability>1</Reliability>
+        <PeakThroughput>1</PeakThroughput>
+        <MeanThroughput>1</MeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>TRUE</DataCompression>
+        <HeaderCompression>TRUE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>TRUE</AnonymousAccess>
+    </DefaultGPRS>
+</DefaultGPRSTable>
+
+<ProxyTable>
+    <Proxy operation="add">
+        <Name>ProxyTable1</Name>
+        <ISPRef>DialOutISP.NT RAS</ISPRef>
+        <UseProxyServer>TRUE</UseProxyServer>
+        <ProxyServerName>www.dummyproxy.com</ProxyServerName>
+        <ProtocolName>http</ProtocolName>
+        <PortNumber>80</PortNumber>
+        <Exceptions>www.dummyproxy.com/exception</Exceptions>
+    </Proxy>
+</ProxyTable>
+
+<LocationTable>
+    <Location operation="template">
+        <Name>Default Location</Name>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>44</AreaCode>
+        <DialOutCode>44</DialOutCode>
+        <DisableCallWaitingCode>44</DisableCallWaitingCode>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Office</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+        <DialOutCode>9,</DialOutCode>
+        <DisableCallWaitingCode>9,</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Office Direct Dial</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+        <DialOutCode>171</DialOutCode>
+        <DisableCallWaitingCode>171</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Mobile</Name>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>44</AreaCode>
+        <DialOutCode>44</DialOutCode>
+        <DisableCallWaitingCode>44</DisableCallWaitingCode>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Home</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>181</AreaCode>
+        <DialOutCode>181</DialOutCode>
+        <DisableCallWaitingCode>181</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>TRUE</UsePulseDial>
+        <WaitForDialTone>TRUE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+</LocationTable>
+
+<SecureSocketTable>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable1</Name>
+        <ProtocolName>ssl3.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable2</Name>
+        <ProtocolName>tls1.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+</SecureSocketTable>
+
+<BTDeviceTable>
+</BTDeviceTable>
+
+<BTPersistTable>
+</BTPersistTable>
+
+<BTSecurityTable>
+</BTSecurityTable>
+
+<BTDefaultTable>
+</BTDefaultTable>
+
+<WAPAccessPointTable>
+    <WAPAccessPoint operation="template">
+        <Name>Default Dial In ISP</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+    </WAPAccessPoint>
+    <WAPAccessPoint operation="add">
+        <Name>Dummy WAP Settings</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+        <StartPage>www.wapstart.com</StartPage>
+    </WAPAccessPoint>
+</WAPAccessPointTable>
+
+<WAPIPBearerTable>
+    <WAPIPBearer operation="template">
+        <Name>WAPIPBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <GatewayAddress>0</GatewayAddress>
+        <IAPRef>IAP.-1</IAPRef>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+        <ProxyPortNumber>0</ProxyPortNumber>
+        <ProxyLogin>0</ProxyLogin>
+        <ProxyPassword>0</ProxyPassword>
+    </WAPIPBearer>
+    <WAPIPBearer operation="add">
+        <Name>WAPIPBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>www.wapgateway.com</GatewayAddress>
+        <IAPRef>IAP.Ethernet WinTAP</IAPRef>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+        <ProxyPortNumber>1</ProxyPortNumber>
+        <ProxyLogin>1</ProxyLogin>
+        <ProxyPassword>1</ProxyPassword>
+    </WAPIPBearer>
+</WAPIPBearerTable>
+
+<WAPSMSBearerTable>
+    <WAPSMSBearer operation="template">
+        <Name>WAPSMSBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <GatewayAddress>0</GatewayAddress>
+        <ServiceCentreAddress>0</ServiceCentreAddress>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+    </WAPSMSBearer>
+    <WAPSMSBearer operation="add">
+        <Name>WAPSMSBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>+4412345678901</GatewayAddress>
+        <ServiceCentreAddress>+442071234567</ServiceCentreAddress>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+    </WAPSMSBearer>
+</WAPSMSBearerTable>
+
+<VirtualBearerTable>
+</VirtualBearerTable>
+
+<VpnServiceTable>
+</VpnServiceTable>
+
+<WLANServiceExtensionTable>
+</WLANServiceExtensionTable>
+
+<PANServiceExtensionsTable>
+</PANServiceExtensionsTable>
+
+<EAPSecuritySettingsTable>
+</EAPSecuritySettingsTable>
+
+<TunnelledEAPSettingsTable>
+</TunnelledEAPSettingsTable>
+
+<EAPTLSSettingsTable>
+</EAPTLSSettingsTable>
+
+<LEAPSettingsTable>
+</LEAPSettingsTable>
+
+
+</CommDB:Config>
+