networkcontrol/qosipscpr/inc/IPSCPR.h
changeset 0 af10295192d8
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 // IP SubConnection Provider class definition.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef SYMBIAN_IPSCPR_H
       
    24 #define SYMBIAN_IPSCPR_H
       
    25 
       
    26 #include <comms-infras/ss_subconnprov.h>
       
    27 #include <comms-infras/corescpr.h>
       
    28 #include <comms-infras/corescprstates.h>
       
    29 
       
    30 #include <cs_subconevents.h>
       
    31 #include <cs_subconparams.h>
       
    32 
       
    33 #include <ip_subconparams.h>
       
    34 #include <networking/umtsextn.h>
       
    35 #include <networking/imsextn.h>
       
    36 #include <networking/pfqoslib.h>
       
    37 #include <networking/sblpextn.h>
       
    38 #include <comms-infras/eintsock.h>
       
    39 
       
    40 #include "IPSCPRFactory.h"
       
    41 #include "asyncwriter.h"
       
    42 #include "ipdeftbasescpr.h"
       
    43 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    44 #include <networking/qoslib_internal.h>
       
    45 #endif
       
    46 
       
    47 class CQoSMsgWriter;
       
    48 class CQoSMsgReader;
       
    49 class TUmtsR5QoSParameters;
       
    50 class TImsParameter;
       
    51 class CSubConQosR5ParamSet;
       
    52 class CSubConIMSExtParamSet;
       
    53 
       
    54 namespace QoSIpSCprStates
       
    55     {
       
    56     class TAddClientToQoSChannel;
       
    57     class TRemoveClientToQoSChannel;
       
    58     class TRemoveLeavingClientFromQoSChannel;
       
    59     class TSetParameters;
       
    60     }
       
    61 
       
    62 class CIpSubConnectionProvider : public CIpSubConnectionProviderBase
       
    63 /** Non-default/reserved IP subconnection provider
       
    64 
       
    65 @internalTechnology
       
    66 @released Since 9.4 */
       
    67     {
       
    68     friend class CIpDefaultSubConnectionProviderFactory;
       
    69     friend class QoSIpSCprStates::TAddClientToQoSChannel;
       
    70     friend class QoSIpSCprStates::TRemoveClientToQoSChannel;
       
    71     friend class QoSIpSCprStates::TRemoveLeavingClientFromQoSChannel;
       
    72     friend class QoSIpSCprStates::TSetParameters;
       
    73     friend class CQoSSocketOpener;    
       
    74 public:
       
    75     typedef CIpDefaultSubConnectionProviderFactory FactoryType;
       
    76 	virtual ~CIpSubConnectionProvider();
       
    77 
       
    78 
       
    79 private:
       
    80     enum
       
    81         {
       
    82         KParameterRelInvalid = 0,
       
    83         KParameterRelGeneric = 1,
       
    84         KParameterRel4Rel99 = 4,
       
    85         KParameterRel5 = 5,
       
    86         };
       
    87 
       
    88 protected:
       
    89     //-====================================
       
    90     //Construction methods bundle - accessible thru the factory only
       
    91     //-====================================
       
    92     CIpSubConnectionProvider(ESock::CSubConnectionProviderFactoryBase& aFactory);
       
    93 	static CIpSubConnectionProvider* NewL(CIpDefaultSubConnectionProviderFactory& aFactory);
       
    94 	void ConstructL();
       
    95     void ResetPrtExtensions();
       
    96 
       
    97     //-====================================
       
    98     //ACFNode overrides
       
    99     //-====================================
       
   100     virtual Messages::RNodeInterface* NewClientInterfaceL(const Messages::TClientType& aClientType, TAny* aClientInfo = NULL);
       
   101     void Received(MeshMachine::TNodeContextBase& aContext);
       
   102     void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage);
       
   103 
       
   104     //-====================================
       
   105     //Callbacks from MESH.
       
   106     //-====================================
       
   107     void SetQoSParametersL();
       
   108     RInternalSocket& InternalSocket();
       
   109     void InternalSocketOpened(TInt aErr);    
       
   110 	
       
   111     //-====================================
       
   112     //Callbacks from QoSMsg.
       
   113     //-====================================
       
   114 public:
       
   115 	// Messages from PRT
       
   116 	void ProcessPRTMsg(TPfqosMessage& aMsg);
       
   117 	void ProcessPRTError(TPfqosMessage& aMsg, TInt aError);
       
   118 #ifdef _DEBUG
       
   119 	void ProcessPRTError(TInt aMsgType, TInt aError);
       
   120 #endif
       
   121 
       
   122 private:
       
   123     //-====================================
       
   124     //Custom methods
       
   125     //-====================================
       
   126 	void DataClientJoiningL(RIPDataClientNodeInterface& aDataClient);
       
   127 	void DataClientLeaving(RIPDataClientNodeInterface& aDataClient);
       
   128 
       
   129 	// Messages to PRT
       
   130 	void SendOpenExistingL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol);
       
   131 	void SendCreateL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol);
       
   132 	void SendCloseL();
       
   133 	void SendJoinL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol);
       
   134 	void SendLeaveL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol);
       
   135 	void SendSetQoSL();
       
   136 
       
   137 
       
   138 	// Internal Processing
       
   139 	void ProcessPRTEventL(TPfqosMessage& aMsg);
       
   140 	void ProcessPRTReplyL(TPfqosMessage& aMsg);
       
   141 
       
   142 	void ConvertParametersFromESockL(const ESock::RCFParameterFamilyBundleC& aParameterBundle);
       
   143 	void ConvertParametersFromQOSL(TPfqosMessage& aMsg, CSubConGenEventParamsGranted* aEvent);
       
   144 
       
   145 	RIPDataClientNodeInterface* DetermineClient(const TPfqosMessage& aMsg);
       
   146 	void MapGenericParamsFromESockToPRTL(const CSubConQosGenericParamSet& generic) const;
       
   147 	void MapGenericParamsFromPRTToESockL(CSubConQosGenericParamSet& generic) const;
       
   148 	void MapExtensionParamsFromESockToPRTL(const CSubConQosIPLinkR99ParamSet& extension, TUmtsQoSParameters& params);
       
   149 	void MapExtensionParamsFromESockToPRTL(const CSubConSBLPR5ExtensionParamSet& extension, CSblpParameters& params) const;
       
   150 	void MapExtensionParamsFromESockToPRTL(const CSubConQosR5ParamSet& aExtension, TUmtsR5QoSParameters& aParams);
       
   151 	void MapExtensionParamsFromESockToPRTL(const CSubConImsExtParamSet& aExtension, TImsParameter& aParams);
       
   152     CSubConExtensionParameterSet* MapFromUmtsR5ExtensionL (const CUmtsR5QoSPolicy* aPolicy);
       
   153     CSubConExtensionParameterSet* MapFromImsExtensionL (const CImsPolicy* aPolicy);
       
   154 
       
   155 	void ConvertTQoSIntoCQoSParamsL(const TQoSParameters& aParameter);
       
   156 	void ConvertCQoSIntoTQoSParamsL(TQoSParameters& aParameters) const;
       
   157 
       
   158 private:
       
   159 	/** Internal Socket */
       
   160 	RInternalSocket iSocket;
       
   161         TInt iSocketError;	
       
   162 
       
   163 	/** PRT message writer */
       
   164 	CQoSMsgWriter* iWriter;
       
   165 
       
   166 	/** PRT message reader */
       
   167 	CQoSMsgReader* iReader;
       
   168 
       
   169 	/** QoS channel Id */
       
   170 	TInt iChannelId;
       
   171 
       
   172 	/** Process UID */
       
   173 	TUidType iUid;
       
   174 
       
   175 	/** QoS Parameters */
       
   176     CQoSParameters* iPrtParameters;
       
   177 
       
   178 	/** QoS Extensions */
       
   179     TQoSExtensionQueue iPrtExtensions;
       
   180 
       
   181 	/** QoS Parameters Set */
       
   182 	TBool iParametersSet;
       
   183 	TInt  iParameterRelease;
       
   184 
       
   185 	/**Class for doing async writes */
       
   186 	CAsyncWriter* iAsyncWriter;
       
   187     };
       
   188 
       
   189 
       
   190 #endif //SYMBIAN_IPSCPR_H