enum TVerdict CEsockTest9_4::easyTestStepL()
	{
	Logger().WriteFormat(_L("TE_ESock: test 9.4"));
	TESTL(EPass == TestStepResult());
	
	// ipv4
	// List Route(s)
	ListRoutes();
	
	// Add Route
	TInt ret = SetRoute(KSoInetAddRoute, IPADDR(10,158,7,52),IPADDR(255,0,0,0),IPADDR(10,158,7,73), IPADDR(127,0,0,1), 0);
	TESTEL(KErrNone == ret, ret);
	
	// List Route(s)
	ListRoutes();
	
	// Change Route
	ret = SetRoute(KSoInetChangeRoute, IPADDR(10,158,7,52),IPADDR(255,0,0,0),IPADDR(10,158,7,70), IPADDR(127,0,0,1), 0);
	TESTEL(KErrNotFound == ret, ret);
	
	// List Route(s)
	ListRoutes();
	
	return EPass;
	}
enum TVerdict CEsockTest9_3::easyTestStepL()
	{
	Logger().WriteFormat(_L("TE_ESock: test 9.3"));
	TESTL(EPass == TestStepResult());
	
	// ipv6
	// List Route(s)
	ListRoutes();
	
	TPckgBuf<TSoInetRouteInfo> opt;
	opt().iType = ERtUser;
	opt().iState = ERtReady;
	opt().iIfAddr.SetFamily(KAFUnspec);
	opt().iMetric = 1;
	(TInetAddr::Cast(opt().iIfAddr)).Input(_L("::1"));
	(TInetAddr::Cast(opt().iGateway)).Input(_L("fe80::dead:beef"));
	(TInetAddr::Cast(opt().iDstAddr)).Input(_L("2001:618:400:61::dead:fee"));
	(TInetAddr::Cast(opt().iNetMask)).Input(_L("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"));
	// Add Route
	TInt ret = iEsockSuite->GetSocketHandle(1).SetOpt(KSoInetAddRoute, KSolInetRtCtrl, opt);
	TESTEL(KErrNone == ret, ret);
	
	// List Route(s)
	ListRoutes();
	
	// Delete Route
	ret = iEsockSuite->GetSocketHandle(1).SetOpt(KSoInetDeleteRoute, KSolInetRtCtrl, opt);
	TESTEL(KErrNone == ret, ret);
	
	// List Route(s)
	ListRoutes();
	
	return EPass;
	}
Esempio n. 3
0
void DirControl::FindTargets(int directive)
{
	directives[directive].targets = 0;
	for (char j = 0; j < MAXMISSIONS; j++)
		directives[directive].missions[j].score = -1;

	switch	(directives[directive].type)
	{
		case SupplyTree::D_AIRSUPERIORITY:
		{
			maxscore[directive] = 0;
			directives[directive].targets = 1;
			break;													  //RDH 18/03/99
		}
		case SupplyTree::D_CHOKE:
		{
			maxscore[directive] = MAJ_TRAINSPERDAY*STORES_TRAIN;
			ListChokes(directive);
			break;
		}
		case SupplyTree::D_SUPPLY:
		{
			maxscore[directive] = STORES_MAXSUPPLY;
			ListSupplyNodes(directive);
			break;
		}
		case  SupplyTree::D_AIRFIELDS:
		{
			maxscore[directive] = 12;
			ListAirfields(directive);
			break;
		}
		case SupplyTree::D_RAIL:
		{
			maxscore[directive] = MAJ_TRAINSPERDAY*STORES_TRAIN;
			ListRoutes(directive, STORES_TRAIN);
			break;
		}
		case SupplyTree::D_ROAD:
		{
			maxscore[directive] = MAJ_TRUCKSPERDAY*STORES_TRAIN;
			ListRoutes(directive, STORES_TRUCK);
			break;
		}
		case SupplyTree::D_ARMY:
		{
			maxscore[directive] = 200;
			ListFrontLines(directive);
			break;
		}

	}
}
enum TVerdict CEsockTest9_1::easyTestStepL()
	{
	Logger().WriteFormat(_L("TE_ESock: Test 9.1"));
	
	// List Route(s)
	ListRoutes();
	
	return EPass;
	}