# HG changeset patch # User Johnson Ma # Date 1268031858 -28800 # Node ID 3da2a79470a7989488958395a7ed1e7bb1913f47 Initial EPL Contribution diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/readme.txt --- /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. diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen.exe Binary file testexecmgmt/ucc/BinInternal/rpcgen.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/Makefile --- /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 *~ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/ae_component_rpc.c --- /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 +#include +#include +#include +#include +#include +#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 \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 \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 \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 \n" ); + O( "#include \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 \n" ); + O( "#include \n" ); + O( "#include \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( <ime ); + f_print( fout, "%s%s", BANNER_LINE, ctime(<ime) ); + 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( <ime ); + f_print( fout, "%s%s", BANNER_LINE, ctime(<ime) ); + 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/ae_component_rpc.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_clnt.c --- /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 +#ifdef WIN32 +#include +#include +#include "rpc_pars.h" +#else +#include +#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); + } + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_cout.c --- /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 +#include +#ifdef WIN32 +#include +#include "rpc_util.h" +#include "rpc_pars.h" +#else +#include +#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(); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_hout.c --- /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 +#include +#include +#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"); + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_main.c --- /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 +#include +#include +#include +#include +#include "rpc_util.h" +#include "rpc_pars.h" +#include "rpc_scan.h" + +#ifdef WIN32 +#include +#include +#include +#include +#else +#include +#include +#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) ? "" : 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) ? "" : 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 \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 \n"); + + // AE -- include this for the CLIENT type + { + f_print(fout, "#include \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 \n"); + f_print(fout, "#include \n"); + f_print(fout, "#ifdef WIN32\n"); + f_print(fout, "#include \n"); + f_print(fout, "#else\n"); + f_print(fout, "#include \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 \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); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_pars.c --- /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 +#include +#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); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_pars.h --- /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(); diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_scan.c --- /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 +#include +#include +#include +#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; + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_scan.h --- /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(); diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_svco.c --- /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 +#include +#include +#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(¶ms);\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); + } + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_util.c --- /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 +#include +#include +#include +#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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpc_util.h --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpcgen.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BinInternal/rpcgen/rpcgen.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/BWINS/NETWORKEMULATORCONTROL.DEF --- /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 *) + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/BWINS/UCCCONTROLTEU.DEF --- /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) + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/EABI/NetworkEmulatorControl.def --- /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 ; ## + _ZTI13CTCPTransport @ 25 NONAME ; ## + _ZTI16CSerialTransport @ 26 NONAME ; ## + _ZTI18CUCCSDeviceControl @ 27 NONAME ; ## + _ZTI19CUCCSDeviceProtocol @ 28 NONAME ; ## + _ZTV12CSetUpCommDb @ 29 NONAME ; ## + _ZTV13CTCPTransport @ 30 NONAME ; ## + _ZTV16CSerialTransport @ 31 NONAME ; ## + _ZTV18CUCCSDeviceControl @ 32 NONAME ; ## + _ZTV19CUCCSDeviceProtocol @ 33 NONAME ; ## + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/NetworkEmulatorControl.mmp --- /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 + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/UCCControlTE.mmp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/bld.exports.inf --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/bld.inf --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/release.txt --- /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. diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/ucc.configure.nsh --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/ucc.iby --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/ucc.mrp --- /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 == diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildScripts/group/ucc.tdf --- /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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildTools/Makefile --- /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 *~ + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildTools/cleantree.exe Binary file testexecmgmt/ucc/BuildTools/cleantree.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildTools/cleantree/cleantree.cpp --- /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 +#include +#include +#include + +/******************************************************************************* + * + * 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 ); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildTools/cleantree/cleantree.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildTools/cleantree/cleantree.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildTools/cleantree/cleantree.h --- /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 + + +/******************************************************************************* + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/BuildTools/readme.txt --- /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. diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/Common/inc/CUCCIniFile.h --- /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 +#include + +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 SectionNames() const; + vector SectionParameters(const string& strSection) const; + + private: + string iIniFileName; +}; + +#endif //__CUCCININFILE_H__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/Common/src/CUCCIniFile.cpp --- /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 +#include + +#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 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 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 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 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/GenericService.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/GenericService.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/Configuration/SyncService.ini --- /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 + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/Interface/Device/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/Interface/Host/SyncServiceInterface.ini --- /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 + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/Interface/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/SyncService.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/bin/Debug/SyncService.exe Binary file testexecmgmt/ucc/GenericService/SyncService/bin/Debug/SyncService.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/bin/Release/SyncService.exe Binary file testexecmgmt/ucc/GenericService/SyncService/bin/Release/SyncService.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/inc/CSyncService.h --- /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 +#include +#include + +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/src/CSyncService.cpp --- /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 +#include +#include + +#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[] = { "" }; +const char KStartSyncComplete[] = { "" }; +const char KRetrieveSyncTestCaseResult[] = { "" }; +const char KRetrieveSyncTestCaseStatus[] = { "" }; +const char KSetSharedData[] = { "" }; +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(::GetProcAddress( ihLib, ProcConnect )); + iptrDisconnect = reinterpret_cast(::GetProcAddress( ihLib, ProcDisconnect )); + iptrSendRawCommand = reinterpret_cast(::GetProcAddress( ihLib, ProcSendRawCommand )); + iptrGetTEFSharedData = reinterpret_cast(::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; + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/SyncService/src/SyncService.c --- /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 ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/Configuration/TestDriverService.ini --- /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 + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/Interface/Device/TestDriverService.ini --- /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= diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/Interface/Host/TestDriverServiceInterface.ini --- /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 + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/TestDriverService.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/bin/Debug/TestDriverService.exe Binary file testexecmgmt/ucc/GenericService/TestDriverService/bin/Debug/TestDriverService.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/bin/Release/TestDriverService.exe Binary file testexecmgmt/ucc/GenericService/TestDriverService/bin/Release/TestDriverService.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/inc/CAThread.h --- /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 +#include +#include +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/inc/CListeningServer.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 + +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/inc/CTestDriverService.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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/src/CAThread.cpp --- /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 +#include +#include + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/src/CListeningServer.cpp --- /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 + +#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; + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestDriverService/src/CTestDriverService.cpp --- /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 + +#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 +#include "GenericStub.h" + +int main() + { + return StartUCCService( TEST_SERVICE_IID, TEST_SERVICE_VERSION ); + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Master/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Master/master.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Slave/sampletest.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestScripts/Synchronisation/Slave/slave.script --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestService/Interface/TestService.ini --- /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 + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestService/TestService.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestService/bin/Debug/TestService.exe Binary file testexecmgmt/ucc/GenericService/TestService/bin/Debug/TestService.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestService/bin/Release/TestService.exe Binary file testexecmgmt/ucc/GenericService/TestService/bin/Release/TestService.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestService/inc/CTestService.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/TestService/src/CTestService.cpp --- /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 + +#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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/inc/CComponentManager.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 +#include + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ + +/**************************************************************************************** + * + * Class CComponentManager + * + ***************************************************************************************/ +template +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/inc/CSGenericstub.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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/inc/CService.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/inc/CSvcGenericstub.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 *aComponentManager, TStartupInfo *aArg ); + static int StopRPCService(); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/inc/CTestService.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/inc/GenericStub.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/CCall.cpp --- /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 + +/* + * 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"); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/CSGenericstub.cpp --- /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 +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/CSvcGenericstub.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcGenericstub.h" +#include "GenericStub.h" + + +/**************************************************************************************** + * + * File-scope variables + * + ***************************************************************************************/ +static CComponentManager *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 *aComponentManager, TStartupInfo * /*aArg*/ ) +{ + assert( iComponentManager == NULL ); + iComponentManager = aComponentManager; + return ERR_NONE; +} + + +/**************************************************************************************** + * + * PUBLIC: StopRPCService + * + ***************************************************************************************/ +int CSvcGenericstub::StopRPCService() +{ + iComponentManager = NULL; + return ERR_NONE; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/CTestService.cpp --- /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 + +#include "CTestService.h" + +CTestService::CTestService() +{ +} + +CTestService::~CTestService() +{ +} + +int CTestService::RunCommand( const CCall& aCall ) +{ + printf( "TEST SERVICE CALL WORKS! :-)" ); + return 0; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/GenericStub_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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(¶ms); +} + +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 +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/GenericStub_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcGenericstub.h" +#include "CSGenericstub.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/GenericStub_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/GenericService/src/TestService.c --- /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 ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/RemoteInterface.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/RemoteInterface.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/Test/Test.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/Test/src/test.cpp --- /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; + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/bin/Debug/RemoteInterface.lib Binary file testexecmgmt/ucc/RemoteInterface/bin/Debug/RemoteInterface.lib has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/bin/Release/RemoteInterface.lib Binary file testexecmgmt/ucc/RemoteInterface/bin/Release/RemoteInterface.lib has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/inc/CRemoteInterface.h --- /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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/inc/CTCPTransport.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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/inc/MUCCTransport.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 + +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/src/CRemoteInterface.cpp --- /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 + +#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; + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/RemoteInterface/src/CTCPTransport.cpp --- /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; + } + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/create_package_for_70_lubbock.bat --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/create_package_for_emulator.bat --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/create_package_for_lubbock.bat --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/script.0001.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/script.0002.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/script.0003.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/script.0004.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/script.0005.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/script.0006.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/script.0007.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sti.0003.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sti.0004.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sti.0005.ini --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sti.0006.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sti.0007.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sts.0003.script --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sts.0004.script --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sts.0005.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sts.0006.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SampleScripts/sts.0007.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SetupScripts/clean_emulation_environment.sh --- /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." diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/SetupScripts/setup_emulation_environment.sh --- /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 -------------------------------------------------------------------------------------------------------------- diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/AliasLibrary/CInterfaceAlias.cpp --- /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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/AliasLibrary/CInterfaceAlias.h --- /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 +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/AliasLibrary/Makefile --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/CXClient.cpp --- /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 +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#include +#else +#include +#include +#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; +} + +//------------------------------------------------------------------------------ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/CXClient.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/cprotocol.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/cprotocol/cprotocol.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/CXServer.cpp --- /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 +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#include +#else +#include +#include +#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; +} +//------------------------------------------------------------------------------ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/CXServer.h --- /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__ + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/sprotocol.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/CSProtocolLibrary/sprotocol/sprotocol.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsCommandWrapper/CDynamicsCommand.cpp --- /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 +#include +#include +#include +#ifndef WIN32 +#include +#include +#include +#else +#include +#endif +#include + + +/**************************************************************************************** + * + * 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<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; +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsCommandWrapper/CDynamicsCommand.h --- /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 +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsCommandWrapper/DynamicsCommandWrapper.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsCommandWrapper/DynamicsCommandWrapper.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsCommandWrapper/Makefile --- /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 *~ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/CDynamicsConfigFile.cpp --- /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 +#include +#ifndef WIN32 +#include +#else +#include +#endif +#include +#include + + +/****************************************************************************************************** + * + * 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(); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/CDynamicsConfigFile.h --- /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 +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/DynamicsConfigurationLibrary.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/DynamicsConfigurationLibrary.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/Makefile --- /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 *~ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/file_utilities.cpp --- /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 +#include +#include +#include +#ifndef WIN32 +#include +#else +#include +#endif +#include + + +/****************************************************************************************************** + * + * 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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/DynamicsConfigurationLibrary/file_utilities.h --- /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 +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/CSHostexecuteasync.cpp --- /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 +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/CSHostexecuteasync.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/CSvcHostexecuteasync.cpp --- /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 + + +/**************************************************************************************** + * + * 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 *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 *aComponentManager, TStartupInfo *aArg ) +{ + assert( iComponentManager == NULL ); + iComponentManager = aComponentManager; + return ERR_NONE; +} + + +/**************************************************************************************** + * + * PUBLIC: StopRPCService + * + ***************************************************************************************/ +int CSvcHostexecuteasync::StopRPCService() +{ + iComponentManager = NULL; + return ERR_NONE; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/CSvcHostexecuteasync.h --- /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 *aComponentManager, TStartupInfo *aArg ); + static int StopRPCService(); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/HostExecute.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/HostExecute.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/Makefile --- /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* diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync.x --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcHostexecuteasync.h" +#include "CSHostexecuteasync.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteAsync/hostexecuteasync_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/CSHostexecute.cpp --- /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 + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/CSHostexecute.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/CSvcHostexecute.cpp --- /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 +#include + + +/**************************************************************************************** + * + * 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 *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 *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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/CSvcHostexecute.h --- /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 *aComponentManager, TStartupInfo *aArg ); + static int StopRPCService(); + + /* custom methods */ + static TExecuteResult st_executecommand( TExecuteRequest aArgs ); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/HostExecute.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/HostExecute.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/Makefile --- /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* diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute.x --- /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; + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcHostexecute.h" +#include "CSHostexecute.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/HostExecuteSimple/hostexecute_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/IntegerAllocatorLibrary/CIntegerAllocator.cpp --- /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 + + +/******************************************************************************* + * + * 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::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::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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/IntegerAllocatorLibrary/CIntegerAllocator.h --- /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 +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 iList; + int iListSize; +}; + + +#endif //__CINTEGERALLOCATOR_H__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/IntegerAllocatorLibrary/IntegerAllocatorLibrary.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/IntegerAllocatorLibrary/IntegerAllocatorLibrary.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/IntegerAllocatorLibrary/Makefile --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CDatalinkNull.cpp --- /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 +#include + + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CDatalinkNull.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CDatalinkPacketise.cpp --- /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 +#include + + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CDatalinkPacketise.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CLog.cpp --- /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 +#include + + +/******************************************************************************* + * + * 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::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::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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CLog.h --- /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 +#include +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 iLogEntries; +}; + +#endif //__CLOG_H__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CLogPPPFilter.cpp --- /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 +#include +#include +#ifdef WIN32 +#include +#else +#include +#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] ); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CLogPPPFilter.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CPhone.cpp --- /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 +#include +#ifndef WIN32 +#include +#include +#include +#include +#else +#include +#include +#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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CPhone.h --- /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 +#else +#include +#include +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CPppFrame.cpp --- /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 +#include + + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CPppFrame.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CTCPTEChannel.cpp --- /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 +#include +#ifndef WIN32 +#include +#include +#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 +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CTCPTEChannel.h --- /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 +#else +#include +#include +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CUDPAirInterface.cpp --- /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 +#include +#include +#ifndef WIN32 +#include +#include +#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 +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/CUDPAirInterface.h --- /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 +#else +#include +#include +#include +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/MTInterfaces.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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/Makefile --- /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 *~ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/mt.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobileTermination/mt.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/CSMobster.cpp --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#include +#include +#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); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/CSMobster.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/CSvcMobster.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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 *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 *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 +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/CSvcMobster.h --- /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 *aComponentManager, TChannelAddress *aArg ); + static int StopRPCService(); + +private: + static void WaitForConnectionsFromTerminalEmulations( void ); + static void ConnectClientToMobileTermination( int aSock); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/Makefile --- /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 *~ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/MobsterRPCService.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/MobsterRPCService.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/device0000.log.txt --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/linux_conv.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster.x --- /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; + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster_client_server_protocol.cpp --- /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 +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#include +#else +#include +#include +#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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster_client_server_protocol.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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(¶ms); +} + +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 +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcMobster.h" +#include "CSMobster.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/MobsterRPCService/mobster_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/PppdGateway/Makefile --- /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 *~ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/PppdGateway/pppdgateway.c --- /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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/PppdGateway/socket_helper.c --- /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 +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#else +#include +#include +#include +#include +#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 +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/PppdGateway/socket_helper.h --- /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__ + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ProcessLibrary/Makefile --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ProcessLibrary/ProcessLibrary.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ProcessLibrary/ProcessLibrary.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ProcessLibrary/proclib.h --- /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 +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ProcessLibrary/proclib_linux.cpp --- /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 +#include +#include +#include +#include +#include +#include +#include +#include + + +/******************************************************************************* + * + * 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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ProcessLibrary/proclib_windows.cpp --- /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 +#include +#include +#include +#include + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SerialTcpRelay/CSerialPort.cpp --- /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 +#include + +/********************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SerialTcpRelay/CSerialPort.h --- /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 + + +/************************************************************************************* + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SerialTcpRelay/CSerialTcpRelay.cpp --- /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 +#include + + +/************************************************************************************* + * + * 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(); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SerialTcpRelay/CSerialTcpRelay.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.cpp --- /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 +#include +#include +#include + + +/************************************************************************************* + * + * 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 \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 ); +} + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SerialTcpRelay/SerialTcpRelay.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SocketLibrary/SocketLibrary.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SocketLibrary/SocketLibrary.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SocketLibrary/socket_helper.cpp --- /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 +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#else +#include +#include +#include +#include +#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 +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/SocketLibrary/socket_helper.h --- /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__ + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCServer.cpp --- /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; + } + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCServer.h --- /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 + +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTest.cpp --- /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 +#include +#include +#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 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(); + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTest.h --- /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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTestStep.cpp --- /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 + +#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; + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/TestExecuteUCCPlugin/CUCCTestStep.h --- /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 +#include + +class CUCCTestStep : public CTestStep + { +public: + CUCCTestStep(); + ~CUCCTestStep(); + CUCCSDeviceControl *CreateApplicationControlInstance( int *aUID, TBool aUIDRequired = ETrue ); + CUCCTestStep * iSelfTestSuite; + }; + +#endif // __UCC_TEST_STEP_H__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ThreadLibrary/CAThread.cpp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ThreadLibrary/CAThread.h --- /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 +#endif +#include +#include +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ThreadLibrary/CAThread.linux.cpp --- /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 +#include +#include +#include +#include +#include + +/******************************************************************************* + * + * 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, ¶m ); + 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ThreadLibrary/CAThread.windows.cpp --- /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 +#include +#include + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ThreadLibrary/Makefile --- /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 *~ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ThreadLibrary/ThreadLibrary.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/ThreadLibrary/ThreadLibrary.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CNetworkEmulatorSetupCommdb.cpp --- /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 +#include +#include +#include +#include +#include +#include + + +/***************************************************************************** + * + * 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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CNetworkEmulatorSetupCommdb.h --- /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 + +/***************************************************************************** + * + * 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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CSerialTransport.cpp --- /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 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CSerialTransport.h --- /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 +#include + +#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 iModule; + TInt iRetries; + + RCommServ iCommServer; + RComm iCommPort; + TCommConfig iPortSettings, iOldPortSettings; + + TInt iCommPortOpen, iCommOldSettingsValid; + TRequestStatus iStatus; +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CTCPTransport.cpp --- /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 +#include + +#include "CTCPTransport.h" +#include "assert.h" + +#include + + +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; + } diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CTCPTransport.h --- /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 +#include + +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceControl.cpp --- /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 +#include +#include + + +/********************************************************************************** + * + * 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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceControl.h --- /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 +#include + +#include + +/***************************************************************************** + * + * 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 + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceProtocol.cpp --- /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 +#include + +#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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/CUCCSDeviceProtocol.h --- /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 + + +/***************************************************************************** + * + * Local Includes + * + ****************************************************************************/ +//#include "MUCCTransport.h" +//#include "CProtocolTypes.h" + +#include +#include + + +/***************************************************************************** + * + * 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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/MUCCTransport.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/NetworkEmulatorControl.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 +#include + + +#endif //__NETWORKEMULATORCONTROL_H__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/UCCSDeviceControl.cpp --- /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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UCCSDeviceControl/assert.h --- /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 +extern void AssertE( TPtrC8 _file, TInt _line ); +#define asserte(x) if(!(x)) { AssertE( (TPtrC8(reinterpret_cast(__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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/CSUuinterface.cpp --- /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 + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/CSUuinterface.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/CSvcUuinterface.cpp --- /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 + + +/**************************************************************************************** + * + * 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 *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 *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 + ':' + + '.' + + 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 + ':' + + '.' + + 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; +} + + + + + + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/CSvcUuinterface.h --- /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 *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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/Load.Nistnet --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/Makefile --- /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) diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/UUInterface.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/UUInterface.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/UUInterface_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/UUInterface_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/config_nistnet_add.pl --- /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 = ; +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 ); diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/config_nistnet_reset.pl --- /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 ); diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/uuinterface.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/uuinterface.x --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/UUInterface/uuinterface_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcUuinterface.h" +#include "CSUuinterface.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromConsole.cpp --- /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 + + +/*********************************************************************************** + * + * 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; +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromConsole.h --- /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 + + +/*********************************************************************************** + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromFile.cpp --- /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 +#include + +/*********************************************************************************** + * + * 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; +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromFile.h --- /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 + + +/*********************************************************************************** + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CSynchronisation.cpp --- /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 +#include + +/**************************************************************************************** + * + * 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." ); + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CSynchronisation.h --- /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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CUCCIniFile.cpp --- /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 +#include + +#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 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 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 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 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/CUCCIniFile.h --- /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 +#include + +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 SectionNames() const; + vector SectionParameters(const string& strSection) const; + + private: + string iIniFileName; +}; + +#endif //__CUCCININFILE_H__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/HTMLOutput.cpp --- /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 +#include +#include +#include + +/******************************************************************************** + * + * 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) ? ("") : (x)) + + +/*********************************************************************************** + * + * SECTION: CHTMLOutput + * + **********************************************************************************/ +/******************************************************************************** + * + * CHTMLOutput + * + ********************************************************************************/ +CHTMLOutput::CHTMLOutput() +{ + iFile = NULL; + iFileDebug = NULL; + iFileNoRefresh = NULL; + iCompletedScriptCalled = false; + iCounter = 0; + + // setup the constant arrays + iRecordTableTitle[RT_COMMAND] = ""; + 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, "\n" ); + OutputLine( iFileNoRefresh, "\n" ); + OutputLine( iFileDebug, "\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, "

