networkprotocols/tcpipv4v6prt/src/inet.cpp
branchRCL_3
changeset 21 abbed5a4b42a
parent 20 7e41d162e158
child 22 8d540f55e491
equal deleted inserted replaced
20:7e41d162e158 21:abbed5a4b42a
   358 	else if (aLevel == KSolInetIfCtrl)
   358 	else if (aLevel == KSolInetIfCtrl)
   359 		{
   359 		{
   360 		if (aName == STATIC_CAST(TUint, KSoInetEnumInterfaces))	// See *NOTE* above!
   360 		if (aName == STATIC_CAST(TUint, KSoInetEnumInterfaces))	// See *NOTE* above!
   361 			{
   361 			{
   362 			iInterfaceIndex = 0;
   362 			iInterfaceIndex = 0;
   363 			
       
   364 			LOG(Log::Printf(_L("SetOpt\t%S SAP[%u] KSoInetEnumInterfaces"), &ProtocolName(), (TInt)this));
   363 			LOG(Log::Printf(_L("SetOpt\t%S SAP[%u] KSoInetEnumInterfaces"), &ProtocolName(), (TInt)this));
   365 			return KErrNone;
       
   366 			}
       
   367 		if (aName == STATIC_CAST(TUint, KSoInetEnumDomainSuffix))	// See *NOTE* above!
       
   368 			{
       
   369 			iDomainSuffixIndex = 0;
       
   370 			
       
   371 			LOG(Log::Printf(_L("SetOpt\t%S SAP[%u] KSoInetEnumDomainSuffix"), &ProtocolName(), (TInt)this));
       
   372 			return KErrNone;
   364 			return KErrNone;
   373 			}
   365 			}
   374 		}
   366 		}
   375 	else if (aLevel == KSolInetRtCtrl)
   367 	else if (aLevel == KSolInetRtCtrl)
   376 		{
   368 		{
   425 		if (STATIC_CAST(TUint, aOption.MaxLength()) < sizeof(TSoInetInterfaceInfo))
   417 		if (STATIC_CAST(TUint, aOption.MaxLength()) < sizeof(TSoInetInterfaceInfo))
   426 			return KErrTooBig;
   418 			return KErrTooBig;
   427 		(void) new (&opt) TSoInetInterfaceInfo;	// Make sure descriptors are correct.
   419 		(void) new (&opt) TSoInetInterfaceInfo;	// Make sure descriptors are correct.
   428 		aOption.SetLength(sizeof(TSoInetInterfaceInfo));
   420 		aOption.SetLength(sizeof(TSoInetInterfaceInfo));
   429 		((CProviderInet6Base *)this)->iInterfaceIndex = iProtocol->Interfacer()->InterfaceInfo(iInterfaceIndex, opt);
   421 		((CProviderInet6Base *)this)->iInterfaceIndex = iProtocol->Interfacer()->InterfaceInfo(iInterfaceIndex, opt);
   430 		((CProviderInet6Base *)this)->iActiveEnumInterface.Copy(opt.iName);
       
   431 		
       
   432 		if (iInterfaceIndex > 0)
   422 		if (iInterfaceIndex > 0)
   433 			return KErrNone;
   423 			return KErrNone;
   434 		else
   424 		else
   435 			return KErrNotFound;
   425 			return KErrNotFound;
   436 		}
   426 		}
   437     else if (aLevel == KSolInetIfCtrl && aName == STATIC_CAST(TUint, KSoInetNextDomainSuffix))
       
   438         {
       
   439 		TInetSuffix& opt = *(TInetSuffix*)aOption.Ptr();
       
   440         if (STATIC_CAST(TUint, aOption.MaxLength()) < sizeof(TInetSuffix))
       
   441 			return KErrTooBig;
       
   442         (void) new (&opt) TInetSuffix; // Make sure descriptors are correct.
       
   443         aOption.SetLength(sizeof(TInetSuffix));
       
   444         ((CProviderInet6Base *)this)->iDomainSuffixIndex = iProtocol->Interfacer()->DomainSuffixInfo(iActiveEnumInterface, iDomainSuffixIndex, opt);
       
   445         
       
   446         if (iDomainSuffixIndex > 0)
       
   447             return KErrNone;
       
   448         else
       
   449             return KErrNotFound;
       
   450         }
       
   451 	else if (aLevel == KSolInetRtCtrl && aName == STATIC_CAST(TUint, KSoInetNextRoute))	// See *NOTE* above!
   427 	else if (aLevel == KSolInetRtCtrl && aName == STATIC_CAST(TUint, KSoInetNextRoute))	// See *NOTE* above!
   452 		{
   428 		{
   453 		TSoInetRouteInfo& opt = *(TSoInetRouteInfo*)aOption.Ptr();
   429 		TSoInetRouteInfo& opt = *(TSoInetRouteInfo*)aOption.Ptr();
   454 		if (STATIC_CAST(TUint, aOption.MaxLength()) < sizeof(TSoInetRouteInfo))
   430 		if (STATIC_CAST(TUint, aOption.MaxLength()) < sizeof(TSoInetRouteInfo))
   455 			return KErrTooBig;
   431 			return KErrTooBig;