datacommsserver/esockserver/test/CapTests/Resolver/Common/CStep.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // PARAM_MESS_NAME_CStep.CPP
       
    15 // 
       
    16 //
       
    17 
       
    18 //Test Step header
       
    19 #include "PARAM_MESS_NAME_CStep.h"
       
    20 
       
    21 
       
    22 //TO BE SAFE
       
    23 IMPORT_C TInt StartDialogThread();
       
    24 //static const TInt KWaitPeriod = 3000000;
       
    25 
       
    26 
       
    27 CPARAM_MESS_NAMEStep::CPARAM_MESS_NAMEStep(TBool aUpsAuthorisationGranted)
       
    28 /** Each test step initialises it's own name
       
    29 */
       
    30 	{
       
    31 	// store the name of this test case
       
    32 	// this is the name that is used by the script file
       
    33 	//DEF iTestStepName = _L("CPARAM_MESS_NAMEStep");
       
    34 
       
    35 	//The server name and IPC number is obtained and all messages are checked Sync
       
    36 	SR_ServerName		= _L("PARAM_SVR_NAME");
       
    37 	SR_MESSAGE_TYPE		=	2;
       
    38 	SR_MESSAGE_ID		= PARAM_MESS_VALUE;
       
    39 	SR_MESSAGE_MASK		= PARAM_MESS_CAPMASK;
       
    40 
       
    41 	//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
       
    42 
       
    43 	iServer_Panic		=	_L("PARAM_SVR_T16_PANIC");
       
    44 
       
    45 	TCapability cap[] = {ECapabilityPARAM_MESS_NAMECAP, ECapability_Limit};
       
    46 
       
    47 	TSecurityInfo info;
       
    48 	info.Set(RProcess());
       
    49 	TBool result = EFalse;
       
    50 
       
    51 	for (TInt i = 0; cap[i] != ECapability_Limit; i++)
       
    52 	{
       
    53 		if ((!aUpsAuthorisationGranted || cap[i] != ECapabilityNetworkServices) &&
       
    54 			!(info.iCaps.HasCapability(cap[i])))
       
    55 		{
       
    56 			result=ETrue;
       
    57 
       
    58 		}
       
    59 
       
    60 	}
       
    61 
       
    62 
       
    63 	iExpect_Rejection = result;
       
    64 
       
    65 	iStepCap			= (TUint32)PARAM_MESS_CAPMASK;
       
    66 
       
    67 	//Get a unique thread name
       
    68 	ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
       
    69 
       
    70 	}
       
    71 
       
    72 
       
    73 TInt CPARAM_MESS_NAMEStep::Exec_SendReceive()
       
    74 	{
       
    75 	_LIT(KEsockSessStartMutex,"KESSMTX"); //Keep the descriptor short
       
    76 	RMutex mutex;
       
    77 	TInt r;
       
    78 	// Protect the openning of the session
       
    79 	// with a mutex to stop thread collision
       
    80 	FOREVER
       
    81 		{
       
    82 		r = mutex.CreateGlobal(KEsockSessStartMutex());
       
    83 		if (r == KErrNone)
       
    84 			break;
       
    85 		if (r != KErrAlreadyExists)
       
    86 			return r;
       
    87 		r=mutex.OpenGlobal(KEsockSessStartMutex());
       
    88 		if (r == KErrNone)
       
    89 			break;
       
    90 		if (r != KErrNotFound)
       
    91 			return r;
       
    92 		}
       
    93 	mutex.Wait(); // the exclusion ensures the session is started atomically
       
    94 	iResult_Server=CreateSession(SOCKET_SERVER_NAME,Version());
       
    95 	// Because ESock is now loaded by the Comms Root Server which is generally started during
       
    96 	// the boot this should commonly succeed; however for test code this is still a possibility
       
    97 	// Hence here we try starting it; this is an atomic operation (and cheap if it's already started)
       
    98 	if (iResult_Server==KErrNotFound)
       
    99 		{
       
   100 		r=StartC32();
       
   101 		if (r==KErrNone || r==KErrAlreadyExists)
       
   102 			{
       
   103 			iResult_Server=CreateSession(SOCKET_SERVER_NAME,Version());
       
   104 			}
       
   105 		}
       
   106 	mutex.Signal();
       
   107 	mutex.Close();
       
   108 
       
   109 	if (iResult_Server == KErrNone)
       
   110 		{
       
   111 		iSessionCreated = ETrue;
       
   112 
       
   113 		const TInt test_id = dispatch_num<PARAM_MESS_VALUE>::result;
       
   114 
       
   115 		iResult_SR = do_execute(Int2Type<test_id>());
       
   116 		}
       
   117 	else
       
   118 		{
       
   119 		iSessionCreated = EFalse;
       
   120 		return 0;
       
   121 		}
       
   122 	return r;
       
   123 	}
       
   124 
       
   125 //------------------------------------------------------------------------------------------------------
       
   126 // testing
       
   127 // EHRCreate
       
   128 //------------------------------------------------------------------------------------------------------
       
   129 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRCreate>)
       
   130 {
       
   131     TInt result;
       
   132 
       
   133     TPckgBuf<TInt> session(iSSRes);
       
   134 
       
   135     result=SendReceive(EHRCreate,TIpcArgs(KAfInet, KProtocolInetUdp, 0, &session));
       
   136     if(result != KErrNone) return result;
       
   137 
       
   138 	iSSRes = session();
       
   139 
       
   140     return result;
       
   141 }
       
   142 
       
   143 //------------------------------------------------------------------------------------------------------
       
   144 // testing
       
   145 // EHRCreateWithConnection
       
   146 // Requires alive connection. Uses Ethernet one
       
   147 //------------------------------------------------------------------------------------------------------
       
   148 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRCreateWithConnection>)
       
   149 {
       
   150 	TInt result;
       
   151 
       
   152     //-- 1. Create and start a connection.
       
   153     result = CreateStartDefaultConnection();
       
   154     if(result != KErrNone)
       
   155         return result;
       
   156 
       
   157     TNifProgressBuf nifProgrBuf;
       
   158     TRequestStatus  rqStat;
       
   159     const TSubConnectionUniqueId subConnId = 1;
       
   160 
       
   161     //-- subscribe to the progress notification
       
   162     SendReceive(ESCPSProgressNotification,TIpcArgs(subConnId, &nifProgrBuf, KConnProgressDefault, iSSRef), rqStat);
       
   163     result = rqStat.Int();
       
   164     if((result != KErrNone) && (result != KRequestPending))
       
   165         return result;
       
   166 
       
   167     TPckgBuf<TInt> session(iSSRes);
       
   168 
       
   169     //-- now cancel the progress notification
       
   170     result = SendReceive(EHRCreateWithConnection,TIpcArgs(KAfInet, KProtocolInetUdp, iSSRef, &session));
       
   171     iSSRes = session();
       
   172 
       
   173     //-- stop and close connection
       
   174     StopCloseConnection();
       
   175     return result;
       
   176 }
       
   177 
       
   178 //------------------------------------------------------------------------------------------------------
       
   179 // testing
       
   180 // EHRGetByName
       
   181 // Requires alive connection. Uses Ethernet one
       
   182 //------------------------------------------------------------------------------------------------------
       
   183 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRGetByName>)
       
   184 {
       
   185 	TInt result;
       
   186 
       
   187     //-- 1. Create and start a connection.
       
   188     result = CreateStartDefaultConnection();
       
   189     if(result != KErrNone)
       
   190         return result;
       
   191 
       
   192 
       
   193 	result = OpenHostResolver();
       
   194     if(result != KErrNone)
       
   195     {
       
   196     //-- stop and close connection
       
   197     StopCloseConnection();
       
   198     return result;
       
   199     }
       
   200 
       
   201 
       
   202 	_LIT(KName, "www.yahoo.com");
       
   203 	TBufC<20> aName(KName);
       
   204 
       
   205     TNameEntry aResult;
       
   206 
       
   207 	result = SendReceive(EHRGetByName,TIpcArgs(&aName,&aResult,0, iSSRes));
       
   208 
       
   209     if(result != KErrNone) return result;
       
   210 
       
   211     //-- stop and close connection
       
   212     StopCloseConnection();
       
   213 
       
   214     return result;
       
   215 }
       
   216 
       
   217 
       
   218 //------------------------------------------------------------------------------------------------------
       
   219 // testing
       
   220 // EHRNext
       
   221 // Requires alive connection. Uses Ethernet one
       
   222 //------------------------------------------------------------------------------------------------------
       
   223 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRNext>)
       
   224 {
       
   225 	TInt result;
       
   226 
       
   227     //-- 1. Create and start a connection.
       
   228     result = CreateStartDefaultConnection();
       
   229     if(result != KErrNone)
       
   230         return result;
       
   231 
       
   232 
       
   233 	result = OpenHostResolver();
       
   234     if(result != KErrNone)
       
   235     {
       
   236     //-- stop and close connection
       
   237     StopCloseConnection();
       
   238     return result;
       
   239     }
       
   240 
       
   241 	_LIT(KName, "www.yahoo.com");
       
   242 	TBufC<20> aName(KName);
       
   243 
       
   244     TNameEntry aResult;
       
   245 
       
   246 	result = SendReceive(EHRGetByName,TIpcArgs(&aName,&aResult,0, iSSRes));
       
   247 
       
   248 	result = SendReceive(EHRNext,TIpcArgs(0,&aResult,0,iSSRes));
       
   249 
       
   250     if(result != KErrNone) return result;
       
   251 
       
   252     //-- stop and close connection
       
   253     StopCloseConnection();
       
   254 
       
   255     return result;
       
   256 }
       
   257 
       
   258 //------------------------------------------------------------------------------------------------------
       
   259 // testing
       
   260 // EHRGetByAddress
       
   261 // Requires alive connection. Uses Ethernet one
       
   262 //------------------------------------------------------------------------------------------------------
       
   263 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRGetByAddress>)
       
   264 {
       
   265     TInt result;
       
   266 
       
   267 
       
   268     //-- 1. Create  a connection.
       
   269 
       
   270 	result = OpenHostResolver();
       
   271     if(result != KErrNone)
       
   272     {
       
   273     //-- close connection
       
   274     SendReceive(EHRClose,TIpcArgs(0,0,0,iSSRes));
       
   275     return result;
       
   276     }
       
   277 
       
   278 	_LIT(KName, "127.0.0.1");
       
   279 	TBufC<20> aName(KName);
       
   280 
       
   281     TInetAddr addr;
       
   282     addr.Input(aName);
       
   283     TNameEntry aResult;
       
   284 
       
   285     result =SendReceive(EHRGetByAddress,TIpcArgs(&addr,&aResult,0, iSSRes));
       
   286     if(result != KErrNone)
       
   287         return result;
       
   288 
       
   289     //-- stop  connection
       
   290     result = SendReceive(EHRClose,TIpcArgs(0,0,0,iSSRes));
       
   291 
       
   292     return result;
       
   293 }
       
   294 
       
   295 //------------------------------------------------------------------------------------------------------
       
   296 // testing
       
   297 // EHRGetHostName
       
   298 // Requires alive connection. Uses Ethernet one
       
   299 //------------------------------------------------------------------------------------------------------
       
   300 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRGetHostName>)
       
   301 {
       
   302     TInt result;
       
   303 
       
   304     //-- 1. Create and start a connection.
       
   305 
       
   306 
       
   307 
       
   308 
       
   309 	result = OpenHostResolver();
       
   310     if(result != KErrNone)
       
   311     {
       
   312     //-- stop and close connection
       
   313     SendReceive(EHRClose,TIpcArgs(0,0,0,iSSRes));
       
   314     return result;
       
   315     }
       
   316 
       
   317     THostName aResult;
       
   318 
       
   319     result =SendReceive(EHRGetHostName,TIpcArgs(&aResult,0,0,iSSRes));
       
   320     if(result != KErrNone)
       
   321         return result;
       
   322 
       
   323     //-- stop and close connection
       
   324     result = SendReceive(EHRClose,TIpcArgs(0,0,0,iSSRes));
       
   325 
       
   326     return result;
       
   327 }
       
   328 
       
   329 //------------------------------------------------------------------------------------------------------
       
   330 // testing
       
   331 // EHRSetHostName
       
   332 // Requires alive connection. Uses Ethernet one
       
   333 //------------------------------------------------------------------------------------------------------
       
   334 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRSetHostName>)
       
   335 {
       
   336     TInt result;
       
   337 
       
   338     //-- 1. Create and start a connection.
       
   339     result = CreateStartDefaultConnection();
       
   340     if(result != KErrNone)
       
   341         return result;
       
   342 
       
   343     result = OpenHostResolver();
       
   344     if(result != KErrNone)
       
   345     {
       
   346     //-- stop and close connection
       
   347     StopCloseConnection();
       
   348     return result;
       
   349     }
       
   350 
       
   351     _LIT(KName, "localhost");
       
   352 	TBufC<20> aName(KName);
       
   353 
       
   354 
       
   355     result =SendReceive(EHRSetHostName,TIpcArgs(&aName,0,0,iSSRes));
       
   356     if(result != KErrNotSupported)
       
   357         return result;
       
   358 
       
   359     //-- stop and close connection
       
   360     result = StopCloseConnection();
       
   361 
       
   362     return result;
       
   363 }
       
   364 
       
   365 
       
   366 //------------------------------------------------------------------------------------------------------
       
   367 // testing
       
   368 // EHRCancel
       
   369 //------------------------------------------------------------------------------------------------------
       
   370 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRCancel>)
       
   371 {
       
   372     TInt result;
       
   373 
       
   374     //-- 1. Create a connection.
       
   375     result = CreateConnection();
       
   376     if(result != KErrNone)
       
   377         return result;
       
   378 
       
   379     result = OpenHostResolver();
       
   380     if(result != KErrNone)
       
   381     {
       
   382     //-- stop and close connection
       
   383     StopCloseConnection();
       
   384     return result;
       
   385     }
       
   386 
       
   387 	_LIT(KName, "www.yahoo.com");
       
   388 	TBufC<20> aName(KName);
       
   389 
       
   390     TNameEntry aResult;
       
   391 
       
   392 	result = SendReceive(EHRGetByName,TIpcArgs(&aName,&aResult,0, iSSRes));
       
   393 
       
   394     result =SendReceive(EHRCancel,TIpcArgs(0,0,0,iSSRes));
       
   395     if(result != KErrNone)
       
   396         return result;
       
   397 
       
   398     //-- stop and close connection
       
   399     result = StopCloseConnection();
       
   400 
       
   401     return result;
       
   402 }
       
   403 
       
   404 //------------------------------------------------------------------------------------------------------
       
   405 // testing
       
   406 // EHRClose
       
   407 //------------------------------------------------------------------------------------------------------
       
   408 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHRClose>)
       
   409 {
       
   410     TInt result;
       
   411 
       
   412     //-- 1. Create a connection.
       
   413     result = CreateConnection();
       
   414     if(result != KErrNone)
       
   415         return result;
       
   416 
       
   417     result = OpenHostResolver();
       
   418     if(result != KErrNone)
       
   419     {
       
   420     //-- stop and close connection
       
   421     StopCloseConnection();
       
   422     return result;
       
   423     }
       
   424 
       
   425     result =SendReceive(EHRClose,TIpcArgs(0, 0, 0, iSSRes));
       
   426     if(result != KErrNone)
       
   427         return result;
       
   428 
       
   429     //-- close connection
       
   430     result = CloseConnection();
       
   431 
       
   432     return result;
       
   433 }
       
   434 
       
   435 
       
   436 //------------------------------------------------------------------------------------------------------
       
   437 // testing
       
   438 // EHrQuery
       
   439 //------------------------------------------------------------------------------------------------------
       
   440 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHrQuery>)
       
   441 {
       
   442     TInt result;
       
   443 
       
   444     //-- 1. Create a connection.
       
   445     result = CreateConnection();
       
   446     if(result != KErrNone)
       
   447         return result;
       
   448 
       
   449     result = OpenHostResolver();
       
   450     if(result != KErrNone)
       
   451     {
       
   452     //-- stop and close connection
       
   453     StopCloseConnection();
       
   454     return result;
       
   455     }
       
   456 
       
   457     TDnsQueryBuf      dnsQryBuf;
       
   458     TDnsRespABuf      dnsRespABuf;
       
   459 
       
   460     dnsQryBuf().SetType(KDnsRRTypeA);
       
   461     dnsQryBuf().SetData(_L8("http://www.sample.net/"));
       
   462 
       
   463 
       
   464     TName connName;
       
   465     result =SendReceive(EHrQuery,TIpcArgs(&dnsQryBuf,&dnsRespABuf,0,iSSRes));
       
   466     if(result != KErrNone)
       
   467         return result;
       
   468 
       
   469     //-- close connection
       
   470     result = CloseConnection();
       
   471 
       
   472     return result;
       
   473 }
       
   474 
       
   475 
       
   476 //------------------------------------------------------------------------------------------------------
       
   477 // testing
       
   478 // EHrQueryNext
       
   479 //------------------------------------------------------------------------------------------------------
       
   480 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<EHrQueryNext>)
       
   481 {
       
   482     TInt result;
       
   483 
       
   484     //-- 1. Create a connection.
       
   485     result = CreateConnection();
       
   486     if(result != KErrNone)
       
   487         return result;
       
   488 
       
   489     result = OpenHostResolver();
       
   490     if(result != KErrNone)
       
   491     {
       
   492     //-- stop and close connection
       
   493     StopCloseConnection();
       
   494     return result;
       
   495     }
       
   496 
       
   497     TDnsQueryBuf      dnsQryBuf;
       
   498     TDnsRespABuf      dnsRespABuf;
       
   499 
       
   500     dnsQryBuf().SetType(KDnsRRTypeA);
       
   501     dnsQryBuf().SetData(_L8("http://www.sample.net/"));
       
   502 
       
   503     result =SendReceive(EHrQuery,TIpcArgs(&dnsQryBuf,&dnsRespABuf,0,iSSRes));
       
   504     if(result != KErrNone)
       
   505         return result;
       
   506 
       
   507     result =SendReceive(EHrQueryNext,TIpcArgs(&dnsRespABuf,0,0,iSSRes));
       
   508     if(result != KErrNone)
       
   509         return result;
       
   510 
       
   511     //-- close connection
       
   512     result = CloseConnection();
       
   513 
       
   514     return result;
       
   515 }
       
   516 
       
   517 
       
   518 //------------------------------------------------------------------------------------------------------
       
   519 // testing
       
   520 // ESSInstallExtension
       
   521 //------------------------------------------------------------------------------------------------------
       
   522 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSInstallExtension>)
       
   523 {
       
   524     TInt result;
       
   525 
       
   526     //-- 1. Create and start a connection.
       
   527     result = CreateConnection();
       
   528     if(result != KErrNone)
       
   529         return result;
       
   530 
       
   531 	// bad extension args to pass to SS
       
   532 	_LIT(KBadExtensionName, "bad extension");
       
   533 	_LIT(KBadArguments, "bad Arguments");
       
   534 	TPtrC aArgs(KBadArguments);
       
   535 	result=SendReceive(ESSInstallExtension,TIpcArgs(&KBadExtensionName,&aArgs,aArgs.Length(),iSSRes));
       
   536 
       
   537 	// The API is current unsupported so we are expecting to see KErrNotSupported as a result.
       
   538     if(result != KErrNotSupported)
       
   539         return result;
       
   540 
       
   541     //-- stop and close connection
       
   542     StopCloseConnection();
       
   543 
       
   544     return KErrNone;
       
   545 }
       
   546 
       
   547 //------------------------------------------------------------------------------------------------------
       
   548 // testing
       
   549 // ESSNumProtocols
       
   550 //------------------------------------------------------------------------------------------------------
       
   551 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSNumProtocols>)
       
   552 {
       
   553     TInt result;
       
   554 
       
   555     //-- 1. Create and start a connection.
       
   556     result = CreateConnection();
       
   557     if(result != KErrNone)
       
   558         return result;
       
   559 
       
   560     TUint count;
       
   561 	TPtr8 n((TUint8 *)&count,sizeof(count));
       
   562 
       
   563     result = SendReceive(ESSNumProtocols,TIpcArgs(&n,0,0,iSSRes));
       
   564     if(result != KErrNone)
       
   565         return result;
       
   566 
       
   567     //-- stop and close connection
       
   568     StopCloseConnection();
       
   569 
       
   570     return KErrNone;
       
   571 }
       
   572 
       
   573 //------------------------------------------------------------------------------------------------------
       
   574 // testing
       
   575 // ESSProtocolInfo
       
   576 //------------------------------------------------------------------------------------------------------
       
   577 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSProtocolInfo>)
       
   578 {
       
   579     TInt result;
       
   580 
       
   581     //-- 1. Create and start a connection.
       
   582     result = CreateConnection();
       
   583     if(result != KErrNone)
       
   584         return result;
       
   585 
       
   586 	TUint index=1;
       
   587 	TProtocolDesc protoInfo;
       
   588 	TPckg<TProtocolDesc> protDesc(protoInfo);
       
   589     result = SendReceive(ESSProtocolInfo,TIpcArgs(&protDesc,index,0,iSSRes));
       
   590     if(result != KErrNone)
       
   591         return result;
       
   592 
       
   593     //-- stop and close connection
       
   594     StopCloseConnection();
       
   595 
       
   596     return KErrNone;
       
   597 }
       
   598 
       
   599 //------------------------------------------------------------------------------------------------------
       
   600 // testing
       
   601 // ESSProtocolInfoByName
       
   602 //------------------------------------------------------------------------------------------------------
       
   603 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSProtocolInfoByName>)
       
   604 {
       
   605     TInt result;
       
   606 
       
   607     //-- 1. Create and start a connection.
       
   608     result = CreateConnection();
       
   609     if(result != KErrNone)
       
   610         return result;
       
   611 
       
   612 	const TDesC& protName = _L("tcp");
       
   613 	TProtocolDesc protoInfo;
       
   614 	TPckg<TProtocolDesc> protDesc(protoInfo);
       
   615     result = SendReceive(ESSProtocolInfoByName,TIpcArgs(&protDesc,&protName,0,iSSRes));
       
   616     if(result != KErrNone)
       
   617         return result;
       
   618 
       
   619     //-- stop and close connection
       
   620     StopCloseConnection();
       
   621 
       
   622     return KErrNone;
       
   623 }
       
   624 
       
   625 //------------------------------------------------------------------------------------------------------
       
   626 // testing
       
   627 // ESSProtocolInfoByName
       
   628 //------------------------------------------------------------------------------------------------------
       
   629 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSProtocolStart>)
       
   630 {
       
   631     TInt result;
       
   632 
       
   633     //-- 1. Create and start a connection.
       
   634     result = CreateConnection();
       
   635     if(result != KErrNone)
       
   636         return result;
       
   637 
       
   638 	result = SendReceive(ESSProtocolStart,TIpcArgs(KAfInet,KSockDatagram,KProtocolInetUdp,iSSRes));
       
   639 
       
   640     if(result != KErrNone)
       
   641         return result;
       
   642 
       
   643     //-- stop and close connection
       
   644     StopCloseConnection();
       
   645 
       
   646     return KErrNone;
       
   647 }
       
   648 
       
   649 //------------------------------------------------------------------------------------------------------
       
   650 // testing
       
   651 // ESSProtocolStop
       
   652 //------------------------------------------------------------------------------------------------------
       
   653 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSProtocolStop>)
       
   654 {
       
   655     TInt result;
       
   656 
       
   657     //-- 1. Create and start a connection.
       
   658     result = CreateConnection();
       
   659     if(result != KErrNone)
       
   660         return result;
       
   661 
       
   662 	result = SendReceive(ESSProtocolStop,TIpcArgs(KAfInet,KSockDatagram,KProtocolInetUdp,iSSRes));
       
   663 
       
   664     if(result != KErrNone)
       
   665         return result;
       
   666 
       
   667     //-- stop and close connection
       
   668     StopCloseConnection();
       
   669 
       
   670     return KErrNone;
       
   671 }
       
   672 
       
   673 //------------------------------------------------------------------------------------------------------
       
   674 // testing
       
   675 // ESSProtocolStop
       
   676 //------------------------------------------------------------------------------------------------------
       
   677 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSExclusiveMode>)
       
   678 {
       
   679     TInt result;
       
   680 
       
   681     //-- 1. Create and start a connection.
       
   682     result = CreateConnection();
       
   683     if(result != KErrNone)
       
   684         return result;
       
   685 
       
   686 	result = SendReceive(ESSExclusiveMode,TIpcArgs(0,0,0,iSSRes));
       
   687 
       
   688     if(result != KErrNone)
       
   689         return result;
       
   690 
       
   691     //-- stop and close connection
       
   692     StopCloseConnection();
       
   693 
       
   694     return KErrNone;
       
   695 }
       
   696 
       
   697 //------------------------------------------------------------------------------------------------------
       
   698 // testing
       
   699 // ESSProtocolStop
       
   700 //------------------------------------------------------------------------------------------------------
       
   701 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSClearExclusiveMode>)
       
   702 {
       
   703     TInt result;
       
   704 
       
   705     //-- 1. Create and start a connection.
       
   706     result = CreateConnection();
       
   707     if(result != KErrNone)
       
   708         return result;
       
   709 
       
   710 	result = SendReceive(ESSClearExclusiveMode,TIpcArgs(0,0,0,iSSRes));
       
   711 
       
   712     if(result != KErrNone)
       
   713         return result;
       
   714 
       
   715     //-- stop and close connection
       
   716     StopCloseConnection();
       
   717 
       
   718     return KErrNone;
       
   719 }
       
   720 
       
   721 //------------------------------------------------------------------------------------------------------
       
   722 // testing
       
   723 // ESRCreate
       
   724 //------------------------------------------------------------------------------------------------------
       
   725 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESRCreate>)
       
   726 {
       
   727     TInt result;
       
   728 
       
   729     TPckgBuf<TInt> session(iSSRes);
       
   730 
       
   731     result=SendReceive(ESRCreate,TIpcArgs(KAfInet, KProtocolInetUdp, 0, &session));
       
   732     if(result != KErrNone) return result;
       
   733 
       
   734 	iSSRes = session();
       
   735 
       
   736     return result;
       
   737 }
       
   738 
       
   739 //------------------------------------------------------------------------------------------------------
       
   740 // testing
       
   741 // ESRGetByName
       
   742 //------------------------------------------------------------------------------------------------------
       
   743 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESRGetByName>)
       
   744 {
       
   745     TInt result;
       
   746 
       
   747     //-- 1. Create and start a connection.
       
   748     result = CreateStartDefaultConnection();
       
   749     if(result != KErrNone)
       
   750         return result;
       
   751 
       
   752 
       
   753 	result = OpenServiceResolver();
       
   754     if(result != KErrNone)
       
   755     {
       
   756     //-- stop and close connection
       
   757     StopCloseConnection();
       
   758     return result;
       
   759     }
       
   760 
       
   761 	// "echo" service is on port 7, or we could try "http" on port 80.
       
   762 	_LIT(KName, "echo");
       
   763 	TBufC<20> aName(KName);
       
   764 
       
   765     TNameEntry aResult;
       
   766 
       
   767 	result = SendReceive(ESRGetByName,TIpcArgs(&aName,&aResult,0, iSSRes));
       
   768 
       
   769     if(result != KErrNone) return result;
       
   770 
       
   771     //-- stop and close connection
       
   772     StopCloseConnection();
       
   773 
       
   774     return result;
       
   775 }
       
   776 
       
   777 //------------------------------------------------------------------------------------------------------
       
   778 // testing
       
   779 // ESRGetByNumber
       
   780 //------------------------------------------------------------------------------------------------------
       
   781 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESRGetByNumber>)
       
   782 {
       
   783     TInt result;
       
   784 
       
   785     //-- 1. Create and start a connection.
       
   786     result = CreateStartDefaultConnection();
       
   787     if(result != KErrNone)
       
   788         return result;
       
   789 
       
   790 
       
   791 	result = OpenServiceResolver();
       
   792     if(result != KErrNone)
       
   793     {
       
   794     //-- stop and close connection
       
   795     StopCloseConnection();
       
   796     return result;
       
   797     }
       
   798 
       
   799 	// "echo" service is on port 7, or we could try "http" on port 80.
       
   800 	TUint aPort = 7;
       
   801     TNameEntry aName;
       
   802 
       
   803 	result = SendReceive(ESRGetByNumber,TIpcArgs(&aName,aPort,0, iSSRes));
       
   804 
       
   805     if(result != KErrNone) return result;
       
   806 
       
   807     //-- stop and close connection
       
   808     StopCloseConnection();
       
   809 
       
   810     return result;
       
   811 }
       
   812 
       
   813 //------------------------------------------------------------------------------------------------------
       
   814 // testing
       
   815 // ESRRegisterService
       
   816 //------------------------------------------------------------------------------------------------------
       
   817 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESRRegisterService>)
       
   818 {
       
   819     TInt result;
       
   820 
       
   821     //-- 1. Create and start a connection.
       
   822     result = CreateStartDefaultConnection();
       
   823     if(result != KErrNone)
       
   824         return result;
       
   825 
       
   826 
       
   827 	result = OpenServiceResolver();
       
   828     if(result != KErrNone)
       
   829     {
       
   830     //-- stop and close connection
       
   831     StopCloseConnection();
       
   832     return result;
       
   833     }
       
   834 
       
   835 	// "echo" service is on port 7, or we could try "http" on port 80.
       
   836 	TUint aPort = 7;
       
   837 	_LIT(KName, "echo");
       
   838 	TBufC<20> aName(KName);
       
   839 
       
   840 	result = SendReceive(ESRRegisterService,TIpcArgs(&aName,aPort,0, iSSRes));
       
   841 
       
   842     if(result != KErrNone) return result;
       
   843 
       
   844     //-- stop and close connection
       
   845     StopCloseConnection();
       
   846 
       
   847     return result;
       
   848 }
       
   849 
       
   850 //------------------------------------------------------------------------------------------------------
       
   851 // testing
       
   852 // ESRRemoveService
       
   853 //------------------------------------------------------------------------------------------------------
       
   854 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESRRemoveService>)
       
   855 {
       
   856     TInt result;
       
   857 
       
   858     //-- 1. Create and start a connection.
       
   859     result = CreateStartDefaultConnection();
       
   860     if(result != KErrNone)
       
   861         return result;
       
   862 
       
   863 	result = OpenServiceResolver();
       
   864     if(result != KErrNone)
       
   865     {
       
   866     //-- stop and close connection
       
   867     StopCloseConnection();
       
   868     return result;
       
   869     }
       
   870 
       
   871 	// "echo" service is on port 7, or we could try "http" on port 80.
       
   872 	TUint aPort = 7;
       
   873 	_LIT(KName, "echo");
       
   874 	TBufC<20> aName(KName);
       
   875 
       
   876 	result = SendReceive(ESRRemoveService,TIpcArgs(&aName,aPort,0, iSSRes));
       
   877 
       
   878     if(result != KErrNone) return result;
       
   879 
       
   880     //-- stop and close connection
       
   881     StopCloseConnection();
       
   882 
       
   883     return result;
       
   884 }
       
   885 
       
   886 //------------------------------------------------------------------------------------------------------
       
   887 // testing
       
   888 // ESRCancel
       
   889 //------------------------------------------------------------------------------------------------------
       
   890 TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESRClose>)
       
   891 {
       
   892     TInt result;
       
   893 
       
   894     //-- 1. Create a connection.
       
   895     result = CreateConnection();
       
   896     if(result != KErrNone)
       
   897         return result;
       
   898 
       
   899 	result = OpenServiceResolver();
       
   900     if(result != KErrNone)
       
   901 		{
       
   902 		//-- stop and close connection
       
   903 		StopCloseConnection();
       
   904 		return result;
       
   905 		}
       
   906 
       
   907     result =SendReceive(ESRClose,TIpcArgs(0, 0, 0, iSSRes));
       
   908     if(result != KErrNone)
       
   909         return result;
       
   910 
       
   911     //-- close connection
       
   912     result = CloseConnection();
       
   913 
       
   914     return result;
       
   915 }
       
   916 
       
   917 //------------------------------------------------------------------------------------------------------
       
   918 
       
   919 TInt CPARAM_MESS_NAMEStep::test_KConnDisableTimers()
       
   920 {
       
   921     return ConnectionControl(KCOLProvider, KConnDisableTimers, 1);
       
   922 }
       
   923 
       
   924 TInt CPARAM_MESS_NAMEStep::test_KConnGetInterfaceName()
       
   925 {
       
   926     TConnInterfaceName name;
       
   927     name.iIndex = 1;
       
   928     TPckg<TConnInterfaceName> namePkg(name);
       
   929 
       
   930     return ConnectionControl(KCOLProvider, KConnGetInterfaceName, namePkg);
       
   931 }
       
   932 
       
   933 
       
   934 TInt CPARAM_MESS_NAMEStep::test_KCoEnumerateConnectionClients()
       
   935 {
       
   936     TConnEnumArgBuf connEnumBuf;
       
   937    	connEnumBuf().iIndex = 1;
       
   938     return  ConnectionControl(KCOLConnection, KCoEnumerateConnectionClients, connEnumBuf);
       
   939 }
       
   940 
       
   941 TInt CPARAM_MESS_NAMEStep::test_KCoGetConnectionClientInfo()
       
   942 {
       
   943     TConnGetClientInfoArgBuf  connCliInfoBuf;
       
   944     connCliInfoBuf().iIndex = 1;
       
   945     return ConnectionControl(KCOLConnection, KCoGetConnectionClientInfo, connCliInfoBuf);
       
   946 }
       
   947 
       
   948 TInt CPARAM_MESS_NAMEStep::test_KCoEnumerateConnectionSockets()
       
   949 {
       
   950     TConnEnumArgBuf connEnumBuf;
       
   951     connEnumBuf().iIndex = 1;
       
   952     return ConnectionControl(KCOLConnection, KCoEnumerateConnectionSockets, connEnumBuf);
       
   953 }
       
   954 
       
   955 TInt CPARAM_MESS_NAMEStep::test_KCoGetConnectionSocketInfo()
       
   956 {
       
   957     TConnGetSocketInfoArgBuf    connSockInfoBuf;
       
   958 
       
   959     connSockInfoBuf().iIndex = 1;
       
   960     TInt  result = ConnectionControl(KCOLConnection, KCoGetConnectionSocketInfo, connSockInfoBuf);
       
   961     if(result == KErrNotFound)
       
   962         result = KErrNone; //-- no sockets found, but this is a positive result anyway.
       
   963 
       
   964     return result;
       
   965 }
       
   966 
       
   967 TInt CPARAM_MESS_NAMEStep::test_KCOLInterface()
       
   968 {
       
   969 	TInt   value = 0;
       
   970     TPckg<TInt> valueBuf(value);
       
   971 
       
   972 	TInt nRes = ConnectionControl(KCOLInterface, 0, valueBuf);
       
   973     if(nRes == KErrNotSupported)
       
   974         nRes = KErrNone; //-- if thist option is not supported by nif and there is no capabilities conflict, then it's OK.
       
   975 
       
   976     return nRes;
       
   977 
       
   978 }
       
   979 
       
   980 TInt CPARAM_MESS_NAMEStep::test_KCOLAgent()
       
   981 {
       
   982 	TInt   value = 0;
       
   983     TPckg<TInt> valueBuf(value);
       
   984 
       
   985 	TInt nRes = ConnectionControl(KCOLAgent, 0, valueBuf);
       
   986     if(nRes == KErrNotSupported)
       
   987         nRes = KErrNone; //-- if thist option is not supported by nif and there is no capabilities conflict, then it's OK.
       
   988 
       
   989     return nRes;
       
   990 }
       
   991 
       
   992 //------------------------------------------------------------------------------------------------------
       
   993 
       
   994 /**
       
   995     Performing ECNControl actions.
       
   996 */
       
   997 TInt CPARAM_MESS_NAMEStep::ConnectionControl(TUint aOptionLevel, TUint aOptionName, TDes8& aOption)
       
   998 {
       
   999 	TSockOpt arg;
       
  1000 	arg.optionName = aOptionName;
       
  1001 	arg.optionVal = &aOption;	//Note that optionVal will be useless on the server side
       
  1002 	arg.optionLen = aOption.MaxLength();
       
  1003 	TPckgC<TSockOpt> buf(arg);
       
  1004 
       
  1005 	return SendReceive(ECNControl, TIpcArgs(&buf, aOptionLevel, &aOption,iSSRef ));
       
  1006 }
       
  1007 
       
  1008 
       
  1009 /**
       
  1010     Performing ECNControl actions.
       
  1011 */
       
  1012 TInt CPARAM_MESS_NAMEStep::ConnectionControl(TUint aOptionLevel, TUint aOptionName, TInt aOption)
       
  1013 {
       
  1014 	TPtr8 optionDes((TUint8*)&aOption, sizeof(TInt), sizeof(TInt));
       
  1015 	aOptionName &= ~KConnWriteUserDataBit;
       
  1016 	return ConnectionControl(aOptionLevel, aOptionName, optionDes);
       
  1017 
       
  1018 }
       
  1019 
       
  1020 
       
  1021 
       
  1022 /**
       
  1023     Create a connection.
       
  1024 */
       
  1025 TInt CPARAM_MESS_NAMEStep::CreateConnection()
       
  1026 {
       
  1027     TInt result;
       
  1028 
       
  1029     //-- 1. Create (Open) a connection
       
  1030     const TUint KConnectionType = KAfInet;
       
  1031     TPckgBuf<TInt> session(iSSRef);
       
  1032 
       
  1033     result = SendReceive(ECNCreate,TIpcArgs(KConnectionType, 0, 0, &session));
       
  1034     iSSRef = session(); //-- this is the esock subsession handle
       
  1035 
       
  1036     return result;
       
  1037 }
       
  1038 
       
  1039 
       
  1040 /**
       
  1041     Create and start a default connection
       
  1042     Also enumerates existing connections.
       
  1043 */
       
  1044 TInt CPARAM_MESS_NAMEStep::CreateStartDefaultConnection()
       
  1045 {
       
  1046     TInt result;
       
  1047 
       
  1048     //-- 1. Create (Open) a connection
       
  1049     result = CreateConnection();
       
  1050 
       
  1051     if(result != KErrNone)
       
  1052         return result;
       
  1053 
       
  1054     //-- 2. start the connection
       
  1055     result = SendReceive(ECNStart,TIpcArgs(0,0,0,iSSRef));
       
  1056     if(result != KErrNone)
       
  1057         return result;
       
  1058 
       
  1059 
       
  1060     //-- 3. Enumerate connections, necessarily for further activity (e.g. KCoGetConnectionSocketInfo)
       
  1061     //-- and anyway we need to test it.
       
  1062     TUint cntConn = 0;
       
  1063    	TPckg<TUint> count(cntConn);
       
  1064    	result =SendReceive(ECNEnumerateConnections, TIpcArgs(&count,0,0,iSSRef));
       
  1065 
       
  1066     return result;
       
  1067 }
       
  1068 
       
  1069 
       
  1070 /**
       
  1071 Stops and closes the active connection
       
  1072 */
       
  1073 TInt CPARAM_MESS_NAMEStep::StopCloseConnection()
       
  1074 {
       
  1075     TInt result;
       
  1076 
       
  1077     result = SendReceive(ECNStop,TIpcArgs(RConnection::EStopAuthoritative,0,0,iSSRef));
       
  1078     if(result != KErrNone)
       
  1079            return result;
       
  1080 
       
  1081     return CloseConnection();
       
  1082 }
       
  1083 
       
  1084 /**
       
  1085     Close the connection
       
  1086 */
       
  1087 TInt CPARAM_MESS_NAMEStep::CloseConnection()
       
  1088 {
       
  1089     TInt result;
       
  1090 
       
  1091     //-- close the connection
       
  1092     result = SendReceive(ECNClose,TIpcArgs(0,0,0,iSSRef));
       
  1093 
       
  1094     return result;
       
  1095 }
       
  1096 
       
  1097 //------------------------------------------------------------------------------------------------------
       
  1098 
       
  1099 /**
       
  1100   Test DHCP server API policing.
       
  1101   Connects to the DHCP server (which is supposed to be started by opening a Ethernet-oriented connection).
       
  1102   Then tries to perform IOCTL calls, expecting KErrPermissionDenied.
       
  1103 
       
  1104   @return standard error code.
       
  1105 */
       
  1106 TInt CPARAM_MESS_NAMEStep::test_RConfigDaemon()
       
  1107 {
       
  1108     TInt result = KErrNone;
       
  1109 
       
  1110     /**
       
  1111     define a local class to talk to the DHCP daemon. We need this becase
       
  1112     files like \networking\dhcp\include\DHCP_Std.h are not exported.
       
  1113     This class represents RConfigDaemon functionality and makes sense only within this function scope.
       
  1114     */
       
  1115     class RTestDaemonClient : public RSessionBase
       
  1116 	{
       
  1117     public:
       
  1118     	/**
       
  1119     	Create a session to the DHCP server. beware: we had to use local definition of the KDHCPServerName because
       
  1120     	DHCP_Std.h isn't accessible here
       
  1121 
       
  1122     	@return standard error code.
       
  1123     	*/
       
  1124     	TInt CreateSession()
       
  1125     	{
       
  1126     	    _LIT(KDHCPServerName,"!DHCPServ"); // ugly!
       
  1127     	    return RSessionBase::CreateSession(KDHCPServerName, TVersion());
       
  1128     	}
       
  1129 
       
  1130     	/**
       
  1131     	Configure DHCP server. We need this for IOCTL calls.
       
  1132     	@param aStatus  request status
       
  1133     	@param apDes    pointer to the TConnectionInfoBuf with connection properties.
       
  1134     	*/
       
  1135     	void Configure(TRequestStatus& aStatus, TDes8* apDes)
       
  1136     	{
       
  1137     	    SendReceive(EConfigDaemonConfigure, TIpcArgs(apDes, 0, 0, 0), aStatus);
       
  1138     	}
       
  1139 
       
  1140     	/**
       
  1141     	IOCTL call to the DHCP server.
       
  1142     	@param aOptionLevel Option level
       
  1143     	@param aOptionName  Option Name
       
  1144     	@param aStatus      request status
       
  1145     	@param apDes        pointer to the packaged IOCTL data descriptor
       
  1146     	*/
       
  1147     	void Ioctl(TUint aOptionLevel, TUint aOptionName, TRequestStatus& aStatus, TDes8* apDes=NULL)
       
  1148     	{
       
  1149     	    SendReceive(EConfigDaemonIoctl, TIpcArgs(aOptionLevel, aOptionName, apDes, apDes ? apDes->MaxLength() : 0), aStatus);
       
  1150     	}
       
  1151 
       
  1152 	}; //RTestDaemonClient
       
  1153 
       
  1154     //-- get connection info to configure DHCP daemon later
       
  1155     TConnectionInfoBuf connInfoBuf;
       
  1156     //TConnectionInfo &ci = connInfoBuf();
       
  1157     result =SendReceive(ECNGetConnectionInfo,TIpcArgs(1, &connInfoBuf, 0, iSSRef));
       
  1158     if(result != KErrNone)
       
  1159         return result;
       
  1160 
       
  1161 
       
  1162     RTestDaemonClient   testDaemon;
       
  1163     TRequestStatus      rqStat;
       
  1164 
       
  1165     //-- create session to the DHCP server
       
  1166     result = testDaemon.CreateSession();
       
  1167     if(result != KErrNone)
       
  1168         return result;
       
  1169 
       
  1170     //-- configure DHCP server
       
  1171     testDaemon.Configure(rqStat, &connInfoBuf);
       
  1172     User::WaitForRequest(rqStat);
       
  1173     result = rqStat.Int();
       
  1174     if(result != KErrNone)
       
  1175         return result;
       
  1176 
       
  1177     //-- test DHCP daemon IOCTL calls.
       
  1178     //-- The expected result is KErrPermissionDenied (after DHCP daemon calls are policed).
       
  1179     const TInt KExpectedResult = KErrPermissionDenied;
       
  1180 
       
  1181 
       
  1182     TConnectionAddrBuf connAddrBuf;
       
  1183     //TConnectionAddress &connAddr = connAddrBuf();
       
  1184 
       
  1185     //--
       
  1186     testDaemon.Ioctl(KCOLConfiguration, KConnGetCurrentAddr, rqStat, &connAddrBuf);
       
  1187     User::WaitForRequest(rqStat);
       
  1188     result = rqStat.Int();
       
  1189     if(result != KExpectedResult)
       
  1190         return KErrGeneral;
       
  1191     //--
       
  1192     testDaemon.Ioctl(KCOLConfiguration, KConnGetServerAddr, rqStat, &connAddrBuf);
       
  1193     User::WaitForRequest(rqStat);
       
  1194     result = rqStat.Int();
       
  1195     if(result != KExpectedResult)
       
  1196         return KErrGeneral;
       
  1197     //--
       
  1198     testDaemon.Ioctl(KCOLConfiguration, KConnGetAddrLeaseTimeRemain, rqStat, &connAddrBuf);
       
  1199     User::WaitForRequest(rqStat);
       
  1200     result = rqStat.Int();
       
  1201     if(result != KExpectedResult)
       
  1202         return KErrGeneral;
       
  1203     //--
       
  1204     testDaemon.Ioctl(KCOLConfiguration, KConnAddrRelease, rqStat, &connAddrBuf);
       
  1205     User::WaitForRequest(rqStat);
       
  1206     result = rqStat.Int();
       
  1207     if(result != KExpectedResult)
       
  1208         return KErrGeneral;
       
  1209     //--
       
  1210     testDaemon.Ioctl(KCOLConfiguration, KConnAddrRenew, rqStat, &connAddrBuf);
       
  1211     User::WaitForRequest(rqStat);
       
  1212     result = rqStat.Int();
       
  1213     if(result != KExpectedResult)
       
  1214         return KErrGeneral;
       
  1215 
       
  1216     //--
       
  1217     testDaemon.Ioctl(KCOLConfiguration, KConnGetDhcpRawOptionData, rqStat, &connAddrBuf);
       
  1218     User::WaitForRequest(rqStat);
       
  1219     result = rqStat.Int();
       
  1220     if(result != KExpectedResult)
       
  1221         return KErrGeneral;
       
  1222 
       
  1223 
       
  1224     return KErrNone;
       
  1225 }
       
  1226 
       
  1227 TInt CPARAM_MESS_NAMEStep::OpenHostResolver()
       
  1228 {
       
  1229     TInt result;
       
  1230 
       
  1231     TPckgBuf<TInt> session(iSSRes);
       
  1232 
       
  1233     result=SendReceive(EHRCreate,TIpcArgs(KAfInet, KProtocolInetUdp, 0, &session));
       
  1234     if(result != KErrNone) return result;
       
  1235 
       
  1236 	iSSRes = session();
       
  1237 
       
  1238     return result;
       
  1239 }
       
  1240 
       
  1241 //------------------------------------------------------------------------------------------------------
       
  1242 
       
  1243 TInt CPARAM_MESS_NAMEStep::OpenServiceResolver()
       
  1244 {
       
  1245     TInt result;
       
  1246 
       
  1247     TPckgBuf<TInt> session(iSSRes);
       
  1248 
       
  1249     result=SendReceive(ESRCreate,TIpcArgs(KAfInet, KProtocolInetUdp, 0, &session));
       
  1250     if(result != KErrNone) return result;
       
  1251 
       
  1252 	iSSRes = session();
       
  1253 
       
  1254     return result;
       
  1255 }
       
  1256 
       
  1257 //------------------------------------------------------------------------------------------------------
       
  1258 
       
  1259 
       
  1260 
       
  1261 
       
  1262 
       
  1263 
       
  1264 
       
  1265 
       
  1266