StartUseCase(%d)


\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, "

EndUsecase(%d, %d)


\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, "

All script commands have been executed

\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, "ERROR:
" ); + } + + // create the log entry + _snprintf( iLineBuffer, MAXLINELENGTH, "       %sStartServiceResult(%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, "ERROR:
" ); + } + + // create the log entry + _snprintf( iLineBuffer, MAXLINELENGTH, "       %sStopServiceResult(%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, "
\n" ); + + // create the entry line + _snprintf( iLineBuffer, MAXLINELENGTH, "     %d - ExecuteString( %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, "      \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, "       ERROR: %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( <ime ); + + // check that the files exist + if( (iFile == NULL) || (iFileDebug == NULL) || (iFileNoRefresh == NULL) ) { + return; + } + + // output the standard header for the files + OutputLine(iFile," \n"); + OutputLine(iFile," \n"); + OutputLine(iFile, "\n" ); + fprintf(iFile,"%s \n", iLogName); + OutputLine(iFile," \n"); + OutputLine(iFile," \n"); + OutputLine(iFile,"
 \n");
+	fprintf(iFile,"
\n

%s

\n", iLogName); + fprintf(iFile, "

%s

\n", ctime( <ime )); + fflush( iFile ); + + OutputLine(iFileDebug," \n"); + OutputLine(iFileDebug," \n"); + fprintf(iFileDebug,"%s \n", iDebugLogName); + OutputLine(iFileDebug," \n"); + OutputLine(iFileDebug," \n"); + OutputLine(iFileDebug,"
 \n");
+	fprintf(iFileDebug,"
\n

%s

\n", iDebugLogName); + fprintf(iFileDebug, "

%s

\n", ctime( <ime )); + fflush( iFileDebug ); + + OutputLine(iFileNoRefresh," \n"); + OutputLine(iFileNoRefresh," \n"); + fprintf(iFileNoRefresh,"%s \n", iLogNameNoRefresh); + OutputLine(iFileNoRefresh," \n"); + OutputLine(iFileNoRefresh," \n"); + OutputLine(iFileNoRefresh,"
 \n");
+	fprintf(iFileNoRefresh,"
\n

%s

\n", iLogNameNoRefresh); + fprintf(iFileNoRefresh, "

%s

\n", ctime( <ime )); + 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, "
" ); + OutputLine( aFile, iLineBuffer ); + _snprintf( iLineBuffer, MAXLINELENGTH, "", iRecordTableBorderColour[aRecordType] ); + OutputLine( aFile, iLineBuffer ); + + // print the table title + iRecordTableTitle[RT_COMMAND] = (char*)GetScriptCommandString( aCommandType ); + STRINGIFY_NULL( iRecordTableTitle[RT_COMMAND] ); + _snprintf( iLineBuffer, MAXLINELENGTH, "", 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, "
%s
%s", background_colour, field->GetName(), fontsize ); + OutputLine( aFile, iLineBuffer ); + + // if multiline then put in the
 tags to make newlines come out
+		if( multiline_value != NULL ) {
+			OutputLine( aFile, "
" );
+		}
+
+		// print actual data
+		OutputLine( aFile, value );
+		
+		// if multiline then put in the 
tags to make newlines come out + if( multiline_value != NULL ) { + OutputLine( aFile, "
" ); + } + + // get the next field + field = aRecord->GetNextField(); + } + + // end the table + _snprintf( iLineBuffer, MAXLINELENGTH, "
" ); + 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, "      \n" ); + OutputLine( aFile, iLineBuffer ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/HTMLOutput.h --- /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 + +/******************************************************************************** + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CBatchEngine.cpp --- /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 +#include +#include +#include + + +/*********************************************************************************** + * + * 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(); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CBatchEngine.h --- /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 +#include +#include + + +/*********************************************************************************** + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CCommandDecoder.cpp --- /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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*********************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CCommandDecoder.h --- /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 +#include + + +/*********************************************************************************** + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataField.cpp --- /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 +#include +#include +#include + +/*********************************************************************************** + * + * 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 ); + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataField.h --- /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 + + +/*********************************************************************************** + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataRecord.cpp --- /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 +#include +#include +#include + + +/*********************************************************************************** + * + * 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 ); + } + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CDataRecord.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CExecuteCommand.cpp --- /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 +#include +#include +#include +#include + +/**************************************************************************************** + * + * 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[] = { "", + "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 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; +} + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CExecuteCommand.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CServMgr.cpp --- /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 +#include +#include +#include + + +/*********************************************************************************** + * + * 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 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 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; iGetFieldAsInt( "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; +} + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_CServMgr.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ErrorCodes.cpp --- /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); + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ErrorCodes.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_Interfaces.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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_Main.cpp --- /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 +#include +#include +#include +#include + + +/******************************************************************************** + * + * 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. [:[:]]).\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 \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 \n" ); + fprintf( stderr, "\t\tControl commands are sent over tcp/ip using WinTunnel.\n" ); + fprintf( stderr, "\t--autocontrol [:[:]]\n" ); + fprintf( stderr, "\t\tControl commands are automatically entered.\n" ); + fprintf( stderr, "\n" ); + + fprintf( stderr, "GENERAL OPTIONS:\n" ); + fprintf( stderr, "\t--scriptdir \n" ); + fprintf( stderr, "\t\tAlternate directory to look for script files and put output files.\n" ); + fprintf( stderr, "\n" ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Core/UCCS_ServiceValues.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CApplicationControlNull.cpp --- /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 +#include +#include +#include + + +/********************************************************************************************** + * + * 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: + * "[:[:]]" + * + *********************************************************************************************/ +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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CApplicationControlNull.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CConsolePort.cpp --- /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 +#include + +/********************************************************************* + * + * 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; +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CConsolePort.h --- /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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CFrameBuffer.cpp --- /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 +#include + +/********************************************************************************************** + * + * 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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CFrameBuffer.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CProtocolTypes.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CSerialPort.cpp --- /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 +#include + +/********************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CSerialPort.h --- /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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CTcpPort.cpp --- /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 +#include + +#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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CTcpPort.h --- /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 +#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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandControl.cpp --- /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 +#include +#include +#include + +/********************************************************************************************** + * + * 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); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandControl.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandProtocol.cpp --- /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 +#include + +/********************************************************************************************** + * + * 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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CUCCSCommandProtocol.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CommandControlErrors.cpp --- /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"; + } +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/CommandControlErrors.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/DeviceControlChannel/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/HOWTO_AddService.txt --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/SCRIPT_Commands.txt --- /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. diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/CommonServiceStub/CServiceAgentBase.cpp --- /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 +#include +#include + +/******************************************************************************* + * + * 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; +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/CommonServiceStub/CServiceAgentBase.h --- /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 +#include + + +/******************************************************************************* + * + * 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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CCFacontroller.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CCFacontroller.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CForeignAgentServiceStub.cpp --- /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 +#include + + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/CForeignAgentServiceStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller.x --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/ForeignAgent/facontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler.x --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/APICommandHandler_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CAPICommandHandlerStub.cpp --- /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 && countbatchappendusersentence( 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 ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CAPICommandHandlerStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CCGpssimulator.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GPSSimulator/CCGpssimulator.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CCGenericstub.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CCGenericstub.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CGenericStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/CGenericrStub.cpp --- /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 + +#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 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 ; iKeyValue(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(), ¶mValue, 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 ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub.x --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/GenericStub/GenericStub_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CCHacontroller.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CCHacontroller.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CHomeAgentServiceStub.cpp --- /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 +#include + + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/CHomeAgentServiceStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller.x --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HomeAgent/hacontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CCHostexecute.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CCHostexecute.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CHostExecuteStub.cpp --- /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 + + +/******************************************************************************* + * + * 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 ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/CHostExecuteStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute.x --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecute/hostexecute_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CCHostexecuteasync.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CCHostexecuteasync.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CHostExecuteAsyncStub.cpp --- /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 + + +/******************************************************************************* + * + * 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 ); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/CHostExecuteAsyncStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync.x --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/HostExecuteAsync/hostexecuteasync_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Internal/CInternalStub.cpp --- /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 +#include +#include + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Internal/CInternalStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CCMncontroller.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CCMncontroller.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CMobileAgentServiceStub.cpp --- /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 + + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/CMobileAgentServiceStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller.x --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/MobileAgent/mncontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CCMobster.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CCMobster.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CMobsterStub.cpp --- /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 + +/******************************************************************************* + * + * 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 ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/CMobsterStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster.x --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Mobster.v2/mobster_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CCPppcontroller.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CCPppcontroller.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CPppControllerStub.cpp --- /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 + +/******************************************************************************* + * + * 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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/CPppControllerStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller.x --- /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" diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Ppp/pppcontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Test/CTestStub.cpp --- /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 +#include +#include + +/******************************************************************************* + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/Test/CTestStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CCTestservice.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CCTestservice.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CTestServiceStub.cpp --- /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 + +/******************************************************************************* + * + * 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 ); +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/CTestServiceStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice.x --- /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" + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/TestService/testservice_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CCUuinterface.cpp --- /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 +#include +#include + + +/**************************************************************************************** + * + * 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CCUuinterface.h --- /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 +#include +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CUuinterfaceStub.cpp --- /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 + + +/******************************************************************************* + * + * 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 + +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/CUuinterfaceStub.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface.x --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface_clnt.c --- /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 +#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); +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ServiceStubs/UuInterface/uuinterface_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/bullet.gif Binary file testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/bullet.gif has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0000.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0001.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0002.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0003.ucd --- /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 + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0004.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0005.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0020.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0021.ucd --- /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 + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0022.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0023.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0099.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/PrivateScripts/script.0100.ucd --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/TestScripts/ScheduleTestScripts/sts_0100.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/UCCS.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/UCCS.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/Ucc.ico Binary file testexecmgmt/ucc/Source/Uccs.v2/Ucc.ico has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/resource.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/Uccs.v2/ucc.rc --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/CSFacontroller.cpp --- /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 +#include +#ifndef WIN32 +#include +#include +#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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/CSFacontroller.h --- /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 +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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/CSvcFacontroller.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcFacontroller.h" +#include "facontroller.h" +#include "standard_service_manager.h" + + +/**************************************************************************************** + * + * File-scope variables + * + ***************************************************************************************/ +static TStartupInfo iStartupInfo; +static CIntegerAllocator *iIntegerAllocator; +static CComponentManager *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 *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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/CSvcFacontroller.h --- /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 *aComponentManager, void *aArg ); + static int StopRPCService(); + + // Custom + static TStartupInfo GetStartupInfo(); + static CIntegerAllocator *GetIntegerAllocator(); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/FAController.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/FAController.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/Makefile --- /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* diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/facontroller.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/facontroller.x --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/facontroller_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/facontroller_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcFacontroller.h" +#include "CSFacontroller.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/facontroller/facontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/CNetworkPartitionManager.cpp --- /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 +#else +#include +#endif +#include +#include + + +/******************************************************************************* + * + * 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<> 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< %d (%g,%g,%g,%g).\n", aValue, rv, base, value, + simple_result, integer_result ); + } + assert( (1< 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/CNetworkPartitionManager.h --- /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 +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/CSHacontroller.cpp --- /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 +#include +#ifndef WIN32 +#include +#include +#include +#include +#else +#include +#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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/CSHacontroller.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/CSvcHacontroller.cpp --- /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 +#include + + +/**************************************************************************************** + * + * 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 *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 *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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/CSvcHacontroller.h --- /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 *aComponentManager, TStartupInfo *aArg ); + static int StopRPCService(); + + // Custom + static TStartupInfo GetStartupInfo(); + static CIntegerAllocator *GetAliasHostAddressAllocator(); + static CNetworkPartitionManager *GetNetworkPartitionManager(); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/HAController.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/HAController.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/Makefile --- /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* diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/hacontroller.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/hacontroller.x --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/hacontroller_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/hacontroller_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcHacontroller.h" +#include "CSHacontroller.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/hacontroller/hacontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/include/CComponentManager.h --- /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 +#include + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ + +/**************************************************************************************** + * + * Class CComponentManager + * + ***************************************************************************************/ +template +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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/include/penstd.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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/include/penstd.x --- /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<>; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/include/standard_service_manager.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/include/standard_unix.h --- /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 +#include +#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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/include/strncpynt.h --- /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__ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/CSMncontroller.cpp --- /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 +#include +#ifndef WIN32 +#include +#include +#include +#include +#include +#include +#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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/CSMncontroller.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/CSvcMncontroller.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcMncontroller.h" +#include "mncontroller.h" +#include "standard_service_manager.h" + + +/**************************************************************************************** + * + * File-scope variables + * + ***************************************************************************************/ +static CComponentManager *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 *aComponentManager, void *aArg ) +{ + assert( iComponentManager == NULL ); + iComponentManager = aComponentManager; + return ERR_NONE; +} + + +/**************************************************************************************** + * + * PUBLIC: StopRPCService + * + ***************************************************************************************/ +int CSvcMncontroller::StopRPCService() +{ + iComponentManager = NULL; + return ERR_NONE; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/CSvcMncontroller.h --- /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 *aComponentManager, void *aArg ); + static int StopRPCService(); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/HOWTO_add_new_methods.txt --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/MNController.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/MNController.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/Makefile --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/mncontroller.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/mncontroller.x --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/mncontroller_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/mncontroller_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcMncontroller.h" +#include "CSMncontroller.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/mncontroller/mncontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/CSPppcontroller.cpp --- /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 +#include +#include +#include +#ifndef WIN32 +#include +#include +#include +#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; +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/CSPppcontroller.h --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/CSvcPppcontroller.cpp --- /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 +#include + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcPppcontroller.h" +#include "pppcontroller.h" +#include "../include/standard_unix.h" +#include "../include/standard_service_manager.h" + + +/**************************************************************************************** + * + * File-scope variables + * + ***************************************************************************************/ +static CComponentManager *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 *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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/CSvcPppcontroller.h --- /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 *aComponentManager, TStartupInfo *aArg ); + static int StopRPCService(); +}; + +#endif diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/Makefile --- /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* diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/pppcontroller.dsp --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/pppcontroller.dsw --- /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> +{{{ +}}} + +############################################################################### + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/pppcontroller.h --- /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 +#include + +#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__ */ diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/pppcontroller.x --- /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; diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/pppcontroller_svc.c --- /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 +#include +#ifdef WIN32 +#include +#else +#include +#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); + } +} + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/pppcontroller_svc_stub_impl.cpp --- /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 + + +/**************************************************************************************** + * + * Local Includes + * + ***************************************************************************************/ +#include "CSvcPppcontroller.h" +#include "CSPppcontroller.h" +#include "CComponentManager.h" + + +/**************************************************************************************** + * + * Static Variables + * + ***************************************************************************************/ +static CComponentManager *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( 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; +} diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/pppcontroller/pppcontroller_xdr.c --- /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 +#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); +} + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Source/readme.txt --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+09:55:13:933 SUMMARY:
+09:55:13:933 PASS = 14
+09:55:13:938 FAIL = 0
+09:55:13:938 ABORT = 0
+09:55:13:938 PANIC = 0
+09:55:13:938 INCONCLUSIVE = 0
+09:55:13:938 UNKNOWN = 0
+09:55:13:938 UNEXECUTED = 0
+09:55:13:938 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:00:56:026 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:00:56:034 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:00:56:040 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:00:56:042 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:01:12:105 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:01:12:113 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:01:12:120 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:01:12:122 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:01:30:220 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:01:30:230 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:01:30:256 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:01:30:258 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:01:48:390 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:01:48:401 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:01:54:406 TEST STEP SUMMARY:
+12:01:54:408 PASS = 8
+12:01:54:409 FAIL = 0
+12:01:54:411 ABORT = 0
+12:01:54:412 PANIC = 0
+12:01:54:414 INCONCLUSIVE = 0
+12:01:54:416 UNKNOWN = 0
+12:01:54:417 UNEXECUTED = 0
+12:01:54:419 TEST CASE SUMMARY:
+12:01:54:421 PASS = 4
+12:01:54:423 FAIL = 0
+12:01:54:424 INCONCLUSIVE = 0
+12:01:54:426 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-TCP/master.htm --- /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
+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 c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+10:54:58:740 SUMMARY:
+10:54:58:745 PASS = 14
+10:54:58:745 FAIL = 0
+10:54:58:745 ABORT = 0
+10:54:58:745 PANIC = 0
+10:54:58:745 INCONCLUSIVE = 0
+10:54:58:745 UNKNOWN = 0
+10:54:58:745 UNEXECUTED = 0
+10:54:58:745 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/BasicSync/Serial-TCP/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:02:25:590 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:02:25:598 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:02:25:604 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:02:25:607 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:02:45:668 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:02:45:677 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:02:45:684 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:02:45:686 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:03:05:798 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:03:05:809 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:03:05:834 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:03:05:837 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:03:25:969 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:03:25:981 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:03:32:031 TEST STEP SUMMARY:
+12:03:32:033 PASS = 8
+12:03:32:034 FAIL = 0
+12:03:32:036 ABORT = 0
+12:03:32:038 PANIC = 0
+12:03:32:040 INCONCLUSIVE = 0
+12:03:32:041 UNKNOWN = 0
+12:03:32:043 UNEXECUTED = 0
+12:03:32:045 TEST CASE SUMMARY:
+12:03:32:046 PASS = 4
+12:03:32:048 FAIL = 0
+12:03:32:050 INCONCLUSIVE = 0
+12:03:32:052 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/BasicSync/TCP-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+11:21:59:489 SUMMARY:
+11:21:59:494 PASS = 14
+11:21:59:494 FAIL = 0
+11:21:59:494 ABORT = 0
+11:21:59:494 PANIC = 0
+11:21:59:494 INCONCLUSIVE = 0
+11:21:59:494 UNKNOWN = 0
+11:21:59:494 UNEXECUTED = 0
+11:21:59:494 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/BasicSync/TCP-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:03:932 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:05:03:939 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:05:03:945 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:05:03:948 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:22:012 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:05:22:020 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:05:22:029 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:05:22:031 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:38:141 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:38:151 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:05:38:177 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:38:180 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:54:311 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:05:54:323 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:06:00:328 TEST STEP SUMMARY:
+12:06:00:329 PASS = 8
+12:06:00:331 FAIL = 0
+12:06:00:333 ABORT = 0
+12:06:00:334 PANIC = 0
+12:06:00:336 INCONCLUSIVE = 0
+12:06:00:338 UNKNOWN = 0
+12:06:00:339 UNEXECUTED = 0
+12:06:00:341 TEST CASE SUMMARY:
+12:06:00:342 PASS = 4
+12:06:00:344 FAIL = 0
+12:06:00:346 INCONCLUSIVE = 0
+12:06:00:348 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+09:59:24:641 SUMMARY:
+09:59:24:641 PASS = 14
+09:59:24:641 FAIL = 0
+09:59:24:641 ABORT = 0
+09:59:24:641 PANIC = 0
+09:59:24:641 INCONCLUSIVE = 0
+09:59:24:641 UNKNOWN = 0
+09:59:24:641 UNEXECUTED = 0
+09:59:24:641 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:16:557 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:05:16:564 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:05:16:570 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:05:16:573 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:30:637 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:05:30:646 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:05:30:652 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:05:30:655 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:46:766 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:46:776 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:05:46:802 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:46:804 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:06:02:951 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:06:02:963 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:06:08:968 TEST STEP SUMMARY:
+12:06:08:970 PASS = 8
+12:06:08:971 FAIL = 0
+12:06:08:973 ABORT = 0
+12:06:08:975 PANIC = 0
+12:06:08:976 INCONCLUSIVE = 0
+12:06:08:978 UNKNOWN = 0
+12:06:08:980 UNEXECUTED = 0
+12:06:08:981 TEST CASE SUMMARY:
+12:06:08:983 PASS = 4
+12:06:08:984 FAIL = 0
+12:06:08:986 INCONCLUSIVE = 0
+12:06:08:988 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-TCP/master.htm --- /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
+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 c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+10:58:46:371 SUMMARY:
+10:58:46:371 PASS = 14
+10:58:46:371 FAIL = 0
+10:58:46:371 ABORT = 0
+10:58:46:371 PANIC = 0
+10:58:46:376 INCONCLUSIVE = 0
+10:58:46:376 UNKNOWN = 0
+10:58:46:376 UNEXECUTED = 0
+10:58:46:376 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/SetSharedData/Serial-TCP/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:06:20:512 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:06:20:519 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:06:20:526 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:06:20:528 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:06:38:606 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:06:38:616 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:06:38:622 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:06:38:625 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:06:56:739 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:06:56:749 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:06:56:775 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:06:56:778 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:07:12:908 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:07:12:920 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:07:18:937 TEST STEP SUMMARY:
+12:07:18:939 PASS = 8
+12:07:18:941 FAIL = 0
+12:07:18:942 ABORT = 0
+12:07:18:944 PANIC = 0
+12:07:18:946 INCONCLUSIVE = 0
+12:07:18:947 UNKNOWN = 0
+12:07:18:949 UNEXECUTED = 0
+12:07:18:951 TEST CASE SUMMARY:
+12:07:18:954 PASS = 4
+12:07:18:955 FAIL = 0
+12:07:18:957 INCONCLUSIVE = 0
+12:07:18:959 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/SetSharedData/TCP-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+11:25:49:185 SUMMARY:
+11:25:49:190 PASS = 14
+11:25:49:190 FAIL = 0
+11:25:49:190 ABORT = 0
+11:25:49:190 PANIC = 0
+11:25:49:190 INCONCLUSIVE = 0
+11:25:49:190 UNKNOWN = 0
+11:25:49:190 UNEXECUTED = 0
+11:25:49:195 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.1/SetSharedData/TCP-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:08:58:697 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:08:58:705 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:08:58:711 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:08:58:714 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:09:14:814 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:09:14:822 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:09:14:829 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:09:14:831 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:09:30:938 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:09:30:948 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:09:30:974 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:09:30:976 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:09:45:107 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:09:45:119 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:09:51:125 TEST STEP SUMMARY:
+12:09:51:126 PASS = 8
+12:09:51:128 FAIL = 0
+12:09:51:130 ABORT = 0
+12:09:51:131 PANIC = 0
+12:09:51:133 INCONCLUSIVE = 0
+12:09:51:135 UNKNOWN = 0
+12:09:51:136 UNEXECUTED = 0
+12:09:51:138 TEST CASE SUMMARY:
+12:09:51:140 PASS = 4
+12:09:51:141 FAIL = 0
+12:09:51:143 INCONCLUSIVE = 0
+12:09:51:145 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+11:14:13:933 SUMMARY:
+11:14:13:933 PASS = 14
+11:14:13:938 FAIL = 0
+11:14:13:938 ABORT = 0
+11:14:13:938 PANIC = 0
+11:14:13:938 INCONCLUSIVE = 0
+11:14:13:938 UNKNOWN = 0
+11:14:13:938 UNEXECUTED = 0
+11:14:13:938 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:04:57:026 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:04:57:034 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:04:57:040 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:04:57:042 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:13:105 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:05:13:113 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:05:13:120 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:05:13:122 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:31:220 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:31:230 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:05:31:256 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:31:258 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:49:390 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:05:49:401 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:05:55:406 TEST STEP SUMMARY:
+12:05:55:408 PASS = 8
+12:05:55:409 FAIL = 0
+12:05:55:411 ABORT = 0
+12:05:55:412 PANIC = 0
+12:05:55:414 INCONCLUSIVE = 0
+12:05:55:416 UNKNOWN = 0
+12:05:55:417 UNEXECUTED = 0
+12:05:55:419 TEST CASE SUMMARY:
+12:05:55:421 PASS = 4
+12:05:55:423 FAIL = 0
+12:05:55:424 INCONCLUSIVE = 0
+12:05:55:426 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-TCP/master.htm --- /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
+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 c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+11:37:58:740 SUMMARY:
+11:37:58:745 PASS = 14
+11:37:58:745 FAIL = 0
+11:37:58:745 ABORT = 0
+11:37:58:745 PANIC = 0
+11:37:58:745 INCONCLUSIVE = 0
+11:37:58:745 UNKNOWN = 0
+11:37:58:745 UNEXECUTED = 0
+11:37:58:745 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/BasicSync/Serial-TCP/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:04:25:590 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:04:25:598 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:04:25:604 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:04:25:607 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:04:45:668 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:04:45:677 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:04:45:684 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:04:45:686 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:05:798 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:05:05:809 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:05:05:834 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:05:05:837 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:05:25:969 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:05:25:981 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:05:32:031 TEST STEP SUMMARY:
+12:05:32:033 PASS = 8
+12:05:32:034 FAIL = 0
+12:05:32:036 ABORT = 0
+12:05:32:038 PANIC = 0
+12:05:32:040 INCONCLUSIVE = 0
+12:05:32:041 UNKNOWN = 0
+12:05:32:043 UNEXECUTED = 0
+12:05:32:045 TEST CASE SUMMARY:
+12:05:32:046 PASS = 4
+12:05:32:048 FAIL = 0
+12:05:32:050 INCONCLUSIVE = 0
+12:05:32:052 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/BasicSync/TCP-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 5 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 14 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 c:\ucc\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 25 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+09:28:59:489 SUMMARY:
+09:28:59:494 PASS = 14
+09:28:59:494 FAIL = 0
+09:28:59:494 ABORT = 0
+09:28:59:494 PANIC = 0
+09:28:59:494 INCONCLUSIVE = 0
+09:28:59:494 UNKNOWN = 0
+09:28:59:494 UNEXECUTED = 0
+09:28:59:494 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/BasicSync/TCP-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:12:03:932 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:12:03:939 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:12:03:945 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:12:03:948 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:12:22:012 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:12:22:020 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:12:22:029 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:12:22:031 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:12:38:141 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:12:38:151 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:12:38:177 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:12:38:180 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:12:54:311 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:12:54:323 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:13:00:328 TEST STEP SUMMARY:
+12:13:00:329 PASS = 8
+12:13:00:331 FAIL = 0
+12:13:00:333 ABORT = 0
+12:13:00:334 PANIC = 0
+12:13:00:336 INCONCLUSIVE = 0
+12:13:00:338 UNKNOWN = 0
+12:13:00:339 UNEXECUTED = 0
+12:13:00:341 TEST CASE SUMMARY:
+12:13:00:342 PASS = 4
+12:13:00:344 FAIL = 0
+12:13:00:346 INCONCLUSIVE = 0
+12:13:00:348 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+09:05:24:641 SUMMARY:
+09:05:24:641 PASS = 14
+09:05:24:641 FAIL = 0
+09:05:24:641 ABORT = 0
+09:05:24:641 PANIC = 0
+09:05:24:641 INCONCLUSIVE = 0
+09:05:24:641 UNKNOWN = 0
+09:05:24:641 UNEXECUTED = 0
+09:05:24:641 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:13:16:557 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:13:16:564 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:13:16:570 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:13:16:573 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:13:30:637 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:13:30:646 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:13:30:652 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:13:30:655 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:13:46:766 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:13:46:776 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:13:46:802 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:13:46:804 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:14:02:951 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:14:02:963 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:14:08:968 TEST STEP SUMMARY:
+12:14:08:970 PASS = 8
+12:14:08:971 FAIL = 0
+12:14:08:973 ABORT = 0
+12:14:08:975 PANIC = 0
+12:14:08:976 INCONCLUSIVE = 0
+12:14:08:978 UNKNOWN = 0
+12:14:08:980 UNEXECUTED = 0
+12:14:08:981 TEST CASE SUMMARY:
+12:14:08:983 PASS = 4
+12:14:08:984 FAIL = 0
+12:14:08:986 INCONCLUSIVE = 0
+12:14:08:988 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/master.htm --- /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
+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 c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+10:19:46:371 SUMMARY:
+10:19:46:371 PASS = 14
+10:19:46:371 FAIL = 0
+10:19:46:371 ABORT = 0
+10:19:46:371 PANIC = 0
+10:19:46:376 INCONCLUSIVE = 0
+10:19:46:376 UNKNOWN = 0
+10:19:46:376 UNEXECUTED = 0
+10:19:46:376 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/Serial-TCP/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:51:20:512 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:51:20:519 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:51:20:526 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:51:20:528 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:51:38:606 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:51:38:616 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:51:38:622 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:51:38:625 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:51:56:739 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:51:56:749 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:51:56:775 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:51:56:778 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:52:12:908 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:52:12:920 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:52:18:937 TEST STEP SUMMARY:
+12:52:18:939 PASS = 8
+12:52:18:941 FAIL = 0
+12:52:18:942 ABORT = 0
+12:52:18:944 PANIC = 0
+12:52:18:946 INCONCLUSIVE = 0
+12:52:18:947 UNKNOWN = 0
+12:52:18:949 UNEXECUTED = 0
+12:52:18:951 TEST CASE SUMMARY:
+12:52:18:954 PASS = 4
+12:52:18:955 FAIL = 0
+12:52:18:957 INCONCLUSIVE = 0
+12:52:18:959 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/master.htm --- /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
+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 c:\ucc\master.script Line = 7 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StartService ***Result = PASS 
+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 c:\ucc\master.script Line = 10 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini BuildRun ***Result = PASS 
+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 c:\ucc\master.script Line = 12 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 16 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 18 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 21 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini SetSharedData ***Result = PASS 
+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 c:\ucc\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 c:\ucc\master.script Line = 24 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini RetrieveExecutionResult ***Result = PASS 
+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 c:\ucc\master.script Line = 26 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\TestdriverService.ini StopService ***Result = PASS 
+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 c:\ucc\master.script Line = 27 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\UCC\SyncService.ini StopService ***Result = PASS 
+15:20:49:185 SUMMARY:
+15:20:49:190 PASS = 14
+15:20:49:190 FAIL = 0
+15:20:49:190 ABORT = 0
+15:20:49:190 PANIC = 0
+15:20:49:190 INCONCLUSIVE = 0
+15:20:49:190 UNKNOWN = 0
+15:20:49:190 UNEXECUTED = 0
+15:20:49:195 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/TCP-Serial/slave.htm --- /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
+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 c:\ucc\slave.script Line = 5 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 c:\ucc\slave.script Line = 7 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 8 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:11:58:697 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestOne
+12:11:58:705 c:\ucc\slave.script Line = 9 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:11:58:711 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:11:58:714 c:\ucc\slave.script Line = 11 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 c:\ucc\slave.script Line = 13 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 14 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:12:14:814 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:12:14:822 c:\ucc\slave.script Line = 15 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:12:14:829 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:12:14:831 c:\ucc\slave.script Line = 17 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 c:\ucc\slave.script Line = 19 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 20 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:12:30:938 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:12:30:948 c:\ucc\slave.script Line = 21 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:12:30:974 c:\ucc\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:12:30:976 c:\ucc\slave.script Line = 23 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 c:\ucc\slave.script Line = 25 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+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 c:\ucc\slave.script Line = 26 Command = RUN_TEST_STEP 100 SampleServer SampleStep2  c:\ucc\sampleTest.ini SectionOne ***Result = PASS 
+12:12:45:107 c:\ucc\slave.script END_SYNCHRONISED_TESTCASE TestFour
+12:12:45:119 c:\ucc\slave.script Line = 27 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:12:51:125 TEST STEP SUMMARY:
+12:12:51:126 PASS = 8
+12:12:51:128 FAIL = 0
+12:12:51:130 ABORT = 0
+12:12:51:131 PANIC = 0
+12:12:51:133 INCONCLUSIVE = 0
+12:12:51:135 UNKNOWN = 0
+12:12:51:136 UNEXECUTED = 0
+12:12:51:138 TEST CASE SUMMARY:
+12:12:51:140 PASS = 4
+12:12:51:141 FAIL = 0
+12:12:51:143 INCONCLUSIVE = 0
+12:12:51:145 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/9.2/SetSharedData/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Master/TestResults.htm --- /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 @@ +
+z:\sampletest\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartService ***Result = PASS 
+z:\sampletest\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+z:\sampletest\master.script Line = 9 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+z:\sampletest\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+z:\sampletest\master.script Line = 12 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server ConnectBT ***Result = PASS 
+z:\sampletest\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+z:\sampletest\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+z:\sampletest\master.script Line = 16 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server TransferBT ***Result = PASS 
+z:\sampletest\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+z:\sampletest\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+z:\sampletest\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+z:\sampletest\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StopService ***Result = PASS 
+SUMMARY:
+PASS = 12
+FAIL = 0
+ABORT = 0
+PANIC = 0
+INCONCLUSIVE = 0
+UNKNOWN = 0
+UNEXECUTED = 0
+
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Master/master.htm --- /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
+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 z:\sampletest\master.script Line = 6 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartService ***Result = PASS 
+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 z:\sampletest\master.script Line = 8 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 z:\sampletest\master.script Line = 9 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 z:\sampletest\master.script Line = 11 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 z:\sampletest\master.script Line = 12 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server ConnectBT ***Result = PASS 
+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 z:\sampletest\master.script Line = 13 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 z:\sampletest\master.script Line = 15 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 z:\sampletest\master.script Line = 16 Command = RUN_TEST_STEP -1 TEF_Bluetooth_Server TransferBT ***Result = PASS 
+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 z:\sampletest\master.script Line = 17 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 z:\sampletest\master.script Line = 19 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StartSyncTestCase ***Result = PASS 
+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 z:\sampletest\master.script Line = 20 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini RetrieveSyncTestCaseResult ***Result = PASS 
+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 z:\sampletest\master.script Line = 22 Command = RUN_TEST_STEP -1 UCCControlTE RunCommand c:\SyncService.ini StopService ***Result = PASS 
+12:03:48:627 SUMMARY:
+12:03:48:635 PASS = 12
+12:03:48:701 FAIL = 0
+12:03:48:703 ABORT = 0
+12:03:48:705 PANIC = 0
+12:03:48:707 INCONCLUSIVE = 0
+12:03:48:709 UNKNOWN = 0
+12:03:48:710 UNEXECUTED = 0
+12:03:48:713 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Slave/TestResults.htm --- /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 @@ +
+z:\sampletest\slave.script Line = 6 Command = START_SYNCHRONISED_TESTCASE TestOne  
+z:\sampletest\slave.script Line = 8 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+z:\sampletest\slave.script Line = 10 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+z:\sampletest\slave.script Line = 12 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server AcceptBT ***Result = PASS 
+z:\sampletest\slave.script Line = 13 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+z:\sampletest\slave.script Line = 15 Command = START_SYNCHRONISED_TESTCASE TestThree  
+z:\sampletest\slave.script Line = 17 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server  ReceiveBT ***Result = PASS 
+z:\sampletest\slave.script Line = 18 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+z:\sampletest\slave.script Line = 20 Command = START_SYNCHRONISED_TESTCASE TestFour  
+z:\sampletest\slave.script Line = 22 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+TEST STEP SUMMARY:
+PASS = 2
+FAIL = 0
+ABORT = 0
+PANIC = 0
+INCONCLUSIVE = 0
+UNKNOWN = 0
+UNEXECUTED = 0
+TEST CASE SUMMARY:
+PASS = 4
+FAIL = 0
+INCONCLUSIVE = 0
+
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/BlueTooth_Beta_PREQ_750/Slave/slave.htm --- /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
+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 z:\sampletest\slave.script Line = 6 Command = START_SYNCHRONISED_TESTCASE TestOne  
+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 z:\sampletest\slave.script Line = 8 Command = END_SYNCHRONISED_TESTCASE TestOne ***TestCaseResult = PASS 
+12:07:25:828 z:\sampletest\slave.script START_SYNCHRONISED_TESTCASE TestTwo
+12:07:25:993 z:\sampletest\slave.script Line = 10 Command = START_SYNCHRONISED_TESTCASE TestTwo  
+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 z:\sampletest\slave.script Line = 12 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server AcceptBT ***Result = PASS 
+12:07:39:858 z:\sampletest\slave.script END_SYNCHRONISED_TESTCASE TestTwo
+12:07:39:875 z:\sampletest\slave.script Line = 13 Command = END_SYNCHRONISED_TESTCASE TestTwo ***TestCaseResult = PASS 
+12:07:39:892 z:\sampletest\slave.script START_SYNCHRONISED_TESTCASE TestThree
+12:07:39:897 z:\sampletest\slave.script Line = 15 Command = START_SYNCHRONISED_TESTCASE TestThree  
+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 z:\sampletest\slave.script Line = 17 Command = RUN_TEST_STEP 100 TEF_Bluetooth_Server  ReceiveBT ***Result = PASS 
+12:07:54:550 z:\sampletest\slave.script END_SYNCHRONISED_TESTCASE TestThree
+12:07:54:566 z:\sampletest\slave.script Line = 18 Command = END_SYNCHRONISED_TESTCASE TestThree ***TestCaseResult = PASS 
+12:07:54:576 z:\sampletest\slave.script START_SYNCHRONISED_TESTCASE TestFour
+12:07:54:581 z:\sampletest\slave.script Line = 20 Command = START_SYNCHRONISED_TESTCASE TestFour  
+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 z:\sampletest\slave.script Line = 22 Command = END_SYNCHRONISED_TESTCASE TestFour ***TestCaseResult = PASS 
+12:08:07:021 TEST STEP SUMMARY:
+12:08:07:081 PASS = 2
+12:08:07:308 FAIL = 0
+12:08:07:546 ABORT = 0
+12:08:07:551 PANIC = 0
+12:08:07:554 INCONCLUSIVE = 0
+12:08:07:557 UNKNOWN = 0
+12:08:07:561 UNEXECUTED = 0
+12:08:07:564 TEST CASE SUMMARY:
+12:08:07:569 PASS = 4
+12:08:07:574 FAIL = 0
+12:08:07:579 INCONCLUSIVE = 0
+12:08:07:585 
diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/Legacy/output0001.debug.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 @@ + + +output0001.debug.html + + +
 
+
+

output0001.debug.html

+

Thu Jun 09 11:55:31 2005 +

+

StartUseCase(1)


+
+     0 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=1 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID1
       +       StartServiceResult(13, localhost, success) +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID1
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     1 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=1 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD1
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     2 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=2 STATE=1 VALUE="A" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD2
STATE1
VALUEA
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     3 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=3 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD3
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     4 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=4 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD4
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     5 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=5 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD5
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     6 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=6 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD6
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     7 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=7 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD7
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     8 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=8 STATE=1 VALUE="000.0" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD8
STATE1
VALUE000.0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     9 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=9 STATE=1 VALUE="000.0" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD9
STATE1
VALUE000.0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     10 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=10 STATE=1 VALUE="013.7" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD10
STATE1
VALUE013.7
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     11 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=11 STATE=1 VALUE="E" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD11
STATE1
VALUEE
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     12 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=12 STATE=2 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD12
STATE2
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     13 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=13 STATE=1 VALUE="A" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD13
STATE1
VALUEA
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     14 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=14 STATE=1 VALUE="3" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD14
STATE1
VALUE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     15 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=15 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD15
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     16 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=16 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD16
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     17 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=17 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD17
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     18 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=18 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD18
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     19 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=19 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD19
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     20 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=20 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD20
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     21 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=21 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD21
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     22 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=22 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD22
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     23 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=23 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD23
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     24 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=24 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD24
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     25 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=25 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD25
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     26 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=26 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD26
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     27 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=27 STATE=1 VALUE="1.0" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD27
STATE1
VALUE1.0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     28 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=28 STATE=1 VALUE="1.0" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD28
STATE1
VALUE1.0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     29 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=29 STATE=1 VALUE="1.0" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD29
STATE1
VALUE1.0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     30 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=30 STATE=1 VALUE="5" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD30
STATE1
VALUE5
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     31 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=31 STATE=1 VALUE="66.7" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD31
STATE1
VALUE66.7
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     32 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=32 STATE=1 VALUE="30.0" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD32
STATE1
VALUE30.0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     33 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=33 STATE=0 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD33
STATE0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     34 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=34 STATE=0 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD34
STATE0
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     35 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=35 STATE=1 VALUE="1" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD35
STATE1
VALUE1
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     36 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=36 STATE=1 VALUE="1" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD36
STATE1
VALUE1
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     37 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=37 STATE=1 VALUE="1" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD37
STATE1
VALUE1
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     38 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=38 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD38
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     39 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=39 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD39
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     40 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=40 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD40
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     41 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=41 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD41
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     42 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=42 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD42
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     43 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=43 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD43
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     44 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=44 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD44
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     45 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=45 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD45
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     46 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=46 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD46
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     47 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=47 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD47
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     48 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=48 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD48
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     49 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=49 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD49
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     50 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=50 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD50
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     51 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=51 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD51
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     52 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=52 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD52
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     53 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=53 STATE=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID12
FIELD53
STATE3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID12
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     54 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=1 ELEVATION=1 AZIMUTH=1 SNR=1 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID1
ELEVATION1
AZIMUTH1
SNR1
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     55 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=2 ELEVATION=2 AZIMUTH=2 SNR=2 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID2
ELEVATION2
AZIMUTH2
SNR2
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     56 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=3 ELEVATION=3 AZIMUTH=3 SNR=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID3
ELEVATION3
AZIMUTH3
SNR3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     57 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=4 ELEVATION=4 AZIMUTH=4 SNR=4 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID4
ELEVATION4
AZIMUTH4
SNR4
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     58 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=5 ELEVATION=5 AZIMUTH=5 SNR=5 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID5
ELEVATION5
AZIMUTH5
SNR5
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     59 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=6 ELEVATION=6 AZIMUTH=6 SNR=6 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID6
ELEVATION6
AZIMUTH6
SNR6
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     60 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=7 ELEVATION=7 AZIMUTH=7 SNR=7 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID7
ELEVATION7
AZIMUTH7
SNR7
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     61 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=8 ELEVATION=8 AZIMUTH=8 SNR=8 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID8
ELEVATION8
AZIMUTH8
SNR8
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     62 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=9 ELEVATION=9 AZIMUTH=9 SNR=9 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID9
ELEVATION9
AZIMUTH9
SNR9
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     63 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=10 ELEVATION=10 AZIMUTH=10 SNR=10 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID10
ELEVATION10
AZIMUTH10
SNR10
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     64 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=11 ELEVATION=11 AZIMUTH=11 SNR=11 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID11
ELEVATION11
AZIMUTH11
SNR11
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     65 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=12 ELEVATION=12 AZIMUTH=12 SNR=12 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID17
SATID12
ELEVATION12
AZIMUTH12
SNR12
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID17
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     66 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=1 FREQUENCY=1 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID18
SENTENCEID1
FREQUENCY1
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID18
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     67 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=2 FREQUENCY=2 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID18
SENTENCEID2
FREQUENCY2
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID18
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     68 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=3 FREQUENCY=1 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID18
SENTENCEID3
FREQUENCY1
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID18
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     69 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=4 FREQUENCY=3 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID18
SENTENCEID4
FREQUENCY3
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID18
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     70 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=5 FREQUENCY=1 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID18
SENTENCEID5
FREQUENCY1
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID18
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     71 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=28 FREQUENCY=1 STRING="TEST STRING - TEST STRING - TEST STRING" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID28
FREQUENCY1
STRINGTEST STRING - TEST STRING - TEST STRING
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID28
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     72 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=22 COMPORT="COM2" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID22
COMPORTCOM2
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID22
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     73 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=14 LATITUDE=0101.000 NS="N" LONGITUDE=01001.000 EW="E" ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID14
LATITUDE0101.000
NSN
LONGITUDE01001.000
EWE
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID14
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     74 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=15 SPEED=100 DIRECTION=45 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID15
SPEED100
DIRECTION45
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID15
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     75 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=10 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID10
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID10
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     76 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=26 ) +       +
runcmd
SVCID13
SVCHOSTlocalhost
METHODID26
       +       +
Command Reply
SVCID13
SVCHOSTlocalhost
METHODID26
REQUESTCOMPLETIONCODE0
REQUESTCOMPLETIONDESCsuccess
RESULT0
       +
+     77 - ExecuteString( rendezvous ) +       +
rendezvous
       diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/Legacy/output0001.log.html --- /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 @@ + + + +output0001.log.html + + +
 
+
+

output0001.log.html

+

Thu Jun 09 11:55:31 2005 +

+

StartUseCase(1)


+     0 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=1 ) +     1 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=1 STATE=3 ) +     2 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=2 STATE=1 VALUE="A" ) +     3 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=3 STATE=3 ) +     4 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=4 STATE=3 ) +     5 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=5 STATE=3 ) +     6 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=6 STATE=3 ) +     7 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=7 STATE=3 ) +     8 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=8 STATE=1 VALUE="000.0" ) +     9 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=9 STATE=1 VALUE="000.0" ) +     10 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=10 STATE=1 VALUE="013.7" ) +     11 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=11 STATE=1 VALUE="E" ) +     12 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=12 STATE=2 ) +     13 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=13 STATE=1 VALUE="A" ) +     14 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=14 STATE=1 VALUE="3" ) +     15 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=15 STATE=3 ) +     16 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=16 STATE=3 ) +     17 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=17 STATE=3 ) +     18 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=18 STATE=3 ) +     19 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=19 STATE=3 ) +     20 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=20 STATE=3 ) +     21 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=21 STATE=3 ) +     22 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=22 STATE=3 ) +     23 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=23 STATE=3 ) +     24 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=24 STATE=3 ) +     25 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=25 STATE=3 ) +     26 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=26 STATE=3 ) +     27 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=27 STATE=1 VALUE="1.0" ) +     28 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=28 STATE=1 VALUE="1.0" ) +     29 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=29 STATE=1 VALUE="1.0" ) +     30 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=30 STATE=1 VALUE="5" ) +     31 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=31 STATE=1 VALUE="66.7" ) +     32 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=32 STATE=1 VALUE="30.0" ) +     33 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=33 STATE=0 ) +     34 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=34 STATE=0 ) +     35 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=35 STATE=1 VALUE="1" ) +     36 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=36 STATE=1 VALUE="1" ) +     37 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=37 STATE=1 VALUE="1" ) +     38 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=38 STATE=3 ) +     39 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=39 STATE=3 ) +     40 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=40 STATE=3 ) +     41 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=41 STATE=3 ) +     42 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=42 STATE=3 ) +     43 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=43 STATE=3 ) +     44 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=44 STATE=3 ) +     45 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=45 STATE=3 ) +     46 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=46 STATE=3 ) +     47 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=47 STATE=3 ) +     48 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=48 STATE=3 ) +     49 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=49 STATE=3 ) +     50 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=50 STATE=3 ) +     51 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=51 STATE=3 ) +     52 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=52 STATE=3 ) +     53 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=53 STATE=3 ) +     54 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=1 ELEVATION=1 AZIMUTH=1 SNR=1 ) +     55 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=2 ELEVATION=2 AZIMUTH=2 SNR=2 ) +     56 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=3 ELEVATION=3 AZIMUTH=3 SNR=3 ) +     57 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=4 ELEVATION=4 AZIMUTH=4 SNR=4 ) +     58 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=5 ELEVATION=5 AZIMUTH=5 SNR=5 ) +     59 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=6 ELEVATION=6 AZIMUTH=6 SNR=6 ) +     60 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=7 ELEVATION=7 AZIMUTH=7 SNR=7 ) +     61 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=8 ELEVATION=8 AZIMUTH=8 SNR=8 ) +     62 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=9 ELEVATION=9 AZIMUTH=9 SNR=9 ) +     63 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=10 ELEVATION=10 AZIMUTH=10 SNR=10 ) +     64 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=11 ELEVATION=11 AZIMUTH=11 SNR=11 ) +     65 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=12 ELEVATION=12 AZIMUTH=12 SNR=12 ) +     66 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=1 FREQUENCY=1 ) +     67 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=2 FREQUENCY=2 ) +     68 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=3 FREQUENCY=1 ) +     69 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=4 FREQUENCY=3 ) +     70 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=5 FREQUENCY=1 ) +     71 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=28 FREQUENCY=1 STRING="TEST STRING - TEST STRING - TEST STRING" ) +     72 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=22 COMPORT="COM2" ) +     73 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=14 LATITUDE=0101.000 NS="N" LONGITUDE=01001.000 EW="E" ) +     74 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=15 SPEED=100 DIRECTION=45 ) +     75 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=10 ) +     76 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=26 ) +     77 - ExecuteString( rendezvous ) diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/Legacy/output0001.noref.html --- /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 @@ + + +output0001.noref.html + + +
 
