networkcontrol/ipnetworklayer/src/IPProtoSCPRStates.cpp
changeset 0 af10295192d8
child 5 1422c6cd3f0c
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2006-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 // IPProto SubConnection Provider states/transitions
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include <comms-infras/netcfgextprov.h>
       
    24 #include <networking/qos3gpp_subconparams.h>
       
    25 #include <cs_subconparams.h>
       
    26 #include <cs_subconevents.h>
       
    27 #include <comms-infras/corescpractivities.h>
       
    28 #include <comms-infras/linkmessages.h>		// for TLinkMessage
       
    29 #include "IPProtoSCPR.h"
       
    30 #include "IPProtoSCPRStates.h"
       
    31 #include "ItfInfoConfigExt.h"
       
    32 #include <comms-infras/ss_datamonitoringprovider.h>
       
    33 
       
    34 using namespace ESock;
       
    35 using namespace NetStateMachine;
       
    36 using namespace IPProtoSCpr;
       
    37 using namespace Messages;
       
    38 
       
    39 #ifndef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
       
    40 DEFINE_SMELEMENT(TSendParamsToServiceProvider, NetStateMachine::MStateTransition, IPProtoSCpr::TContext)
       
    41 void TSendParamsToServiceProvider::DoL()
       
    42 	{
       
    43 	ASSERT( ! iContext.Node().iParameterBundle.IsNull());
       
    44 	iContext.iNodeActivity->PostRequestTo(*iContext.Node().ServiceProvider(),
       
    45 	    TCFScpr::TParamsRequest(iContext.Node().iParameterBundle).CRef());
       
    46 	}
       
    47 #endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
       
    48 
       
    49 DEFINE_SMELEMENT(TStoreProvision, NetStateMachine::MStateTransition, IPProtoSCpr::TContext)
       
    50 void IPProtoSCpr::TStoreProvision::DoL()
       
    51 	{
       
    52 	PRStates::TStoreProvision storeProvision(iContext);
       
    53 	storeProvision.DoL();			// set up iContext.Node().iProvisionConfig
       
    54 	
       
    55 	//[401TODO]: RZ Add datamonitoring ptrs. back.
       
    56     // Allocate and add the data monitoring shared memory pointers the provisioning info
       
    57 	//CIPProtoSubConnectionProvider& node = iContext.Node();
       
    58 	//TDataMonitoringSubConnProvisioningInfo* subConnProvisioningInfo = new (ELeave) TDataMonitoringSubConnProvisioningInfo(&node.iDataVolumes, &node.iThresholds);
       
    59 	//CleanupStack::PushL(subConnProvisioningInfo);
       
    60 	//node.AccessPointConfig().AppendExtensionL(subConnProvisioningInfo);
       
    61 	//CleanupStack::Pop(subConnProvisioningInfo);
       
    62 	}
       
    63 
       
    64 
       
    65 //[401TODO]: DL Rename this to SendAddressInfoBundle
       
    66 DEFINE_SMELEMENT(TSendDataClientRoutedToFlow, NetStateMachine::MStateTransition, IPProtoSCpr::TContext)
       
    67 void IPProtoSCpr::TSendDataClientRoutedToFlow::DoL()
       
    68 	{
       
    69 	ASSERT(!iContext.Node().GetParameterBundle().IsNull());
       
    70 	RParameterFamily dummy;
       
    71 	(void)dummy;
       
    72 	 RParameterFamily ipAddressInfoFamily = iContext.Node().GetParameterBundle().FindFamily(KSubConIPAddressInfoFamily);
       
    73 	 if ( ipAddressInfoFamily.IsNull())
       
    74 	     {
       
    75 	     User::Leave(KErrArgument);
       
    76 	     }
       
    77 	RNodeInterface* dc = iContext.Node().GetFirstClient<TDefaultClientMatchPolicy>(TCFClientType::EData);	
       
    78 	if (dc)
       
    79 		{
       
    80 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
       
    81 		dc->PostMessage(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), TCFScpr::TSetParamsRequest(iContext.Node().iParameterBundle).CRef());			
       
    82 #else
       
    83 		dc->PostMessage(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), TCFScpr::TParamsRequest(iContext.Node().iParameterBundle).CRef());
       
    84 #endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
       
    85 		}
       
    86 	}
       
    87 
       
    88 
       
    89 //-=========================================================
       
    90 // Data monitoring support
       
    91 //-=========================================================
       
    92 DEFINE_SMELEMENT(TAwaitingDataMonitoringNotification, NetStateMachine::MState, IPProtoSCpr::TContext)
       
    93 TBool IPProtoSCpr::TAwaitingDataMonitoringNotification::Accept()
       
    94 	{
       
    95 	return iContext.iMessage.IsMessage<TCFDataMonitoringNotification::TDataMonitoringNotification>();
       
    96 	}
       
    97 
       
    98 DEFINE_SMELEMENT(TProcessDataMonitoringNotification, NetStateMachine::MStateTransition, IPProtoSCpr::TContext)
       
    99 void IPProtoSCpr::TProcessDataMonitoringNotification::DoL()
       
   100 	{
       
   101 	TCFDataMonitoringNotification::TDataMonitoringNotification& msg =
       
   102 		message_cast<TCFDataMonitoringNotification::TDataMonitoringNotification>(iContext.iMessage);
       
   103 
       
   104 	iContext.Node().DataNotificationL(msg);
       
   105 	}
       
   106 
       
   107 //
       
   108 // support for AgentEventNotification
       
   109 //
       
   110 DEFINE_SMELEMENT(TAwaitingAgentEventNotification, NetStateMachine::MState, IPProtoSCpr::TContext)
       
   111 TBool IPProtoSCpr::TAwaitingAgentEventNotification::Accept()
       
   112 	{
       
   113 	return iContext.iMessage.IsMessage<TLinkMessage::TAgentEventNotification>();
       
   114 	}
       
   115 
       
   116 DEFINE_SMELEMENT(TProcessAgentEvent, NetStateMachine::MStateTransition, IPProtoSCpr::TContext)
       
   117 void IPProtoSCpr::TProcessAgentEvent::DoL()
       
   118 	{
       
   119 	if (iContext.Node().iControl)
       
   120 		{
       
   121 		// AgentEventNotification originates from the AgentSCPr as a result of an AgentEvent()
       
   122 		// call from the Agent.  Although the message is generic, it was primarily created to pass the
       
   123 		// event ECurrentNetworkChangeEvent from the Agent towards the NetCfgExt for CDMA2000 support.
       
   124 		// The "aEventData" and "aSource" fields of the EventNotification() call are not used for this
       
   125 		// event, and hence are passed as null values.
       
   126 		TLinkMessage::TAgentEventNotification& msg = message_cast<TLinkMessage::TAgentEventNotification>(iContext.iMessage);
       
   127 		iContext.Node().iControl->EventNotification(TNetworkAdaptorEventType(msg.iValue1), msg.iValue2, KNullDesC8, NULL);
       
   128 		}
       
   129 	}
       
   130