void PortAliasesConfigurationDialog::sl_portDescriptionChanged(const QString &newStr) {
    Port *currentPort = portListMap.value(currentRow);
    PortInfo info = model.ports.value(currentPort);
    model.ports.insert(currentPort, PortInfo(info.first, newStr));
}
예제 #2
0
파일: Vlan.cpp 프로젝트: Gardenya/fboss
VlanFields::PortInfo
VlanFields::PortInfo::fromFollyDynamic(const folly::dynamic& json) {
  return PortInfo(json[kTagged].asBool());
}
void PortAliasesConfigurationDialog::sl_portAliasChanged(const QString &newStr) {
    Port *currentPort = portListMap.value(currentRow);
    PortInfo info = model.ports.value(currentPort);
    model.ports.insert(currentPort, PortInfo(newStr, info.second));
}
예제 #4
0
void CCommSession::ServiceL(const RMessage2& aMessage)
/**
 * Handle messages for this session.
 *
 * @param aMessage handle to the IPC message from the client
 */
	{
	C32LOG5(KC32Detail,_L8("CCommSession::ServiceL(), Session : 0x%x, IPC: %d (%S). Message: %08x"), this, aMessage.Function(), &TC32Log::C32RequestStr(aMessage.Function()),aMessage.Handle());
	iComplete = ETrue;
	const CC32WorkerThread& owner=C32WorkerThread();
	CC32Dealer& c32Dealer = owner.DealerByRef();

	if (c32Dealer.StartupFailed())
		{
		SafeComplete(aMessage, KErrNotReady);
		return;
		}

	// TestImmediateShutdownPresent is only set when EImmediate shutdown is present, which is
	// used only in testing phase.
	if(c32Dealer.TestImmediateShutdownPresent())
		{
		User::Leave(KErrServerTerminated);
		}

	if((aMessage.Function()==ECommOpen)
	   ||
	   (aMessage.Function()==ECommOpenWhenAvailable))
		{
		NewPortL(aMessage);
		return;
		}

#if defined (_DEBUG)
	switch (aMessage.Function())
		{
		case ECommDbgMarkHeap:
			__UHEAP_MARK;
			SafeComplete(aMessage, KErrNone);
			return;
		case ECommDbgCheckHeap:
			__UHEAP_CHECK(aMessage.Int0());
			SafeComplete(aMessage, KErrNone);
			return;
		case ECommDbgMarkEnd:
			__UHEAP_MARKENDC(aMessage.Int0());
			SafeComplete(aMessage, KErrNone);
			return;
		case ECommDbgFailNext:
  			// We set the fail point for all heaps, rather than just the current Dealer. This could lead to a failure not related
  			// directly to whatever the client test code is trying to exercise but it all helps find bugs
  			c32Dealer.SetFailNextForAllHeaps(aMessage.Int0());
			SafeComplete(aMessage, KErrNone);
			return;
		}
#endif


	switch ((aMessage.Function()))
		{
		case ECommLoadCommModule:
			{
			TFileName fullCSYFilename;
			TInt ret = Read(0,aMessage,fullCSYFilename);
			if (ret != KErrNone)
				{
				C32LOG2(KC32Warning, _L8("ServiceL: LoadCommModule  Read returned %d instead of KErrNone, cannot proceed"), ret);
				PanicClient(EBadDescriptor,aMessage);
				return;
				}

			ret = AddCSYExtension(fullCSYFilename,aMessage);
			if(ret != KErrNone)
				{
				C32LOG2(KC32Warning, _L8("ServiceL: LoadCommModule AddCSYExtension returned %d instead of KErrNone, cannot proceed"), ret);
				return;
				}

 		 	CommsFW::TWorkerId worker;
	 		TBuf8<KMaxFileName> fileName8;
			fileName8.Copy(fullCSYFilename);

 		    TBool found = iThreadManager->FindThreadByFileName(fileName8, worker);
	 		if(!found)
		 		{
		 		worker = iThreadManager->iDefaultThreadIndex;
		 		}

 		 	if(c32Dealer.WorkerExists(worker))
 		 		{
 		 		LoadCommModuleL(aMessage,worker,!found,fullCSYFilename);
 		 		}
 		 	else
 		 		{
				C32LOG2(KC32Dealer,_L8("ServiceL: LoadCommModule requires worker %d. This worker does not exist so starting"),worker);
 		 		ret = c32Dealer.LoadCPMOnLoadCommModule(worker);
 		 		if ((ret!=KErrNone) && (ret!=KErrInUse))
 		 			{
 		 			// only likely return codes here are KErrNoMemory or KErrNotFound if
 		 			// the RS server could not be found - which means system is probably in pretty bad state (ie, no memory)
 		 			// luckily at this point there isn't anything to clean up!
 		 			SafeComplete(aMessage,ret);
 		 			}
 		 		else
 		 			{
	 		 		ret = c32Dealer.ParkRequest(this, aMessage);
	 		 		if(ret != KErrNone)
	 		 			{
	 		 			SafeComplete(aMessage, ret);
	 		 			}
 		 			}
 		 		}
 		 	return;
 		 	}
		case ECommCloseCommModule:
			CloseCommModuleL(aMessage);
			return;
		case ECommPortInfoByName:
			{
			TPortName name;
			TInt ret = Read(1,aMessage,name);
			if (ret != KErrNone)
				{
				C32LOG2(KC32Warning, _L8("ServiceL: LoadCommModule  Read returned %d instead of KErrNone, cannot proceed"), ret);
				PanicClient(EBadDescriptor,aMessage);
				return;
				}
			PortInfoL(aMessage,name);
			return;
			}
		case ECommPortInfoByNumber:		// original msg is not forwarded as global as aMessage.Int2() is not valid in player, instead CSerial* is wrapped in TC32PlayerGetPortInfoMsg
			PortInfo(aMessage,aMessage.Int2());
			return;
		case ECommNumPorts:				// get information from ThreadManager in dealer
			NumPorts(aMessage);
			return;
		case ECommStartServerThread:	// KErrNotSupported
			C32LOG2(KC32Dealer, _L8("WARNING: deprecated function ECommStartServerThread called, CCommSession(%08x)"), this);
			SafeComplete(aMessage, KErrNotSupported);
			return;
		}

	// obtain subsession* from aMessage.Int3()
	CCommSubSession *p = SubSessionFromHandle(aMessage.Int3(), CCommSubSession::ECPort);

	if (aMessage.Function()==ECommClose)
		{
		if (p==NULL)	// not a valid aMessage.Int3()
			{
			SafeComplete(aMessage, KErrBadHandle);
			return;
			}
		else
			{
			CloseSubSessionL(aMessage, CCommSubSession::ECPort);
			return;
			}
		}

	if (p==NULL)	// not a valid aMessage.Int3()
		{
		PanicClient(EBadCommHandle, aMessage);
		return;
		}

	// Its OK to proceed with the dispatch of other requests
	switch (aMessage.Function())
        {
	    case ECommRead:
		case ECommReadCancel:
		case ECommQueryReceiveBuffer:
		case ECommResetBuffers:
		case ECommWrite:
		case ECommWriteCancel:
		case ECommBreak:
		case ECommBreakCancel:
		case ECommCancel:
		case ECommConfig:
		case ECommSetConfig:
		case ECommCaps:
		case ECommSetMode:
		case ECommGetMode:
		case ECommSignals:
		case ECommSetSignalsToMark:
		case ECommSetSignalsToSpace:
		case ECommReceiveBufferLength:
		case ECommSetReceiveBufferLength:
		case ECommSetAccess:
		case ECommOpenWhenAvailableCancel:
	#ifdef _DEBUG
		case ECommDebugState:
	#endif

		// Extensions to the CCommSession starts from here

		case ECommNotifySignals:
		case ECommNotifyFlowControl:
		case ECommNotifySignalsCancel:
		case ECommNotifyFlowControlCancel:
		case ECommGetFlowControl:
		case ECommNotifyConfigChange:
		case ECommNotifyConfigChangeCancel:
		case ECommNotifyBreak:
		case ECommNotifyBreakCancel:
		case ECommGetRole:
		case ECommNotifyDataAvailable:
		case ECommNotifyDataAvailableCancel:
		case ECommNotifyOutputEmpty:
		case ECommNotifyOutputEmptyCancel:
			ForwardMessageL(aMessage, *p);
			break;

		// Extensions to the CCommSession ends to here

		default:
			SafeComplete(aMessage, KErrNotSupported);
			break;

		}
	C32LOG(KC32Detail,_L8("CCommSession::ServiceL() end"));
	}