+
+

output0001.noref.html

+

Thu Jun 09 11:55:31 2005 +

+

StartUseCase(1)


+     0 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=1 ) +     1 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=1 STATE=3 ) +     2 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=2 STATE=1 VALUE="A" ) +     3 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=3 STATE=3 ) +     4 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=4 STATE=3 ) +     5 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=5 STATE=3 ) +     6 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=6 STATE=3 ) +     7 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=7 STATE=3 ) +     8 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=8 STATE=1 VALUE="000.0" ) +     9 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=9 STATE=1 VALUE="000.0" ) +     10 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=10 STATE=1 VALUE="013.7" ) +     11 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=11 STATE=1 VALUE="E" ) +     12 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=12 STATE=2 ) +     13 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=13 STATE=1 VALUE="A" ) +     14 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=14 STATE=1 VALUE="3" ) +     15 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=15 STATE=3 ) +     16 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=16 STATE=3 ) +     17 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=17 STATE=3 ) +     18 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=18 STATE=3 ) +     19 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=19 STATE=3 ) +     20 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=20 STATE=3 ) +     21 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=21 STATE=3 ) +     22 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=22 STATE=3 ) +     23 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=23 STATE=3 ) +     24 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=24 STATE=3 ) +     25 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=25 STATE=3 ) +     26 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=26 STATE=3 ) +     27 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=27 STATE=1 VALUE="1.0" ) +     28 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=28 STATE=1 VALUE="1.0" ) +     29 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=29 STATE=1 VALUE="1.0" ) +     30 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=30 STATE=1 VALUE="5" ) +     31 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=31 STATE=1 VALUE="66.7" ) +     32 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=32 STATE=1 VALUE="30.0" ) +     33 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=33 STATE=0 ) +     34 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=34 STATE=0 ) +     35 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=35 STATE=1 VALUE="1" ) +     36 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=36 STATE=1 VALUE="1" ) +     37 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=37 STATE=1 VALUE="1" ) +     38 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=38 STATE=3 ) +     39 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=39 STATE=3 ) +     40 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=40 STATE=3 ) +     41 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=41 STATE=3 ) +     42 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=42 STATE=3 ) +     43 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=43 STATE=3 ) +     44 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=44 STATE=3 ) +     45 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=45 STATE=3 ) +     46 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=46 STATE=3 ) +     47 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=47 STATE=3 ) +     48 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=48 STATE=3 ) +     49 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=49 STATE=3 ) +     50 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=50 STATE=3 ) +     51 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=51 STATE=3 ) +     52 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=52 STATE=3 ) +     53 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=12 FIELD=53 STATE=3 ) +     54 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=1 ELEVATION=1 AZIMUTH=1 SNR=1 ) +     55 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=2 ELEVATION=2 AZIMUTH=2 SNR=2 ) +     56 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=3 ELEVATION=3 AZIMUTH=3 SNR=3 ) +     57 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=4 ELEVATION=4 AZIMUTH=4 SNR=4 ) +     58 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=5 ELEVATION=5 AZIMUTH=5 SNR=5 ) +     59 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=6 ELEVATION=6 AZIMUTH=6 SNR=6 ) +     60 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=7 ELEVATION=7 AZIMUTH=7 SNR=7 ) +     61 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=8 ELEVATION=8 AZIMUTH=8 SNR=8 ) +     62 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=9 ELEVATION=9 AZIMUTH=9 SNR=9 ) +     63 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=10 ELEVATION=10 AZIMUTH=10 SNR=10 ) +     64 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=11 ELEVATION=11 AZIMUTH=11 SNR=11 ) +     65 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=17 SATID=12 ELEVATION=12 AZIMUTH=12 SNR=12 ) +     66 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=1 FREQUENCY=1 ) +     67 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=2 FREQUENCY=2 ) +     68 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=3 FREQUENCY=1 ) +     69 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=4 FREQUENCY=3 ) +     70 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=18 SENTENCEID=5 FREQUENCY=1 ) +     71 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=28 FREQUENCY=1 STRING="TEST STRING - TEST STRING - TEST STRING" ) +     72 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=22 COMPORT="COM2" ) +     73 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=14 LATITUDE=0101.000 NS="N" LONGITUDE=01001.000 EW="E" ) +     74 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=15 SPEED=100 DIRECTION=45 ) +     75 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=10 ) +     76 - ExecuteString( runcmd svcid=13 svchost="localhost" methodid=26 ) +     77 - ExecuteString( rendezvous ) diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Results/TestResults.xls Binary file testexecmgmt/ucc/Test/Results/TestResults.xls has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/TestDriverService.ini --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-Serial/master.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/TestDriverService.ini --- /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 + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/Serial-TCP/master.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/TestDriverService.ini --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Master/TCP-Serial/master.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Slave/sampletest.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/BasicSync/Slave/slave.script --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/TestDriverService.ini --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/Serial/master.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/TestDriverService.ini --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/TCP/master.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/SyncService.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/TestDriverService.ini --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/WinTunnel/master.script --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Master/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/SharedData.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/Slave/slave.script --- /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 + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/Scripts/SetSharedData/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/CommandLineTest.dtd --- /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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/RTest.dtd --- /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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/RTestRom.dtd --- /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 @@ + + + + + + \ No newline at end of file diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/SampleTestServer.xml --- /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 @@ + + + + + SampleTestServer + + + UCCSlaveTest + + + + SampleServer + + \ No newline at end of file diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/SampleTestServer/UCCSlaveTest.xml --- /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 @@ + + + + + + UCCSlaveTest + + + + 120 + + + + + + + + SampleServer + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/SampleTestServer/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/SampleTestServer/testExecuteServers/SampleServer.xml --- /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 @@ + + + + + + SampleServer + + + + SampleServer.mmp + + + + \EPOC\development\personal\jamesv\ProductisedUCC\TestExecute\Group\bld.inf + + + + + \UCC_Test\Scripts\BasicSync\Slave\sampletest.ini + c:\UCC\sampletest.ini + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/SampleTestServer/testExecuteServers/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/UCCSlave.xml --- /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 @@ + + + + + UCCSlave + + + SampleTestServer + + + \ No newline at end of file diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/distribution.policy --- /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 diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/root.xml --- /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 @@ + + + + root + + + UCCSlave + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/testExecuteServer.dtd --- /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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/testExecuteTest.dtd --- /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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/Test/xml/testSuite.dtd --- /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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/bin/ucc.exe Binary file testexecmgmt/ucc/bin/ucc.exe has changed diff -r 000000000000 -r 3da2a79470a7 testexecmgmt/ucc/bin/ucc.ini --- /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 diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/bin/oncrpc.dll Binary file testtoolsconn/oncrpc/bin/oncrpc.dll has changed diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/bin/portmap.exe Binary file testtoolsconn/oncrpc/bin/portmap.exe has changed diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/bin/portmap.srg Binary file testtoolsconn/oncrpc/bin/portmap.srg has changed diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/bin/portmapinstall.bat --- /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 + diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/binaries_for_build/oncrpcms.lib Binary file testtoolsconn/oncrpc/binaries_for_build/oncrpcms.lib has changed diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/group/bld.inf --- /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 + diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/group/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 diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/group/oncrpc.mrp --- /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 diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/oncrpc/group/oncrpc.tdf --- /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 @@ + + +