telephonyserverplugins/ctsydispatchlayer/src/cpacketservicesdispatcher.cpp
changeset 0 3553901f7fa8
child 19 630d2f34d719
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2008-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 //
       
    15 
       
    16 #include "cpacketservicesdispatcher.h"
       
    17 
       
    18 #include <ctsy/ltsy/mltsydispatchpacketservicesinterface.h>
       
    19 #include <ctsy/pluginapi/mmmessagemanagercallback.h>
       
    20 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    21 
       
    22 #include <etelpckt.h>
       
    23 #include <pcktcs.h>
       
    24 #include <etelqos.h>
       
    25 #include <in_sock.h>
       
    26 #include <ctsy/serviceapi/cmmutility.h>
       
    27 #include <ctsy/ltsy/ltsylogger.h>
       
    28 #include "ctsydispatcherpanic.h"
       
    29 #include "tdispatcherholder.h"
       
    30 #include <pcktlist.h>
       
    31 
       
    32 CPacketServicesDispatcher::CPacketServicesDispatcher(
       
    33 		MLtsyDispatchFactoryV1& aLtsyFactory,
       
    34 		MmMessageManagerCallback& aMessageManagerCallback,
       
    35 		CRequestQueueOneShot& aRequestAsyncOneShot)
       
    36 	: 	iLtsyFactoryV1(aLtsyFactory),
       
    37 		iMessageManagerCallback(aMessageManagerCallback),
       
    38 		iRequestAsyncOneShot(aRequestAsyncOneShot)
       
    39 	{
       
    40 	} // CPacketServicesDispatcher::CPacketServicesDispatcher
       
    41 
       
    42 
       
    43 CPacketServicesDispatcher::~CPacketServicesDispatcher()
       
    44 	{
       
    45 	} // CPacketServicesDispatcher::~CPacketServicesDispatcher
       
    46 
       
    47 
       
    48 CPacketServicesDispatcher* CPacketServicesDispatcher::NewLC(
       
    49 	MLtsyDispatchFactoryV1& aLtsyFactory,
       
    50 	MmMessageManagerCallback& aMessageManagerCallback,
       
    51 	CRequestQueueOneShot& aRequestAsyncOneShot)
       
    52 	{
       
    53 	TSYLOGENTRYEXIT;
       
    54 	CPacketServicesDispatcher* self =
       
    55 		new (ELeave) CPacketServicesDispatcher(aLtsyFactory, aMessageManagerCallback, aRequestAsyncOneShot);
       
    56 	CleanupStack::PushL(self);
       
    57 	self->ConstructL();
       
    58 	return self;
       
    59 	} // CPacketServicesDispatcher::NewLC
       
    60 
       
    61 
       
    62 CPacketServicesDispatcher* CPacketServicesDispatcher::NewL(
       
    63 	MLtsyDispatchFactoryV1& aLtsyFactory,
       
    64 	MmMessageManagerCallback& aMessageManagerCallback,
       
    65 	CRequestQueueOneShot& aRequestAsyncOneShot)
       
    66 	{
       
    67 	TSYLOGENTRYEXIT;
       
    68 	CPacketServicesDispatcher* self =
       
    69 		CPacketServicesDispatcher::NewLC(aLtsyFactory, aMessageManagerCallback, aRequestAsyncOneShot);
       
    70 	CleanupStack::Pop (self);
       
    71 	return self;
       
    72 	} // CPacketServicesDispatcher::NewL
       
    73 
       
    74 
       
    75 void CPacketServicesDispatcher::ConstructL()
       
    76 /**
       
    77  * Second phase constructor.
       
    78  */
       
    79 	{
       
    80 	TSYLOGENTRYEXIT;
       
    81 
       
    82 	// Get the Licensee LTSY interfaces related to PacketServices functionality
       
    83 	// from the factory
       
    84 
       
    85 
       
    86 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesPacketAttach::KLtsyDispatchPacketServicesPacketAttachApiId))
       
    87 		{
       
    88 		TAny* packetAttachInterface = NULL;
       
    89 		iLtsyFactoryV1.GetDispatchHandler(
       
    90 		       	MLtsyDispatchPacketServicesPacketAttach::KLtsyDispatchPacketServicesPacketAttachApiId,
       
    91 		       	packetAttachInterface);
       
    92 		iLtsyDispatchPacketServicesPacketAttach =
       
    93 				static_cast<MLtsyDispatchPacketServicesPacketAttach*>(packetAttachInterface);
       
    94         __ASSERT_DEBUG(iLtsyDispatchPacketServicesPacketAttach, CtsyDispatcherPanic(EInvalidNullPtr));
       
    95   		}
       
    96 
       
    97 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesGetPacketAttachMode::KLtsyDispatchPacketServicesGetPacketAttachModeApiId))
       
    98 		{
       
    99 		TAny* getPacketAttachModeInterface = NULL;
       
   100 		iLtsyFactoryV1.GetDispatchHandler(
       
   101 		       	MLtsyDispatchPacketServicesGetPacketAttachMode::KLtsyDispatchPacketServicesGetPacketAttachModeApiId,
       
   102 		       	getPacketAttachModeInterface);
       
   103 		iLtsyDispatchPacketServicesGetPacketAttachMode =
       
   104 				static_cast<MLtsyDispatchPacketServicesGetPacketAttachMode*>(getPacketAttachModeInterface);
       
   105         __ASSERT_DEBUG(iLtsyDispatchPacketServicesGetPacketAttachMode, CtsyDispatcherPanic(EInvalidNullPtr));
       
   106   		}
       
   107 
       
   108 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatus::KLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatusApiId))
       
   109 		{
       
   110 		TAny* getPacketNetworkRegistrationStatusInterface = NULL;
       
   111 		iLtsyFactoryV1.GetDispatchHandler(
       
   112 		       	MLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatus::KLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatusApiId,
       
   113 		       	getPacketNetworkRegistrationStatusInterface);
       
   114 		iLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatus =
       
   115 				static_cast<MLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatus*>(getPacketNetworkRegistrationStatusInterface);
       
   116         __ASSERT_DEBUG(iLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatus, CtsyDispatcherPanic(EInvalidNullPtr));
       
   117   		}
       
   118 
       
   119 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesPacketDetach::KLtsyDispatchPacketServicesPacketDetachApiId))
       
   120 		{
       
   121 		TAny* packetDetachInterface = NULL;
       
   122 		iLtsyFactoryV1.GetDispatchHandler(
       
   123 		       	MLtsyDispatchPacketServicesPacketDetach::KLtsyDispatchPacketServicesPacketDetachApiId,
       
   124 		       	packetDetachInterface);
       
   125 		iLtsyDispatchPacketServicesPacketDetach =
       
   126 				static_cast<MLtsyDispatchPacketServicesPacketDetach*>(packetDetachInterface);
       
   127         __ASSERT_DEBUG(iLtsyDispatchPacketServicesPacketDetach, CtsyDispatcherPanic(EInvalidNullPtr));
       
   128   		}
       
   129 
       
   130 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesSetPdpContextConfig::KLtsyDispatchPacketServicesSetPdpContextConfigApiId))
       
   131 		{
       
   132 		TAny* setPdpContextConfigInterface = NULL;
       
   133 		iLtsyFactoryV1.GetDispatchHandler(
       
   134 		       	MLtsyDispatchPacketServicesSetPdpContextConfig::KLtsyDispatchPacketServicesSetPdpContextConfigApiId,
       
   135 		       	setPdpContextConfigInterface);
       
   136 		iLtsyDispatchPacketServicesSetPdpContextConfig =
       
   137 				static_cast<MLtsyDispatchPacketServicesSetPdpContextConfig*>(setPdpContextConfigInterface);
       
   138         __ASSERT_DEBUG(iLtsyDispatchPacketServicesSetPdpContextConfig, CtsyDispatcherPanic(EInvalidNullPtr));
       
   139   		}
       
   140 
       
   141 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesModifyActivePdpContext::KLtsyDispatchPacketServicesModifyActivePdpContextApiId))
       
   142 		{
       
   143 		TAny* modifyActivePdpContextInterface = NULL;
       
   144 		iLtsyFactoryV1.GetDispatchHandler(
       
   145 		       	MLtsyDispatchPacketServicesModifyActivePdpContext::KLtsyDispatchPacketServicesModifyActivePdpContextApiId,
       
   146 		       	modifyActivePdpContextInterface);
       
   147 		iLtsyDispatchPacketServicesModifyActivePdpContext =
       
   148 				static_cast<MLtsyDispatchPacketServicesModifyActivePdpContext*>(modifyActivePdpContextInterface);
       
   149         __ASSERT_DEBUG(iLtsyDispatchPacketServicesModifyActivePdpContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
   150   		}
       
   151 
       
   152 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesInitialisePdpContext::KLtsyDispatchPacketServicesInitialisePdpContextApiId))
       
   153 		{
       
   154 		TAny* initialisePdpContextInterface = NULL;
       
   155 		iLtsyFactoryV1.GetDispatchHandler(
       
   156 		       	MLtsyDispatchPacketServicesInitialisePdpContext::KLtsyDispatchPacketServicesInitialisePdpContextApiId,
       
   157 		       	initialisePdpContextInterface);
       
   158 		iLtsyDispatchPacketServicesInitialisePdpContext =
       
   159 				static_cast<MLtsyDispatchPacketServicesInitialisePdpContext*>(initialisePdpContextInterface);
       
   160         __ASSERT_DEBUG(iLtsyDispatchPacketServicesInitialisePdpContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
   161   		}
       
   162 
       
   163 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesDeletePdpContext::KLtsyDispatchPacketServicesDeletePdpContextApiId))
       
   164 		{
       
   165 		TAny* deletePdpContextInterface = NULL;
       
   166 		iLtsyFactoryV1.GetDispatchHandler(
       
   167 		       	MLtsyDispatchPacketServicesDeletePdpContext::KLtsyDispatchPacketServicesDeletePdpContextApiId,
       
   168 		       	deletePdpContextInterface);
       
   169 		iLtsyDispatchPacketServicesDeletePdpContext =
       
   170 				static_cast<MLtsyDispatchPacketServicesDeletePdpContext*>(deletePdpContextInterface);
       
   171         __ASSERT_DEBUG(iLtsyDispatchPacketServicesDeletePdpContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
   172   		}
       
   173 
       
   174 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesSetPacketAttachMode::KLtsyDispatchPacketServicesSetPacketAttachModeApiId))
       
   175 		{
       
   176 		TAny* setPacketAttachModeInterface = NULL;
       
   177 		iLtsyFactoryV1.GetDispatchHandler(
       
   178 		       	MLtsyDispatchPacketServicesSetPacketAttachMode::KLtsyDispatchPacketServicesSetPacketAttachModeApiId,
       
   179 		       	setPacketAttachModeInterface);
       
   180 		iLtsyDispatchPacketServicesSetPacketAttachMode =
       
   181 				static_cast<MLtsyDispatchPacketServicesSetPacketAttachMode*>(setPacketAttachModeInterface);
       
   182         __ASSERT_DEBUG(iLtsyDispatchPacketServicesSetPacketAttachMode, CtsyDispatcherPanic(EInvalidNullPtr));
       
   183   		}
       
   184 
       
   185 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesNotifyPacketStatusChange::KLtsyDispatchPacketServicesNotifyPacketStatusChangeApiId))
       
   186 		{
       
   187 		TAny* notifyPacketStatusChangeInterface = NULL;
       
   188 		iLtsyFactoryV1.GetDispatchHandler(
       
   189 		       	MLtsyDispatchPacketServicesNotifyPacketStatusChange::KLtsyDispatchPacketServicesNotifyPacketStatusChangeApiId,
       
   190 		       	notifyPacketStatusChangeInterface);
       
   191 		iLtsyDispatchPacketServicesNotifyPacketStatusChange =
       
   192 				static_cast<MLtsyDispatchPacketServicesNotifyPacketStatusChange*>(notifyPacketStatusChangeInterface);
       
   193         __ASSERT_DEBUG(iLtsyDispatchPacketServicesNotifyPacketStatusChange, CtsyDispatcherPanic(EInvalidNullPtr));
       
   194   		}
       
   195 
       
   196 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams::KLtsyDispatchPacketServicesSetDefaultPdpContextGprsParamsApiId))
       
   197 		{
       
   198 		TAny* setDefaultPdpContextParamsInterface = NULL;
       
   199 		iLtsyFactoryV1.GetDispatchHandler(
       
   200 		       	MLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams::KLtsyDispatchPacketServicesSetDefaultPdpContextGprsParamsApiId,
       
   201 		       	setDefaultPdpContextParamsInterface);
       
   202 		iLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams =
       
   203 				static_cast<MLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams*>(setDefaultPdpContextParamsInterface);
       
   204         __ASSERT_DEBUG(iLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams, CtsyDispatcherPanic(EInvalidNullPtr));
       
   205   		}
       
   206 
       
   207 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesSetDefaultPdpContextR99R4Params::KLtsyDispatchPacketServicesSetDefaultPdpContextR99R4ParamsApiId))
       
   208 		{
       
   209 		TAny* setDefaultPdpContextParamsInterface = NULL;
       
   210 		iLtsyFactoryV1.GetDispatchHandler(
       
   211 		       	MLtsyDispatchPacketServicesSetDefaultPdpContextR99R4Params::KLtsyDispatchPacketServicesSetDefaultPdpContextR99R4ParamsApiId,
       
   212 		       	setDefaultPdpContextParamsInterface);
       
   213 		iLtsyDispatchPacketServicesSetDefaultPdpContextR99R4Params =
       
   214 				static_cast<MLtsyDispatchPacketServicesSetDefaultPdpContextR99R4Params*>(setDefaultPdpContextParamsInterface);
       
   215         __ASSERT_DEBUG(iLtsyDispatchPacketServicesSetDefaultPdpContextR99R4Params, CtsyDispatcherPanic(EInvalidNullPtr));
       
   216   		}
       
   217 
       
   218 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesActivatePdpContext::KLtsyDispatchPacketServicesActivatePdpContextApiId))
       
   219 		{
       
   220 		TAny* activatePdpContextInterface = NULL;
       
   221 		iLtsyFactoryV1.GetDispatchHandler(
       
   222 		       	MLtsyDispatchPacketServicesActivatePdpContext::KLtsyDispatchPacketServicesActivatePdpContextApiId,
       
   223 		       	activatePdpContextInterface);
       
   224 		iLtsyDispatchPacketServicesActivatePdpContext =
       
   225 				static_cast<MLtsyDispatchPacketServicesActivatePdpContext*>(activatePdpContextInterface);
       
   226         __ASSERT_DEBUG(iLtsyDispatchPacketServicesActivatePdpContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
   227   		}
       
   228 
       
   229 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesSetPdpContextQosGprs::KLtsyDispatchPacketServicesSetPdpContextQosGprsApiId))
       
   230 		{
       
   231 		TAny* setPdpContextQosInterface = NULL;
       
   232 		iLtsyFactoryV1.GetDispatchHandler(
       
   233 		       	MLtsyDispatchPacketServicesSetPdpContextQosGprs::KLtsyDispatchPacketServicesSetPdpContextQosGprsApiId,
       
   234 		       	setPdpContextQosInterface);
       
   235 		iLtsyDispatchPacketServicesSetPdpContextQosGprs =
       
   236 				static_cast<MLtsyDispatchPacketServicesSetPdpContextQosGprs*>(setPdpContextQosInterface);
       
   237         __ASSERT_DEBUG(iLtsyDispatchPacketServicesSetPdpContextQosGprs, CtsyDispatcherPanic(EInvalidNullPtr));
       
   238   		}
       
   239 
       
   240 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesSetPdpContextQosR99R4::KLtsyDispatchPacketServicesSetPdpContextQosR99R4ApiId))
       
   241 		{
       
   242 		TAny* setPdpContextQosInterface = NULL;
       
   243 		iLtsyFactoryV1.GetDispatchHandler(
       
   244 		       	MLtsyDispatchPacketServicesSetPdpContextQosR99R4::KLtsyDispatchPacketServicesSetPdpContextQosR99R4ApiId,
       
   245 		       	setPdpContextQosInterface);
       
   246 		iLtsyDispatchPacketServicesSetPdpContextQosR99R4 =
       
   247 				static_cast<MLtsyDispatchPacketServicesSetPdpContextQosR99R4*>(setPdpContextQosInterface);
       
   248         __ASSERT_DEBUG(iLtsyDispatchPacketServicesSetPdpContextQosR99R4, CtsyDispatcherPanic(EInvalidNullPtr));
       
   249   		}
       
   250 
       
   251 	if (iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesSetPdpContextQosR5::KLtsyDispatchPacketServicesSetPdpContextQosR5ApiId))
       
   252 		{
       
   253 		TAny* setPdpContextQosInterface = NULL;
       
   254 		iLtsyFactoryV1.GetDispatchHandler(
       
   255 		       	MLtsyDispatchPacketServicesSetPdpContextQosR5::KLtsyDispatchPacketServicesSetPdpContextQosR5ApiId,
       
   256 		       	setPdpContextQosInterface);
       
   257 		iLtsyDispatchPacketServicesSetPdpContextQosR5 =
       
   258 				static_cast<MLtsyDispatchPacketServicesSetPdpContextQosR5*>(setPdpContextQosInterface);
       
   259         __ASSERT_DEBUG(iLtsyDispatchPacketServicesSetPdpContextQosR5, CtsyDispatcherPanic(EInvalidNullPtr));
       
   260   		}
       
   261 
       
   262 
       
   263 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequest::KLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequestApiId))
       
   264 		{
       
   265 		TAny* rejectNetworkInitiatedContextActivationRequestInterface = NULL;
       
   266 		iLtsyFactoryV1.GetDispatchHandler(
       
   267 		       	MLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequest::KLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequestApiId,
       
   268 		       	rejectNetworkInitiatedContextActivationRequestInterface);
       
   269 		iLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequest =
       
   270 				static_cast<MLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequest*>(rejectNetworkInitiatedContextActivationRequestInterface);
       
   271         __ASSERT_DEBUG(iLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequest, CtsyDispatcherPanic(EInvalidNullPtr));
       
   272   		}
       
   273 
       
   274 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesDeactivatePdpContext::KLtsyDispatchPacketServicesDeactivatePdpContextApiId))
       
   275 		{
       
   276 		TAny* deactivatePdpContextInterface = NULL;
       
   277 		iLtsyFactoryV1.GetDispatchHandler(
       
   278 		       	MLtsyDispatchPacketServicesDeactivatePdpContext::KLtsyDispatchPacketServicesDeactivatePdpContextApiId,
       
   279 		       	deactivatePdpContextInterface);
       
   280 		iLtsyDispatchPacketServicesDeactivatePdpContext =
       
   281 				static_cast<MLtsyDispatchPacketServicesDeactivatePdpContext*>(deactivatePdpContextInterface);
       
   282         __ASSERT_DEBUG(iLtsyDispatchPacketServicesDeactivatePdpContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
   283   		}
       
   284 
       
   285 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesAddPacketFilter::KLtsyDispatchPacketServicesAddPacketFilterApiId))
       
   286 		{
       
   287 		TAny* addPacketFilterInterface = NULL;
       
   288 		iLtsyFactoryV1.GetDispatchHandler(
       
   289 		       	MLtsyDispatchPacketServicesAddPacketFilter::KLtsyDispatchPacketServicesAddPacketFilterApiId,
       
   290 		       	addPacketFilterInterface);
       
   291 		iLtsyDispatchPacketServicesAddPacketFilter =
       
   292 				static_cast<MLtsyDispatchPacketServicesAddPacketFilter*>(addPacketFilterInterface);
       
   293         __ASSERT_DEBUG(iLtsyDispatchPacketServicesAddPacketFilter, CtsyDispatcherPanic(EInvalidNullPtr));
       
   294   		}
       
   295 
       
   296 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesGetStatus::KLtsyDispatchPacketServicesGetStatusApiId))
       
   297 			{
       
   298 			TAny* addGetStatusInterface = NULL;
       
   299 			iLtsyFactoryV1.GetDispatchHandler(
       
   300 					MLtsyDispatchPacketServicesGetStatus::KLtsyDispatchPacketServicesGetStatusApiId,
       
   301 					addGetStatusInterface);
       
   302 			iLtsyDispatchPacketServicesGetStatus =
       
   303 					static_cast<MLtsyDispatchPacketServicesGetStatus*>(addGetStatusInterface);
       
   304 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesGetStatus, CtsyDispatcherPanic(EInvalidNullPtr));
       
   305 	  		}
       
   306 	
       
   307 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesGetStaticCapabilities::KLtsyDispatchPacketServicesGetStaticCapabilitiesApiId))
       
   308 			{
       
   309 			TAny* getStaticCapabilitiesInterface = NULL;
       
   310 			iLtsyFactoryV1.GetDispatchHandler(
       
   311 					MLtsyDispatchPacketServicesGetStaticCapabilities::KLtsyDispatchPacketServicesGetStaticCapabilitiesApiId,
       
   312 					getStaticCapabilitiesInterface);
       
   313 			iLtsyDispatchPacketServicesGetStaticCapabilities =
       
   314 					static_cast<MLtsyDispatchPacketServicesGetStaticCapabilities*>(getStaticCapabilitiesInterface);
       
   315 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesGetStaticCapabilities, CtsyDispatcherPanic(EInvalidNullPtr));
       
   316 	  		}
       
   317 	
       
   318 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists::KLtsyDispatchPacketServicesGetMaxNoMonitoredServiceListsApiId))
       
   319 			{
       
   320 			TAny* getMaxNoMonitoredServiceListsInterface = NULL;
       
   321 			iLtsyFactoryV1.GetDispatchHandler(
       
   322 					MLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists::KLtsyDispatchPacketServicesGetMaxNoMonitoredServiceListsApiId,
       
   323 					getMaxNoMonitoredServiceListsInterface);
       
   324 			iLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists =
       
   325 					static_cast<MLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists*>(getMaxNoMonitoredServiceListsInterface);
       
   326 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists, CtsyDispatcherPanic(EInvalidNullPtr));
       
   327 	  		}
       
   328 	
       
   329 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesGetMaxNoActiveServices::KLtsyDispatchPacketServicesGetMaxNoActiveServicesApiId))
       
   330 			{
       
   331 			TAny* getMaxNoActiveServicesInterface = NULL;
       
   332 			iLtsyFactoryV1.GetDispatchHandler(
       
   333 					MLtsyDispatchPacketServicesGetMaxNoActiveServices::KLtsyDispatchPacketServicesGetMaxNoActiveServicesApiId,
       
   334 					getMaxNoActiveServicesInterface);
       
   335 			iLtsyDispatchPacketServicesGetMaxNoActiveServices =
       
   336 					static_cast<MLtsyDispatchPacketServicesGetMaxNoActiveServices*>(getMaxNoActiveServicesInterface);
       
   337 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesGetMaxNoActiveServices, CtsyDispatcherPanic(EInvalidNullPtr));
       
   338 	  		}
       
   339 	
       
   340 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesGetMbmsNetworkServiceStatus::KLtsyDispatchPacketServicesGetMbmsNetworkServiceStatusApiId))
       
   341 			{
       
   342 			TAny* getMbmsNetworkServiceStatus = NULL;
       
   343 			iLtsyFactoryV1.GetDispatchHandler(
       
   344 					MLtsyDispatchPacketServicesGetMbmsNetworkServiceStatus::KLtsyDispatchPacketServicesGetMbmsNetworkServiceStatusApiId,
       
   345 					getMbmsNetworkServiceStatus);
       
   346 			iLtsyDispatchPacketServicesGetMbmsNetworkServiceStatus =
       
   347 					static_cast<MLtsyDispatchPacketServicesGetMbmsNetworkServiceStatus*>(getMbmsNetworkServiceStatus);
       
   348 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesGetMbmsNetworkServiceStatus, CtsyDispatcherPanic(EInvalidNullPtr));
       
   349 	  		}
       
   350 	
       
   351 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesInitialiseMbmsContext::KLtsyDispatchPacketServicesInitialiseMbmsContextApiId))
       
   352 			{
       
   353 			TAny* initialiseMbmsContext = NULL;
       
   354 			iLtsyFactoryV1.GetDispatchHandler(
       
   355 					MLtsyDispatchPacketServicesInitialiseMbmsContext::KLtsyDispatchPacketServicesInitialiseMbmsContextApiId,
       
   356 					initialiseMbmsContext);
       
   357 			iLtsyDispatchPacketServicesInitialiseMbmsContext =
       
   358 					static_cast<MLtsyDispatchPacketServicesInitialiseMbmsContext*>(initialiseMbmsContext);
       
   359 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesInitialiseMbmsContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
   360 	  		}
       
   361 
       
   362 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesUpdateMbmsMonitorServiceList::KLtsyDispatchPacketServicesUpdateMbmsMonitorServiceListApiId))
       
   363 			{
       
   364 			TAny* updateMbmsMonitorServiceList = NULL;
       
   365 			iLtsyFactoryV1.GetDispatchHandler(
       
   366 					MLtsyDispatchPacketServicesUpdateMbmsMonitorServiceList::KLtsyDispatchPacketServicesUpdateMbmsMonitorServiceListApiId,
       
   367 					updateMbmsMonitorServiceList);
       
   368 			iLtsyDispatchPacketServicesUpdateMbmsMonitorServiceList =
       
   369 					static_cast<MLtsyDispatchPacketServicesUpdateMbmsMonitorServiceList*>(updateMbmsMonitorServiceList);
       
   370 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesUpdateMbmsMonitorServiceList, CtsyDispatcherPanic(EInvalidNullPtr));
       
   371 	  		}
       
   372 	
       
   373 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesUpdateMbmsSessionList::KLtsyDispatchPacketServicesUpdateMbmsSessionListApiId))
       
   374 			{
       
   375 			TAny* updateMbmsSessionList = NULL;
       
   376 			iLtsyFactoryV1.GetDispatchHandler(
       
   377 					 MLtsyDispatchPacketServicesUpdateMbmsSessionList::KLtsyDispatchPacketServicesUpdateMbmsSessionListApiId,
       
   378 					 updateMbmsSessionList);
       
   379 			iLtsyDispatchPacketServicesUpdateMbmsSessionList =
       
   380 					static_cast<MLtsyDispatchPacketServicesUpdateMbmsSessionList*>(updateMbmsSessionList);
       
   381 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesUpdateMbmsSessionList, CtsyDispatcherPanic(EInvalidNullPtr));
       
   382 	  		}
       
   383 
       
   384 	if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPacketServicesFuncUnitId, MLtsyDispatchPacketServicesRemovePacketFilter::KLtsyDispatchPacketServicesRemovePacketFilterApiId))
       
   385 			{
       
   386 			TAny* removePacketFilterInterface = NULL;
       
   387 			iLtsyFactoryV1.GetDispatchHandler(
       
   388 			       	MLtsyDispatchPacketServicesRemovePacketFilter::KLtsyDispatchPacketServicesRemovePacketFilterApiId,
       
   389 			       	removePacketFilterInterface);
       
   390 			iLtsyDispatchPacketServicesRemovePacketFilter =
       
   391 					static_cast<MLtsyDispatchPacketServicesRemovePacketFilter*>(removePacketFilterInterface);
       
   392 	        __ASSERT_DEBUG(iLtsyDispatchPacketServicesRemovePacketFilter, CtsyDispatcherPanic(EInvalidNullPtr));
       
   393 			}
       
   394 
       
   395 	} // CPacketServicesDispatcher::ConstructL
       
   396 
       
   397 void CPacketServicesDispatcher::SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder)
       
   398 /**
       
   399  * Set the dispatcher holder.
       
   400  *
       
   401  * @param aDispatcherHolder Reference to dispatcher holder.
       
   402  */
       
   403 	{
       
   404 	TSYLOGENTRYEXIT;
       
   405 
       
   406 	iDispatcherHolder = &aDispatcherHolder;
       
   407 	} // CPacketServicesDispatcher::SetDispatcherHolder
       
   408 
       
   409 TInt CPacketServicesDispatcher::DispatchPacketAttachL()
       
   410 /**
       
   411  * Pass request on to Licensee LTSY.
       
   412  *
       
   413  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   414  * the Licensee LTSY does not support this request.
       
   415  *
       
   416  * @see RPacketService::Attach()
       
   417  */
       
   418 	{
       
   419 	TSYLOGENTRYEXIT;
       
   420 	TInt ret = KErrNotSupported;
       
   421 
       
   422 	if (iLtsyDispatchPacketServicesPacketAttach)
       
   423 		{
       
   424 		ret = iLtsyDispatchPacketServicesPacketAttach->HandlePacketAttachReqL();
       
   425 		}
       
   426 
       
   427 	return TSYLOGSETEXITERR(ret);
       
   428 	} // CPacketServicesDispatcher::DispatchPacketAttachL
       
   429 
       
   430 TInt CPacketServicesDispatcher::DispatchGetPacketAttachModeL(const CMmDataPackage* aDataPackage)
       
   431 /**
       
   432  * Unpack data related to EPacketGetAttachMode
       
   433  * and pass request on to Licensee LTSY.
       
   434  *
       
   435  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   436  * the Licensee LTSY does not support this request.
       
   437  */
       
   438 	{
       
   439 	TSYLOGENTRYEXIT;
       
   440 	TInt ret = KErrNotSupported;
       
   441 
       
   442 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   443 
       
   444 	// Call Handle method in Licensee LTSY
       
   445 	if (iLtsyDispatchPacketServicesGetPacketAttachMode)
       
   446 		{
       
   447 
       
   448 		// Indicator to whether this call made during the open call
       
   449 		TBool initPhase;
       
   450 		aDataPackage->UnPackData(initPhase);
       
   451 
       
   452 		if (!initPhase)
       
   453 			{
       
   454 			ret = iLtsyDispatchPacketServicesGetPacketAttachMode->HandleGetPacketAttachModeReqL();
       
   455 			}
       
   456 		}
       
   457 	return TSYLOGSETEXITERR(ret);
       
   458 	} // CPacketServicesDispatcher::DispatchGetPacketAttachModeL
       
   459 
       
   460 TInt CPacketServicesDispatcher::DispatchGetPacketNetworkRegistrationStatusL()
       
   461 /**
       
   462  * Pass EPacketGetNtwkRegStatus request on to Licensee LTSY.
       
   463  *
       
   464  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   465  * the Licensee LTSY does not support this request.
       
   466  */
       
   467 	{
       
   468 	TSYLOGENTRYEXIT;
       
   469 	TInt ret = KErrNotSupported;
       
   470 	
       
   471 	if (iLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatus)
       
   472 		{
       
   473 		ret = iLtsyDispatchPacketServicesGetPacketNetworkRegistrationStatus->HandleGetPacketNetworkRegistrationStatusReqL();
       
   474 		}
       
   475 
       
   476 	return TSYLOGSETEXITERR(ret);
       
   477 	} // CPacketServicesDispatcher::DispatchGetPacketNetworkRegistrationStatusL
       
   478 
       
   479 TInt CPacketServicesDispatcher::DispatchPacketDetachL()
       
   480 /**
       
   481  * Pass request on to Licensee LTSY.
       
   482  *
       
   483  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   484  * the Licensee LTSY does not support this request.
       
   485  *
       
   486  * @see RPacketService::Detach()
       
   487  */
       
   488 	{
       
   489 	TSYLOGENTRYEXIT;
       
   490 	TInt ret = KErrNotSupported;
       
   491 
       
   492 	// Unpack data for this request inside the if statement if required,
       
   493 	if (iLtsyDispatchPacketServicesPacketDetach)
       
   494 		{
       
   495 		ret = iLtsyDispatchPacketServicesPacketDetach->HandlePacketDetachReqL();
       
   496 		}
       
   497 
       
   498 	return TSYLOGSETEXITERR(ret);
       
   499 	} // CPacketServicesDispatcher::DispatchPacketDetachL
       
   500 
       
   501 TInt CPacketServicesDispatcher::DispatchSetPdpContextConfigL(const CMmDataPackage* aDataPackage)
       
   502 /**
       
   503  * Unpack data related to EPacketContextSetConfig
       
   504  * and pass request on to Licensee LTSY.
       
   505  * 
       
   506  * The following function uses a PCO buffer: 
       
   507  * The purpose of the protocol configuration options (PCO) is to transfer external network protocol options 
       
   508  * associated with a PDP context activation, and transfer additional (protocol) data 
       
   509  * (e.g. configuration parameters, error codes or messages/events) associated with an external protocol 
       
   510  * or an application.
       
   511  * The protocol configuration options (PCO) is a type 4 information element with a minimum length of 3 
       
   512  * octets and a maximum length of 253 octets
       
   513  * In order to generate the PCO buffer a TTlvStruct object is being used. The TTlvStruct wraps the buffers  
       
   514  * inserted to the PCO and identifies the buffers with given IDs.
       
   515  * 
       
   516  *
       
   517  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   518  * the Licensee LTSY does not support this request.
       
   519  */
       
   520 	{
       
   521 	TSYLOGENTRYEXIT;
       
   522 	TInt ret = KErrNotSupported;
       
   523 
       
   524 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   525 
       
   526 	// Call Handle... method in Licensee LTSY
       
   527 	if (iLtsyDispatchPacketServicesSetPdpContextConfig)
       
   528 		{
       
   529 		TInfoName* contextId = NULL;
       
   530 		TPacketDataConfigBase* generalConfig = NULL;
       
   531 
       
   532 		aDataPackage->UnPackData(&generalConfig, &contextId);
       
   533 
       
   534 		__ASSERT_DEBUG(generalConfig, CtsyDispatcherPanic(EInvalidNullPtr));
       
   535 		__ASSERT_DEBUG(contextId, CtsyDispatcherPanic(EInvalidNullPtr));
       
   536 		
       
   537 		switch(generalConfig->ExtensionId())
       
   538 			{
       
   539 			case TPacketDataConfigBase::KConfigGPRS:
       
   540 				{
       
   541 				RPacketContext::TContextConfigGPRS* configGPRS = static_cast<RPacketContext::TContextConfigGPRS*>(generalConfig);
       
   542 
       
   543 				// Protocol Config Option handling
       
   544 				RPacketContext::TMiscProtocolBuffer pcoBuffer;
       
   545 				pcoBuffer.Zero();
       
   546 				TPtr8 pcoPtr (const_cast<TUint8*> (pcoBuffer.Ptr()), RPacketContext::KMiscProtocolBufferLength);
       
   547 
       
   548 				TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> tlv(pcoPtr,0);
       
   549 
       
   550 				TBuf8<KMaxUserAndPassLength> usernameAndPasswordBuffer(KMaxUserAndPassLength);
       
   551 				
       
   552 				// Generates the username, password and requestID buffer as described in 3GPP specification 3G TS 24.008
       
   553 				ConvertUsernameAndPasswordToPCOBuffer(configGPRS->iProtocolConfigOption.iAuthInfo.iUsername, configGPRS->iProtocolConfigOption.iAuthInfo.iPassword, configGPRS->iProtocolConfigOption.iId, usernameAndPasswordBuffer);
       
   554 
       
   555 				TPtr8 usernameAndPasswordParamDataPtr(const_cast<TUint8*>(usernameAndPasswordBuffer.Ptr()),
       
   556 						usernameAndPasswordBuffer.Length(), usernameAndPasswordBuffer.Length());
       
   557 
       
   558 				TBuf8<KMaxPdpAddressLength> primaryAndSecondaryDNSBuffer(KPrimaryAndSecondaryDNSLength + 1);
       
   559 				
       
   560 				// Generates the primary and secondary DNS buffers as described in 3GPP specification 3G TS 24.008
       
   561 				ConvertDNSToPCOBuffer(configGPRS->iProtocolConfigOption.iDnsAddresses.iPrimaryDns, configGPRS->iProtocolConfigOption.iDnsAddresses.iSecondaryDns, configGPRS->iProtocolConfigOption.iId+1, primaryAndSecondaryDNSBuffer);
       
   562 
       
   563 				// Setting the configurations buffers
       
   564 				TPtr8 primaryAndSecondaryDNSParamDataPtr(const_cast<TUint8*>(primaryAndSecondaryDNSBuffer.Ptr()),
       
   565 						primaryAndSecondaryDNSBuffer.Length(), primaryAndSecondaryDNSBuffer.Length());
       
   566 
       
   567 				// Set up the TTlvStruct to include the pco details
       
   568 				RPacketContext::TPcoId primaryAndSecondaryDNSID(KPrimaryAndSecondaryDNSID);
       
   569 				RPacketContext::TPcoId usenameAndPasswordID(KUsenamePasswordDNSID);
       
   570 
       
   571 				if (tlv.AppendItemL(usenameAndPasswordID, usernameAndPasswordParamDataPtr) !=  KErrOverflow)
       
   572 					{
       
   573 					if (tlv.AppendItemL(primaryAndSecondaryDNSID, primaryAndSecondaryDNSParamDataPtr) != KErrOverflow)
       
   574 						{
       
   575 						pcoBuffer.SetLength(primaryAndSecondaryDNSParamDataPtr.Length() + usernameAndPasswordParamDataPtr.Length() + 2 * KIDLength);
       
   576 						pcoBuffer.Append(configGPRS->iProtocolConfigOption.iMiscBuffer);
       
   577 						ret = iLtsyDispatchPacketServicesSetPdpContextConfig->HandleSetPdpContextConfigReqL(*contextId, configGPRS->iAccessPointName,
       
   578 								configGPRS->iPdpType, configGPRS->iPdpAddress, pcoBuffer);
       
   579 						}
       
   580 					else
       
   581 						{
       
   582 						ret = KErrNotSupported;
       
   583 						}
       
   584 					}
       
   585 				else
       
   586 					{
       
   587 					ret = KErrNotSupported;
       
   588 					}
       
   589 				}
       
   590 				break;
       
   591 			case TPacketDataConfigBase::KConfigRel99Rel4:
       
   592 				{
       
   593 				RPacketContext::TContextConfigR99_R4* contextConfigR99R4 = static_cast<RPacketContext::TContextConfigR99_R4*>(generalConfig);
       
   594 
       
   595 				// Protocol Config Option handling
       
   596 				RPacketContext::TMiscProtocolBuffer pcoBuffer;
       
   597 				pcoBuffer.Zero();
       
   598 				TPtr8 pcoPtr (const_cast<TUint8*> (pcoBuffer.Ptr()), RPacketContext::KMiscProtocolBufferLength);
       
   599 
       
   600 				TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> tlv(pcoPtr,0);
       
   601 
       
   602 				TBuf8<KMaxUserAndPassLength> usernameAndPasswordBuffer(KMaxUserAndPassLength);
       
   603 
       
   604 				// Generates the username, password and requestID buffer as described in 3GPP specification 3G TS 24.008
       
   605 				ConvertUsernameAndPasswordToPCOBuffer(contextConfigR99R4->iProtocolConfigOption.iAuthInfo.iUsername, contextConfigR99R4->iProtocolConfigOption.iAuthInfo.iPassword, contextConfigR99R4->iProtocolConfigOption.iId, usernameAndPasswordBuffer);
       
   606 
       
   607 				TPtr8 usernameAndPasswordParamDataPtr(const_cast<TUint8*>(usernameAndPasswordBuffer.Ptr()),
       
   608 						usernameAndPasswordBuffer.Length(), usernameAndPasswordBuffer.Length());
       
   609 				
       
   610 				TBuf8<KMaxPdpAddressLength> primaryAndSecondaryDNSBuffer(KPrimaryAndSecondaryDNSLength + 1);
       
   611 				
       
   612 				// Generates the primary and secondary DNS buffers as described in 3GPP specification 3G TS 24.008
       
   613 				ConvertDNSToPCOBuffer(contextConfigR99R4->iProtocolConfigOption.iDnsAddresses.iPrimaryDns, contextConfigR99R4->iProtocolConfigOption.iDnsAddresses.iSecondaryDns, contextConfigR99R4->iProtocolConfigOption.iId+1, primaryAndSecondaryDNSBuffer);
       
   614 
       
   615 				// Setting the configurations buffers
       
   616 				TPtr8 primaryAndSecondaryDNSParamDataPtr(const_cast<TUint8*>(primaryAndSecondaryDNSBuffer.Ptr()),
       
   617 						primaryAndSecondaryDNSBuffer.Length(), primaryAndSecondaryDNSBuffer.Length());
       
   618 
       
   619 				// Set up the TTlvStruct to include the pco details
       
   620 				RPacketContext::TPcoId usenameAndPasswordID(KUsenamePasswordDNSID);
       
   621 				RPacketContext::TPcoId primaryAndSecondaryDNSID(KPrimaryAndSecondaryDNSID);
       
   622 
       
   623 				if (tlv.AppendItemL(usenameAndPasswordID, usernameAndPasswordParamDataPtr) !=  KErrOverflow)
       
   624 					{
       
   625 					if (tlv.AppendItemL(primaryAndSecondaryDNSID, primaryAndSecondaryDNSParamDataPtr) != KErrOverflow)
       
   626 						{
       
   627 						pcoBuffer.SetLength(primaryAndSecondaryDNSParamDataPtr.Length() + usernameAndPasswordParamDataPtr.Length() + 2 * KIDLength);
       
   628 						pcoBuffer.Append(contextConfigR99R4->iProtocolConfigOption.iMiscBuffer);
       
   629 						ret = iLtsyDispatchPacketServicesSetPdpContextConfig->HandleSetPdpContextConfigReqL(*contextId, contextConfigR99R4->iAccessPointName,
       
   630 								contextConfigR99R4->iPdpType, contextConfigR99R4->iPdpAddress, pcoBuffer);
       
   631 						}
       
   632 					else
       
   633 						{
       
   634 						ret = KErrNotSupported;
       
   635 						}
       
   636 					}
       
   637 				else
       
   638 					{
       
   639 					ret = KErrNotSupported;
       
   640 					}
       
   641 				}
       
   642 				break;
       
   643 			case TPacketDataConfigBase::KConfigRel5:
       
   644 				{
       
   645 				RPacketContext::TContextConfig_R5* contextConfigR95 = static_cast<RPacketContext::TContextConfig_R5*>(generalConfig);
       
   646 
       
   647 				// Protocol Config Option handling
       
   648 				RPacketContext::TMiscProtocolBuffer pcoBuffer;
       
   649 				pcoBuffer.Zero();
       
   650 				TPtr8 pcoPtr (const_cast<TUint8*> (pcoBuffer.Ptr()), RPacketContext::KMiscProtocolBufferLength);
       
   651 
       
   652 				TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> tlv(pcoPtr,0);
       
   653 
       
   654 				TBuf8<KMaxUserAndPassLength> usernameAndPasswordBuffer(KMaxUserAndPassLength);
       
   655 				
       
   656 				// Generates the username, password and requestID buffer as described in 3GPP specification 3G TS 24.008
       
   657 				ConvertUsernameAndPasswordToPCOBuffer(contextConfigR95->iProtocolConfigOption.iAuthInfo.iUsername, contextConfigR95->iProtocolConfigOption.iAuthInfo.iPassword, contextConfigR95->iProtocolConfigOption.iId, usernameAndPasswordBuffer);
       
   658 
       
   659 				TPtr8 usernameAndPasswordParamDataPtr(const_cast<TUint8*>(usernameAndPasswordBuffer.Ptr()),
       
   660 						usernameAndPasswordBuffer.Length(), usernameAndPasswordBuffer.Length());
       
   661 
       
   662 				TBuf8<KMaxPdpAddressLength> primaryAndSecondaryDNSBuffer(KPrimaryAndSecondaryDNSLength + 1);
       
   663 
       
   664 				// Generates the primary and secondary DNS buffers as described in 3GPP specification 3G TS 24.008
       
   665 				ConvertDNSToPCOBuffer(contextConfigR95->iProtocolConfigOption.iDnsAddresses.iPrimaryDns, contextConfigR95->iProtocolConfigOption.iDnsAddresses.iSecondaryDns, contextConfigR95->iProtocolConfigOption.iId+1, primaryAndSecondaryDNSBuffer);
       
   666 
       
   667 				// Setting the configurations buffers
       
   668 				TPtr8 primaryAndSecondaryDNSParamDataPtr(const_cast<TUint8*>(primaryAndSecondaryDNSBuffer.Ptr()),
       
   669 						primaryAndSecondaryDNSBuffer.Length(), primaryAndSecondaryDNSBuffer.Length());
       
   670 
       
   671 				// Set up the TTlvStruct to include the pco details
       
   672 				RPacketContext::TPcoId primaryAndSecondaryDNSID(KPrimaryAndSecondaryDNSID);
       
   673 				RPacketContext::TPcoId usenameAndPasswordID(KUsenamePasswordDNSID);
       
   674 
       
   675 				if (tlv.AppendItemL(usenameAndPasswordID, usernameAndPasswordParamDataPtr) !=  KErrOverflow)
       
   676 					{
       
   677 					if (tlv.AppendItemL(primaryAndSecondaryDNSID, primaryAndSecondaryDNSParamDataPtr) != KErrOverflow)
       
   678 						{
       
   679 						pcoBuffer.SetLength(primaryAndSecondaryDNSParamDataPtr.Length() + usernameAndPasswordParamDataPtr.Length() + 2 * KIDLength);
       
   680 						pcoBuffer.Append(contextConfigR95->iProtocolConfigOption.iMiscBuffer);
       
   681 						ret = iLtsyDispatchPacketServicesSetPdpContextConfig->HandleSetPdpContextConfigReqL(*contextId, contextConfigR95->iAccessPointName, contextConfigR95->iPdpType, contextConfigR95->iPdpAddress, pcoBuffer);
       
   682 						}
       
   683 					else
       
   684 						{
       
   685 						ret = KErrNotSupported;
       
   686 						}
       
   687 					}
       
   688 				else
       
   689 					{
       
   690 					ret = KErrNotSupported;
       
   691 					}
       
   692 				}
       
   693 				break;
       
   694 			default:
       
   695 				ret = KErrNotSupported;
       
   696 				break;
       
   697 			}
       
   698 		}
       
   699 	return TSYLOGSETEXITERR(ret);
       
   700 	} // CPacketServicesDispatcher::DispatchSetPdpContextConfigL
       
   701 
       
   702 TInt CPacketServicesDispatcher::DispatchModifyActivePdpContextL(const CMmDataPackage* aDataPackage)
       
   703 /**
       
   704  * Unpack data related to EPacketContextModifyActiveContext
       
   705  * and pass request on to Licensee LTSY.
       
   706  *
       
   707  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   708  * the Licensee LTSY does not support this request.
       
   709  */
       
   710 	{
       
   711 	TSYLOGENTRYEXIT;
       
   712 	TInt ret = KErrNotSupported;
       
   713 
       
   714 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   715 
       
   716 	if (iLtsyDispatchPacketServicesModifyActivePdpContext)
       
   717 		{
       
   718 		TInfoName* contextName = NULL;
       
   719 		aDataPackage->UnPackData( &contextName );
       
   720 		
       
   721 		__ASSERT_DEBUG(contextName, CtsyDispatcherPanic(EInvalidNullPtr));
       
   722 
       
   723 		ret = iLtsyDispatchPacketServicesModifyActivePdpContext->HandleModifyActivePdpContextReqL(*contextName);
       
   724 		}
       
   725 		
       
   726 	return TSYLOGSETEXITERR(ret);
       
   727 	} // CPacketServicesDispatcher::DispatchModifyActivePdpContextL
       
   728 
       
   729 TInt CPacketServicesDispatcher::DispatchInitialisePdpContextL(const CMmDataPackage* aDataPackage)
       
   730 /**
       
   731  * Unpack data related to EPacketContextInitialiseContext
       
   732  * and pass request on to Licensee LTSY.
       
   733  *
       
   734  * @param aDataPackage Package primary and secondary context names
       
   735  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   736  * the Licensee LTSY does not support this request.
       
   737  *
       
   738  * @see RPacketContext::InitialiseContext()
       
   739  *
       
   740  */
       
   741 	{
       
   742 	TSYLOGENTRYEXIT;
       
   743 	TInt ret = KErrNotSupported;
       
   744 
       
   745 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   746 
       
   747 	// Call Handle... method in Licensee LTSY
       
   748 	if (iLtsyDispatchPacketServicesInitialisePdpContext)
       
   749 		{
       
   750 	
       
   751 		TInfoName* contextName = NULL;
       
   752 		TInfoName* hostCID = NULL;
       
   753 
       
   754 		aDataPackage->UnPackData( &contextName, &hostCID );
       
   755 		
       
   756 		__ASSERT_DEBUG(contextName, CtsyDispatcherPanic(EInvalidNullPtr));
       
   757 		__ASSERT_DEBUG(hostCID, CtsyDispatcherPanic(EInvalidNullPtr));	
       
   758 
       
   759 		if (hostCID->Length() == 0) // this is not a secondary context request
       
   760 			{
       
   761 			ret = iLtsyDispatchPacketServicesInitialisePdpContext->HandleInitialisePdpContextReqL(*contextName, KEmptyInfoName);
       
   762 			}
       
   763 		else // secondary context request also needs primary context name
       
   764 			{
       
   765 			ret = iLtsyDispatchPacketServicesInitialisePdpContext->HandleInitialisePdpContextReqL(*hostCID, *contextName);
       
   766 			}
       
   767 
       
   768 		}
       
   769 	
       
   770 	return TSYLOGSETEXITERR(ret);
       
   771 	} // CPacketServicesDispatcher::DispatchInitialisePdpContextL
       
   772 
       
   773 TInt CPacketServicesDispatcher::DispatchDeletePdpContextL(const CMmDataPackage* aDataPackage)
       
   774 /**
       
   775  * Unpack data related to EPacketContextDelete
       
   776  * and pass request on to Licensee LTSY.
       
   777  *
       
   778  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   779  * the Licensee LTSY does not support this request.
       
   780  *
       
   781  * @see RPacketContext::Delete()
       
   782  */
       
   783 	{
       
   784 	TSYLOGENTRYEXIT;
       
   785 	TInt ret = KErrNotSupported;
       
   786 
       
   787 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   788 
       
   789 	if (iLtsyDispatchPacketServicesDeletePdpContext)
       
   790 		{
       
   791 		// Unpack the deleted context name.
       
   792 		TInfoName* contextName = NULL;
       
   793 		aDataPackage->UnPackData(&contextName);
       
   794 
       
   795 		__ASSERT_DEBUG(contextName, CtsyDispatcherPanic(EInvalidNullPtr));
       
   796 		
       
   797 		ret = iLtsyDispatchPacketServicesDeletePdpContext->HandleDeletePdpContextReqL(*contextName);
       
   798 		}
       
   799 		
       
   800 	return TSYLOGSETEXITERR(ret);
       
   801 	} // CPacketServicesDispatcher::DispatchDeletePdpContextL
       
   802 
       
   803 TInt CPacketServicesDispatcher::DispatchSetPacketAttachModeL(const CMmDataPackage* aDataPackage)
       
   804 /**
       
   805  * Unpack data related to EPacketSetAttachMode
       
   806  * and pass request on to Licensee LTSY.
       
   807  *
       
   808  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   809  * the Licensee LTSY does not support this request.
       
   810  */
       
   811 	{
       
   812 	TSYLOGENTRYEXIT;
       
   813 	TInt ret = KErrNotSupported;
       
   814 
       
   815 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   816 
       
   817 	if (iLtsyDispatchPacketServicesSetPacketAttachMode)
       
   818 		{
       
   819 		RPacketService::TAttachMode attachMode;
       
   820 		aDataPackage->UnPackData(attachMode);
       
   821 
       
   822 		ret = iLtsyDispatchPacketServicesSetPacketAttachMode->HandleSetPacketAttachModeReqL(attachMode);
       
   823 		}
       
   824 
       
   825 	return TSYLOGSETEXITERR(ret);
       
   826 	} // CPacketServicesDispatcher::DispatchSetPacketAttachModeL
       
   827 
       
   828 TInt CPacketServicesDispatcher::DispatchGetStatusL()
       
   829 /**
       
   830  * Pass request on to Licensee LTSY.
       
   831  *
       
   832  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   833  * the Licensee LTSY does not support this request.
       
   834  */
       
   835 	{
       
   836 	TSYLOGENTRYEXIT;
       
   837 	TInt ret = KErrNotSupported;
       
   838 	
       
   839 	if (iLtsyDispatchPacketServicesGetStatus)
       
   840 		{
       
   841 		ret = iLtsyDispatchPacketServicesGetStatus->HandleGetStatusReqL();
       
   842 		}
       
   843 
       
   844 	return TSYLOGSETEXITERR(ret);
       
   845 	} // CPacketServicesDispatcher::DispatchGetStatusL
       
   846 
       
   847 
       
   848 TInt CPacketServicesDispatcher::DispatchSetDefaultPdpContextParamsL(const CMmDataPackage* aDataPackage)
       
   849 /**
       
   850  * Unpack data related to EPacketSetDefaultContextParams
       
   851  * and pass request on to Licensee LTSY.
       
   852  *
       
   853  * @param aDataPackage Packaged configuration parameters, either GPRS or R99
       
   854  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   855  * the Licensee LTSY does not support this request.
       
   856  */
       
   857 	{
       
   858 	TSYLOGENTRYEXIT;
       
   859 	TInt ret = KErrNotSupported;
       
   860 
       
   861 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   862 
       
   863 	TPacketDataConfigBase* arg1 = NULL;
       
   864 	aDataPackage->UnPackData( &arg1 );
       
   865 
       
   866 	__ASSERT_DEBUG(arg1, CtsyDispatcherPanic(EInvalidNullPtr));
       
   867 	
       
   868 	switch(arg1->ExtensionId())
       
   869 		{
       
   870 		case TPacketDataConfigBase::KConfigGPRS:
       
   871        		{
       
   872        		if(iLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams)
       
   873        			{
       
   874            		const RPacketContext::TContextConfigGPRS& contextConfigGprs = *static_cast<RPacketContext::TContextConfigGPRS*>(arg1);
       
   875            		ret = iLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams->HandleSetDefaultPdpContextGprsParamsReqL(contextConfigGprs);
       
   876        			}
       
   877        		}
       
   878        		break;
       
   879 
       
   880 		case TPacketDataConfigBase::KConfigRel99Rel4:
       
   881        		{
       
   882        		if(iLtsyDispatchPacketServicesSetDefaultPdpContextR99R4Params)
       
   883        			{
       
   884            		const RPacketContext::TContextConfigR99_R4& contextConfigR99R4 = *static_cast<RPacketContext::TContextConfigR99_R4*>(arg1);
       
   885            		ret = iLtsyDispatchPacketServicesSetDefaultPdpContextR99R4Params->HandleSetDefaultPdpContextR99R4ParamsReqL(contextConfigR99R4);
       
   886        			}
       
   887        		}
       
   888        		break;
       
   889 
       
   890 		case TPacketDataConfigBase::KConfigRel5:
       
   891 		case TPacketDataConfigBase::KConfigCDMA:
       
   892 		default:
       
   893        		break;
       
   894 		}
       
   895 		
       
   896 	return TSYLOGSETEXITERR(ret);
       
   897 	} // CPacketServicesDispatcher::DispatchSetDefaultPdpContextParamsL
       
   898 
       
   899 TInt CPacketServicesDispatcher::DispatchActivatePdpContextL(const CMmDataPackage* aDataPackage)
       
   900 /**
       
   901  * Unpack data related to EPacketContextActivate
       
   902  * and pass request on to Licensee LTSY.
       
   903  *
       
   904  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   905  * the Licensee LTSY does not support this request.
       
   906  *
       
   907  * @see RPacketContext::Activate()
       
   908  */
       
   909 	{
       
   910 	TSYLOGENTRYEXIT;
       
   911 	TInt ret = KErrNotSupported;
       
   912 
       
   913 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   914 
       
   915 	// Call Handle... method in Licensee LTSY
       
   916 	if (iLtsyDispatchPacketServicesActivatePdpContext)
       
   917 		{
       
   918 		// Unpack the activated context name.
       
   919 		TInfoName* contextName = NULL;
       
   920 		aDataPackage->UnPackData(&contextName);
       
   921 
       
   922 		__ASSERT_DEBUG(contextName, CtsyDispatcherPanic(EInvalidNullPtr));
       
   923 		
       
   924 		ret = iLtsyDispatchPacketServicesActivatePdpContext->HandleActivatePdpContextReqL(*contextName);
       
   925 		}
       
   926 		
       
   927 	return TSYLOGSETEXITERR(ret);
       
   928 	} // CPacketServicesDispatcher::DispatchActivatePdpContextL
       
   929 
       
   930 TInt CPacketServicesDispatcher::DispatchSetPdpContextQosL(const CMmDataPackage* aDataPackage)
       
   931 /**
       
   932  * Unpack data related to EPacketQoSSetProfileParams
       
   933  * and pass request on to Licensee LTSY.
       
   934  *
       
   935  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
   936  * the Licensee LTSY does not support this request.
       
   937  *
       
   938  * @see RPacketQoS::SetProfileParameters()
       
   939  */
       
   940 	{
       
   941 	TSYLOGENTRYEXIT;
       
   942 	TInt ret = KErrNotSupported;
       
   943 
       
   944 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
   945 
       
   946 	TContextParams*	contextParams = NULL;
       
   947 	TDes8** qosProfile = NULL;
       
   948 
       
   949 	aDataPackage->UnPackData(&contextParams, &qosProfile);
       
   950 	
       
   951 	__ASSERT_DEBUG(contextParams, CtsyDispatcherPanic(EInvalidNullPtr));
       
   952 	__ASSERT_DEBUG(qosProfile, CtsyDispatcherPanic(EInvalidNullPtr));
       
   953 
       
   954 	TPckg<TPacketDataConfigBase>& profilePckg = *static_cast<TPckg<TPacketDataConfigBase>*>(*qosProfile);
       
   955 
       
   956 	TPacketDataConfigBase& profile = profilePckg();	
       
   957 	
       
   958 	// Get what client has requested
       
   959 	switch(profile.ExtensionId())
       
   960 		{
       
   961 		case TPacketDataConfigBase::KConfigGPRS:
       
   962 			{
       
   963 			if(iLtsyDispatchPacketServicesSetPdpContextQosGprs)
       
   964 				{
       
   965 		        TPckg<RPacketQoS::TQoSGPRSRequested>& gprsProfilePckg = *static_cast<TPckg<RPacketQoS::TQoSGPRSRequested>*>(*qosProfile);
       
   966 		        RPacketQoS::TQoSGPRSRequested& gprsProfile = gprsProfilePckg();
       
   967 		        ret = iLtsyDispatchPacketServicesSetPdpContextQosGprs->HandleSetPdpContextQosGprsReqL(contextParams->iContextName, gprsProfile);
       
   968 				}
       
   969         	}
       
   970 			break;
       
   971 		case TPacketDataConfigBase::KConfigRel99Rel4:
       
   972 			{
       
   973 			if(iLtsyDispatchPacketServicesSetPdpContextQosR99R4)
       
   974 				{
       
   975 				TPckg<RPacketQoS::TQoSR99_R4Requested>& r99r4ProfilePckg = *static_cast<TPckg<RPacketQoS::TQoSR99_R4Requested>*>(*qosProfile);
       
   976 				RPacketQoS::TQoSR99_R4Requested& r99r4Profile = r99r4ProfilePckg();
       
   977 				ret = iLtsyDispatchPacketServicesSetPdpContextQosR99R4->HandleSetPdpContextQosR99R4ReqL(contextParams->iContextName, r99r4Profile);
       
   978 				}
       
   979 			}
       
   980 			break;
       
   981 		case TPacketDataConfigBase::KConfigRel5:
       
   982 			{
       
   983 			if(iLtsyDispatchPacketServicesSetPdpContextQosR5)
       
   984 				{
       
   985 				TPckg<RPacketQoS::TQoSR5Requested>& r5ProfilePckg = *static_cast<TPckg<RPacketQoS::TQoSR5Requested>*>(*qosProfile);
       
   986 		        RPacketQoS::TQoSR5Requested& r5Profile = r5ProfilePckg();
       
   987 		        ret = iLtsyDispatchPacketServicesSetPdpContextQosR5->HandleSetPdpContextQosR5ReqL(contextParams->iContextName, r5Profile);
       
   988 				}
       
   989 			}
       
   990 			break;
       
   991 		default:
       
   992        		ret = KErrNotSupported;
       
   993        		break;
       
   994 		}
       
   995 		
       
   996 	return TSYLOGSETEXITERR(ret);
       
   997 	} // CPacketServicesDispatcher::DispatchSetPdpContextQosL
       
   998 
       
   999 TInt CPacketServicesDispatcher::DispatchRejectNetworkInitiatedContextActivationRequestL()
       
  1000 /**
       
  1001  * Pass request on to Licensee LTSY.
       
  1002  *
       
  1003  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1004  * the Licensee LTSY does not support this request.
       
  1005  *
       
  1006  * @see RPacketService::RejectActivationRequest()
       
  1007  */
       
  1008 	{
       
  1009 	TSYLOGENTRYEXIT;
       
  1010 	TInt ret = KErrNotSupported;
       
  1011 	
       
  1012 	if (iLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequest)
       
  1013 		{
       
  1014 		ret = iLtsyDispatchPacketServicesRejectNetworkInitiatedContextActivationRequest->HandleRejectNetworkInitiatedContextActivationRequestReqL();
       
  1015 		}
       
  1016 
       
  1017 	return TSYLOGSETEXITERR(ret);
       
  1018 	} // CPacketServicesDispatcher::DispatchRejectNetworkInitiatedContextActivationRequestL
       
  1019 
       
  1020 TInt CPacketServicesDispatcher::DispatchDeactivatePdpContextL(const CMmDataPackage* aDataPackage)
       
  1021 /**
       
  1022  * Unpack data related to EPacketContextDeactivate
       
  1023  * and pass request on to Licensee LTSY.
       
  1024  *
       
  1025  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1026  * the Licensee LTSY does not support this request.
       
  1027  *
       
  1028  * @see RPacketContext::Deactivate()
       
  1029  */
       
  1030 	{
       
  1031 	TSYLOGENTRYEXIT;
       
  1032 	TInt ret = KErrNotSupported;
       
  1033 
       
  1034 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1035 
       
  1036 	// Call Handle... method in Licensee LTSY
       
  1037 	if (iLtsyDispatchPacketServicesDeactivatePdpContext)
       
  1038 		{
       
  1039 		TInfoName* contextName = NULL;
       
  1040 		aDataPackage->UnPackData( &contextName );
       
  1041 			
       
  1042 		__ASSERT_DEBUG(contextName, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1043 
       
  1044 		ret = iLtsyDispatchPacketServicesDeactivatePdpContext->HandleDeactivatePdpContextReqL(*contextName);
       
  1045 		}
       
  1046 		
       
  1047 	return TSYLOGSETEXITERR(ret);
       
  1048 	} // CPacketServicesDispatcher::DispatchDeactivatePdpContextL
       
  1049 
       
  1050 TInt CPacketServicesDispatcher::DispatchAddPacketFilterL(const CMmDataPackage* aDataPackage)
       
  1051 /**
       
  1052  * Unpack data related to EPacketContextAddPacketFilter
       
  1053  * and pass request on to Licensee LTSY.
       
  1054  *
       
  1055  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1056  * the Licensee LTSY does not support this request.
       
  1057  * 
       
  1058  * @see RPacketContext::AddPacketFilter()
       
  1059  */
       
  1060 	{
       
  1061 	TSYLOGENTRYEXIT;
       
  1062 	TInt ret = KErrNotSupported;
       
  1063 
       
  1064 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1065 
       
  1066 	if (iLtsyDispatchPacketServicesAddPacketFilter)
       
  1067 		{
       
  1068 		TInfoName* secondaryContext = NULL;					
       
  1069 		CArrayFixFlat<RPacketContext::TPacketFilterV2>*  contextFilterArray = NULL;
       
  1070 					
       
  1071 		aDataPackage->UnPackData( &secondaryContext, &contextFilterArray);
       
  1072 		__ASSERT_DEBUG(secondaryContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1073 		__ASSERT_DEBUG(contextFilterArray, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1074 			
       
  1075 		ret = iLtsyDispatchPacketServicesAddPacketFilter->HandleAddPacketFilterSyncL(*secondaryContext, *contextFilterArray);
       
  1076 		}
       
  1077 
       
  1078 	return TSYLOGSETEXITERR(ret);
       
  1079 	} // CPacketServicesDispatcher::DispatchAddPacketFilterL
       
  1080 
       
  1081 TInt CPacketServicesDispatcher::DispatchRemovePacketFilterL(const CMmDataPackage* aDataPackage)
       
  1082 /**
       
  1083  * Unpack data related to EPacketContextRemovePacketFilter
       
  1084  * and pass request on to Licensee LTSY.
       
  1085  *
       
  1086  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1087  * the Licensee LTSY does not support this request.
       
  1088  * 
       
  1089  * @see RPacketContext::RemovePacketFilter()
       
  1090  */
       
  1091 	{
       
  1092 	TSYLOGENTRYEXIT;	
       
  1093 	TInt ret = KErrNotSupported;
       
  1094 	
       
  1095 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1096 
       
  1097 	if (iLtsyDispatchPacketServicesRemovePacketFilter)
       
  1098 		{
       
  1099 		TInfoName* secondaryContext = NULL;
       
  1100 		TInt* filterId = NULL;				
       
  1101 
       
  1102 		aDataPackage->UnPackData( &secondaryContext, &filterId);
       
  1103 		__ASSERT_DEBUG(secondaryContext, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1104 		__ASSERT_DEBUG(filterId, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1105 		ret = iLtsyDispatchPacketServicesRemovePacketFilter->HandleRemovePacketFilterSyncL(*secondaryContext, *filterId);
       
  1106 		}
       
  1107 
       
  1108 	return TSYLOGSETEXITERR(ret);
       
  1109 	} // CPacketServicesDispatcher::DispatchAddPacketFilterL
       
  1110 
       
  1111 TInt CPacketServicesDispatcher::DispatchGetStaticCapabilitiesL()
       
  1112 /**
       
  1113  * Pass request on to Licensee LTSY.
       
  1114  *
       
  1115  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1116  * the Licensee LTSY does not support this request.
       
  1117  */
       
  1118 	{
       
  1119 	TSYLOGENTRYEXIT;
       
  1120 	TInt ret = KErrNotSupported;
       
  1121 
       
  1122 	// Call Handle... method in Licensee LTSY
       
  1123 	if (iLtsyDispatchPacketServicesGetStaticCapabilities)
       
  1124 		{
       
  1125 		ret = iLtsyDispatchPacketServicesGetStaticCapabilities->HandleGetStaticCapabilitiesReqL();
       
  1126 		}
       
  1127 
       
  1128 	return TSYLOGSETEXITERR(ret);
       
  1129 	} // CPacketServicesDispatcher::DispatchGetStaticCapabilitiesL
       
  1130 
       
  1131 TInt CPacketServicesDispatcher::DispatchGetMaxNoMonitoredServiceListsL()
       
  1132 /**
       
  1133  * Pass request on to Licensee LTSY.
       
  1134  *
       
  1135  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1136  * the Licensee LTSY does not support this request.
       
  1137  */
       
  1138 	{
       
  1139 	TSYLOGENTRYEXIT;
       
  1140 	TInt ret = KErrNotSupported;
       
  1141 
       
  1142 	// Call Handle... method in Licensee LTSY
       
  1143 	if (iLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists)
       
  1144 		{
       
  1145 		ret = iLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists->HandleGetMaxNoMonitoredServiceListsReqL();
       
  1146 		}
       
  1147 
       
  1148 	return TSYLOGSETEXITERR(ret);
       
  1149 	} // CPacketServicesDispatcher::DispatchGetMaxNoMonitoredServiceListsL
       
  1150 
       
  1151 TInt CPacketServicesDispatcher::DispatchGetMaxNoActiveServicesL()
       
  1152 /**
       
  1153  * Pass request on to Licensee LTSY.
       
  1154  *
       
  1155  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1156  * the Licensee LTSY does not support this request.
       
  1157  */
       
  1158 	{
       
  1159 	TSYLOGENTRYEXIT;
       
  1160 	TInt ret = KErrNotSupported;
       
  1161 
       
  1162 	// Call Handle... method in Licensee LTSY
       
  1163 	if (iLtsyDispatchPacketServicesGetMaxNoActiveServices)
       
  1164 		{
       
  1165 		ret = iLtsyDispatchPacketServicesGetMaxNoActiveServices->HandleGetMaxNoActiveServicesReqL();
       
  1166 		}
       
  1167 
       
  1168 	return TSYLOGSETEXITERR(ret);
       
  1169 	} // CPacketServicesDispatcher::DispatchGetMaxNoActiveServicesL
       
  1170 
       
  1171 TInt CPacketServicesDispatcher::DispatchInitialiseMbmsContextL(const CMmDataPackage* aDataPackage)
       
  1172 /**
       
  1173  * Unpack data related to ECtsyPacketMbmsInitialiseContextReq
       
  1174  * and pass request on to Licensee LTSY.
       
  1175  *
       
  1176  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1177  * the Licensee LTSY does not support this request.
       
  1178  */
       
  1179 	{
       
  1180 	TSYLOGENTRYEXIT;
       
  1181 	TInt ret = KErrNotSupported;
       
  1182 
       
  1183 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1184 	
       
  1185 	// Call Handle... method in Licensee LTSY
       
  1186 	if (iLtsyDispatchPacketServicesInitialiseMbmsContext)	
       
  1187 		{
       
  1188 		
       
  1189 		TInfoName* contextName = NULL;
       
  1190 		aDataPackage->UnPackData(&contextName);
       
  1191 		__ASSERT_DEBUG(contextName, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1192 				
       
  1193 		ret = iLtsyDispatchPacketServicesInitialiseMbmsContext->HandleInitialiseMbmsContextReqL(*contextName);
       
  1194 		}
       
  1195 
       
  1196 	return TSYLOGSETEXITERR(ret);
       
  1197 	} // CPacketServicesDispatcher::DispatchInitialiseMbmsContextL
       
  1198 
       
  1199 TInt CPacketServicesDispatcher::DispatchGetMbmsNetworkServiceStatusL(const CMmDataPackage* aDataPackage)
       
  1200 /**
       
  1201  * Unpack data related to EPacketGetMbmsNetworkServiceStatus
       
  1202  * and pass request on to Licensee LTSY.
       
  1203  *
       
  1204  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1205  * the Licensee LTSY does not support this request.
       
  1206  */
       
  1207 	{
       
  1208 	TSYLOGENTRYEXIT;
       
  1209 	TInt ret = KErrNotSupported;
       
  1210 
       
  1211 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1212 	
       
  1213 	// Call Handle... method in Licensee LTSY
       
  1214 	if (iLtsyDispatchPacketServicesGetMbmsNetworkServiceStatus)	
       
  1215 		{
       
  1216 		TBool attemptAttach;
       
  1217 		aDataPackage->UnPackData(attemptAttach);
       
  1218 		
       
  1219 		ret = iLtsyDispatchPacketServicesGetMbmsNetworkServiceStatus->HandleGetMbmsNetworkServiceStatusReqL(attemptAttach);
       
  1220 		}
       
  1221 
       
  1222 	return TSYLOGSETEXITERR(ret);
       
  1223 	} // CPacketServicesDispatcher::DispatchGetMbmsNetworkServiceStatusL
       
  1224 
       
  1225 
       
  1226 TInt CPacketServicesDispatcher::DispatchUpdateMbmsMonitorServiceListL(const CMmDataPackage* aDataPackage)
       
  1227 /**
       
  1228  * Unpack data related to EPacketUpdateMbmsMonitorServiceList
       
  1229  * and pass request on to Licensee LTSY.
       
  1230  *
       
  1231  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1232  * the Licensee LTSY does not support this request.
       
  1233  */
       
  1234 	{
       
  1235 	TSYLOGENTRYEXIT;
       
  1236 	TInt ret = KErrNotSupported;
       
  1237 
       
  1238 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1239 	
       
  1240 	// Call Handle... method in Licensee LTSY
       
  1241 	if (iLtsyDispatchPacketServicesUpdateMbmsMonitorServiceList)	
       
  1242 		{
       
  1243 		TMmMbmsMonitorServiceListParams* mbmsMonitorServiceListParams = NULL;
       
  1244 		
       
  1245 		aDataPackage->UnPackData(&mbmsMonitorServiceListParams);
       
  1246 		__ASSERT_DEBUG(mbmsMonitorServiceListParams, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1247 		__ASSERT_DEBUG(mbmsMonitorServiceListParams->iServiceList, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1248 		__ASSERT_DEBUG(mbmsMonitorServiceListParams->iListOfChanges, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1249 		
       
  1250 		ret = iLtsyDispatchPacketServicesUpdateMbmsMonitorServiceList->HandleUpdateMbmsMonitorServiceListsReqL(	mbmsMonitorServiceListParams->iActionType,
       
  1251 																												*(mbmsMonitorServiceListParams->iServiceList),
       
  1252 																												*(mbmsMonitorServiceListParams->iListOfChanges));
       
  1253 		}
       
  1254 
       
  1255 	return TSYLOGSETEXITERR(ret);
       
  1256 	} // CPacketServicesDispatcher::DispatchUpdateMbmsMonitorServiceListL
       
  1257 
       
  1258 TInt CPacketServicesDispatcher::DispatchUpdateMbmsSessionListL(const CMmDataPackage* aDataPackage)
       
  1259 /**
       
  1260  * Unpack data related to EPacketContextUpdateMbmsSessionList
       
  1261  * and pass request on to Licensee LTSY.
       
  1262  *
       
  1263  * @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
       
  1264  * the Licensee LTSY does not support this request.
       
  1265  */
       
  1266 	{
       
  1267 	TSYLOGENTRYEXIT;
       
  1268 	TInt ret = KErrNotSupported;
       
  1269 
       
  1270 	__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1271 	
       
  1272 	// Call Handle... method in Licensee LTSY
       
  1273 	if (iLtsyDispatchPacketServicesUpdateMbmsSessionList)	
       
  1274 		{
       
  1275 		
       
  1276 		TInfoName* contextName = NULL;
       
  1277 		TMmMbmsActiveServiceListParams* mbmsActiveServiceListParams = NULL;
       
  1278 		aDataPackage->UnPackData(&contextName, &mbmsActiveServiceListParams);
       
  1279 		
       
  1280 		__ASSERT_DEBUG(contextName, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1281 		__ASSERT_DEBUG(mbmsActiveServiceListParams, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1282 		__ASSERT_DEBUG(mbmsActiveServiceListParams->iServiceList, CtsyDispatcherPanic(EInvalidNullPtr));
       
  1283 		
       
  1284 		ret = iLtsyDispatchPacketServicesUpdateMbmsSessionList->HandleUpdateMbmsSessionListReqL(*contextName, 
       
  1285 																								mbmsActiveServiceListParams->iActionType,
       
  1286 																								mbmsActiveServiceListParams->iChangedItem,
       
  1287 																								mbmsActiveServiceListParams->iServiceList->iSessionIdList);
       
  1288 		}
       
  1289 
       
  1290 	return TSYLOGSETEXITERR(ret);
       
  1291 	} // CPacketServicesDispatcher::DispatchUpdateMbmsSessionListL
       
  1292 
       
  1293 //
       
  1294 // Callback handlers follow
       
  1295 //
       
  1296 
       
  1297 void CPacketServicesDispatcher::CallbackNotifyPacketAttachModeChange(TInt aError, RPacketService::TPreferredBearer aBearer)
       
  1298 /**
       
  1299  * Callback function to be used by the request to complete
       
  1300  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyPacketAttachModeChangeInd()
       
  1301  *
       
  1302  * @param aError The error code.
       
  1303  * @param aBearer The new bearer.
       
  1304  */
       
  1305 	{
       
  1306 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aBearer=%d"), aError, aBearer);
       
  1307 	
       
  1308     // Pack the data to return to the Common TSY
       
  1309     CMmPacketDataPackage dataPackage;
       
  1310     dataPackage.PackData(&aBearer);
       
  1311     iMessageManagerCallback.Complete(EPacketNotifyAttachModeChange, &dataPackage, aError);	
       
  1312 	} // CPacketServicesDispatcher::CallbackNotifyPacketAttachModeChange
       
  1313 
       
  1314 void CPacketServicesDispatcher::CallbackNotifyQosProfileChange(TInt aError, const TDesC& aContextName,
       
  1315 		const RPacketQoS::TQoSGPRSNegotiated& aQoSGPRSNegotiated)
       
  1316 /**
       
  1317  * Callback function to be used by the Licensee LTSY to notify change in the GPRS QoS profile (IPCEPacketQoSNotifyProfileChanged).
       
  1318  *
       
  1319  * @param aError The error code.
       
  1320  * @param aContextName context name to be returned to the CTSY Dispatcher.
       
  1321  * @param aQoSGPRSNegotiated context negotiated GPRS QOS profile to be returned to the CTSY Dispatcher.
       
  1322  */
       
  1323 	{
       
  1324 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1325 
       
  1326 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1327 	
       
  1328 	CMmPacketDataPackage dataPackage;
       
  1329 	
       
  1330 	RPacketQoS::TQoSR99_R4Negotiated tempR99_R4Negotiated;
       
  1331 	TInt ret = EtelPcktR97NegToEtelPcktR99R4NegQoS(aQoSGPRSNegotiated, tempR99_R4Negotiated);
       
  1332 	RPacketQoS::TQoSR5Negotiated tempR5Negotiated;
       
  1333 	ret = EtelPcktR99R4NegToEtelPcktR5NegQoS(tempR99_R4Negotiated, tempR5Negotiated);
       
  1334 	dataPackage.SetProfileChanged(
       
  1335 		const_cast<RPacketQoS::TQoSGPRSNegotiated*>(&aQoSGPRSNegotiated),
       
  1336 		const_cast<RPacketQoS::TQoSR99_R4Negotiated*>(&tempR99_R4Negotiated),
       
  1337 		const_cast<RPacketQoS::TQoSR5Negotiated*>(&tempR5Negotiated));
       
  1338 	
       
  1339 	//CTSY unpacks as a TInfoName thus safe.
       
  1340 	dataPackage.PackData(const_cast<TDesC*>(&aContextName));
       
  1341 	iMessageManagerCallback.Complete(EPacketQoSNotifyProfileChanged, &dataPackage, aError);
       
  1342 
       
  1343 	} // CPacketServicesDispatcher::CallbackNotifyQosProfileChangedGPRS
       
  1344 
       
  1345 void CPacketServicesDispatcher::CallbackNotifyQosProfileChange(TInt aError,
       
  1346 		const TDesC& aContextName, const RPacketQoS::TQoSR99_R4Negotiated& aQoSR99_R4Negotiated)
       
  1347 /**
       
  1348  * Callback function to be used by the Licensee LTSY to notify change in the R99R4 QoS profile (IPCEPacketQoSNotifyProfileChanged).
       
  1349  *
       
  1350  * @param aError The error code.
       
  1351  * @param aContextName context name to be returned to the CTSY Dispatcher.
       
  1352  * @param aQoSR99_R4Negotiated context negotiated R99 QOS profile to be returned to the CTSY Dispatcher.
       
  1353  */
       
  1354 	{
       
  1355 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1356 
       
  1357 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1358 
       
  1359 	RPacketQoS::TQoSGPRSNegotiated  tempGPRSNegotiated;
       
  1360 	TInt ret = EtelPcktR99R4NegToEtelPcktR97NegQoS(aQoSR99_R4Negotiated, tempGPRSNegotiated);
       
  1361 	
       
  1362 	RPacketQoS::TQoSR5Negotiated tempR5Negotiated;
       
  1363 	ret = EtelPcktR99R4NegToEtelPcktR5NegQoS(aQoSR99_R4Negotiated, tempR5Negotiated);
       
  1364 
       
  1365 	CMmPacketDataPackage dataPackage;
       
  1366 	dataPackage.SetProfileChanged(
       
  1367 			const_cast<RPacketQoS::TQoSGPRSNegotiated*>(&tempGPRSNegotiated),
       
  1368 			const_cast<RPacketQoS::TQoSR99_R4Negotiated*>(&aQoSR99_R4Negotiated),
       
  1369 			const_cast<RPacketQoS::TQoSR5Negotiated*>(&tempR5Negotiated));
       
  1370 	
       
  1371 	//CTSY unpacks as a TInfoName thus safe.
       
  1372 	dataPackage.PackData(const_cast<TDesC*>(&aContextName));
       
  1373 	iMessageManagerCallback.Complete(EPacketQoSNotifyProfileChanged, &dataPackage, aError);
       
  1374 
       
  1375 	} // CPacketServicesDispatcher::CallbackNotifyQosProfileChangedR99
       
  1376 
       
  1377 void CPacketServicesDispatcher::CallbackNotifyQosProfileChange(TInt aError,
       
  1378 		const TDesC& aContextName, const RPacketQoS::TQoSR5Negotiated& aQoSR5Negotiated)
       
  1379 /**
       
  1380  * Callback function to be used by the request to complete
       
  1381  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyQosProfileChangedInd()
       
  1382  *
       
  1383  * @param aError The error code.
       
  1384  * @param aContextName Context name to be returned to the CTSY Dispatcher.
       
  1385  * @param aQoSR5Negotiated Context negotiated R5 QOS profile to be returned to the CTSY Dispatcher.
       
  1386  */
       
  1387 	{
       
  1388 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1389 
       
  1390 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1391 	
       
  1392 	const RPacketQoS::TQoSR99_R4Negotiated* tempR99_R4Negotiated = &aQoSR5Negotiated;
       
  1393 
       
  1394 	RPacketQoS::TQoSGPRSNegotiated tempGPRSNegotiated;
       
  1395 	EtelPcktR99R4NegToEtelPcktR97NegQoS(*tempR99_R4Negotiated, tempGPRSNegotiated);
       
  1396 
       
  1397 	CMmPacketDataPackage dataPackage;
       
  1398 
       
  1399 	dataPackage.SetProfileChanged(
       
  1400 		const_cast<RPacketQoS::TQoSGPRSNegotiated*>(&tempGPRSNegotiated),
       
  1401 		const_cast<RPacketQoS::TQoSR99_R4Negotiated*>(tempR99_R4Negotiated),
       
  1402 		const_cast<RPacketQoS::TQoSR5Negotiated*>(&aQoSR5Negotiated));
       
  1403 	
       
  1404 	//CTSY unpacks as a TInfoName thus safe.
       
  1405 	dataPackage.PackData(const_cast<TDesC*>(&aContextName));
       
  1406 	iMessageManagerCallback.Complete(EPacketQoSNotifyProfileChanged, &dataPackage, aError);
       
  1407 
       
  1408 	} // CPacketServicesDispatcher::CallbackNotifyQosProfileChangedR5
       
  1409 
       
  1410 void CPacketServicesDispatcher::CallbackNotifyRatTransferCapsChange(TInt aError, TDynamicTransferCapsFlags aCaps)
       
  1411 /**
       
  1412  * Callback function to be used by the request to complete
       
  1413  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyRatTransferCapsChangeInd()
       
  1414  *
       
  1415  * @param aError The error code.
       
  1416  * @param aCaps The capabilities flag.
       
  1417  *
       
  1418  * @see RPacketService::NotifyDynamicCapsChange()
       
  1419  */
       
  1420 	{
       
  1421 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aCaps=%d"), aError, aCaps);
       
  1422 
       
  1423 	// Pack the data to return to the Common TSY
       
  1424 	CMmPacketDataPackage dataPackage;
       
  1425 	dataPackage.PackData(&aCaps);
       
  1426 	iMessageManagerCallback.Complete(EPacketNotifyTransferCapsIPC, &dataPackage, aError);
       
  1427 	} // CPacketServicesDispatcher::CallbackNotifyRatTransferCapsChange
       
  1428 
       
  1429 void CPacketServicesDispatcher::CallbackNotifyPacketMsClassChange(TInt aError, RPacketService::TMSClass aMSClass)
       
  1430 /**
       
  1431  * Callback function to be used by the request to complete
       
  1432  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyPacketMsClassChangeInd()
       
  1433  *
       
  1434  * @param aError The error code.
       
  1435  * @param aMSClass MS class to be returned to the CTSY.
       
  1436  *
       
  1437  * @see RPacketService::NotifyMSClassChange()
       
  1438  */
       
  1439 	{
       
  1440 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aMSClass=%d"), aError, aMSClass);
       
  1441 	CMmDataPackage dataPackage;
       
  1442 	dataPackage.PackData(&aMSClass);
       
  1443 	iMessageManagerCallback.Complete(EPacketNotifyMSClassChange, &dataPackage, aError);
       
  1444 
       
  1445 	} // CPacketServicesDispatcher::CallbackNotifyPacketMsClassChange
       
  1446 
       
  1447 void CPacketServicesDispatcher::CallbackNotifyPacketDynamicCapsChange(TInt aError, TBool aGprsIsSupportedOnCell, TBool aCsServicesIsSupportedOnCell)
       
  1448 /**
       
  1449  * Callback function to be used by the request to complete
       
  1450  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyPacketDynamicCapsChangeInd()
       
  1451  *
       
  1452  * @param aError The error code.
       
  1453  * @param aGprsIsSupportedOnCell indication whether GPRS is supported and should be returned to the CTSY Dispatcher.
       
  1454  * @param aCsServicesIsSupportedOnCell indication whether CS services are supported and should be returned to the CTSY Dispatcher.
       
  1455  *
       
  1456  * @see RPacketService::NotifyDynamicCapsChange()
       
  1457  */
       
  1458 	{
       
  1459 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aGprsIsSupportedOnCell=%d, aCsServicesIsSupportedOnCell=%d"), aError, aGprsIsSupportedOnCell, aCsServicesIsSupportedOnCell);
       
  1460 	CMmDataPackage dataPackage;
       
  1461 	dataPackage.PackData(&aGprsIsSupportedOnCell, &aCsServicesIsSupportedOnCell);
       
  1462 	iMessageManagerCallback.Complete(EPacketNotifyDynamicCapsChange, &dataPackage, aError);
       
  1463 
       
  1464 	} // CPacketServicesDispatcher::CallbackNotifyPacketDynamicCapsChange
       
  1465 
       
  1466 void CPacketServicesDispatcher::CallbackNotifyPdpContextAdded(TInt aError, const TDesC& aContextName)
       
  1467 /**
       
  1468  * Callback function to be used by the request to complete
       
  1469  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyPdpContextAddedInd()
       
  1470  *
       
  1471  * @param aError The error code.
       
  1472  * @param aContextName PDP context name to be returned.
       
  1473  *
       
  1474  * @see RPacketService::NotifyContextAdded()
       
  1475  */
       
  1476 	{
       
  1477 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1478 
       
  1479 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1480 
       
  1481 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1482 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  1483 	
       
  1484 	CMmDataPackage dataPackage;
       
  1485 	dataPackage.PackData(&contextName, &aError);
       
  1486 	iMessageManagerCallback.Complete(EPacketNotifyContextAdded, &dataPackage, aError);
       
  1487 
       
  1488 	} // CPacketServicesDispatcher::CallbackNotifyPdpContextAdded
       
  1489 
       
  1490 void CPacketServicesDispatcher::CallbackNotifyNetworkInitiatedContextActivationRequest(TInt aError,
       
  1491 		const RPacketContext::TContextConfigGPRS& aContextConfigGPRS)
       
  1492 /**
       
  1493  * Callback function to be used by the request to complete
       
  1494  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyNetworkInitiatedContextActivationRequestInd()
       
  1495  *
       
  1496  * @param aError The error code.
       
  1497  * @param aContextConfigGPRS The GPRS context configuration to be returned to the CTSY Dispatcher.
       
  1498  */
       
  1499 	{
       
  1500 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aPdpType=%d"), aError, aContextConfigGPRS.iPdpType);
       
  1501 
       
  1502 	CMmDataPackage dataPackage;
       
  1503 	dataPackage.PackData(const_cast<RPacketContext::TContextConfigGPRS*> (&aContextConfigGPRS));
       
  1504 	iMessageManagerCallback.Complete(EPacketNotifyContextActivationRequested, &dataPackage, aError);
       
  1505 
       
  1506 	} // CPacketServicesDispatcher::CallbackNotifyNetworkInitiatedContextActivationRequest
       
  1507 
       
  1508 void CPacketServicesDispatcher::CallbackNotifyNetworkInitiatedContextActivationRequest(TInt aError,
       
  1509 		const RPacketContext::TContextConfigR99_R4& aContextConfigR99_R4)
       
  1510 /**
       
  1511  * Callback function to be used by the request to complete
       
  1512  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyNetworkInitiatedContextActivationRequestInd()
       
  1513  *
       
  1514  * @param aError The error code.
       
  1515  * @param aContextConfigR99_R4 The release 99 or release 4 context configuration to be returned to the CTSY Dispatcher.
       
  1516  */
       
  1517 	{
       
  1518 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aPdpType=%d"), aError, aContextConfigR99_R4.iPdpType);
       
  1519 
       
  1520 	CMmDataPackage dataPackage;
       
  1521 	dataPackage.PackData(const_cast<RPacketContext::TContextConfigR99_R4*> (&aContextConfigR99_R4));
       
  1522 	iMessageManagerCallback.Complete(EPacketNotifyContextActivationRequested, &dataPackage, aError);
       
  1523 
       
  1524 	} // CPacketServicesDispatcher::CallbackNotifyNetworkInitiatedContextActivationRequest
       
  1525 
       
  1526 void CPacketServicesDispatcher::CallbackNotifyNetworkInitiatedContextActivationRequest(TInt aError,
       
  1527 		const RPacketContext::TContextConfig_R5& aContextConfig_R5)
       
  1528 /**
       
  1529  * Callback function to be used by the request to complete
       
  1530  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyNetworkInitiatedContextActivationRequestInd()
       
  1531  *
       
  1532  * @param aError The error code.
       
  1533  * @param aContextConfig_R5 The release 5 context configuration to be returned to the CTSY Dispatcher.
       
  1534  */
       
  1535 	{
       
  1536 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aPdpType=%d"), aError, aContextConfig_R5.iPdpType);
       
  1537 
       
  1538 	CMmDataPackage dataPackage;
       
  1539 	dataPackage.PackData(const_cast<RPacketContext::TContextConfig_R5*> (&aContextConfig_R5));
       
  1540 	iMessageManagerCallback.Complete(EPacketNotifyContextActivationRequested, &dataPackage, aError);
       
  1541 
       
  1542 	} // CPacketServicesDispatcher::CallbackNotifyNetworkInitiatedContextActivationRequest
       
  1543 
       
  1544 
       
  1545 void CPacketServicesDispatcher::CallbackNotifyPdpContextConfigChanged(TInt aError,
       
  1546 		const TDesC& aContextName, const TDesC8& aAccessPointName,
       
  1547 		const TDesC8& aPdpAddress, TUint aPdpCompression, const TDesC8& aPcoBuffer)
       
  1548 /**
       
  1549  * Callback function to be used by the request to complete
       
  1550  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyPdpContextConfigChangedInd()
       
  1551  *
       
  1552  * @param aError The error code.
       
  1553  *
       
  1554  * @param aContextName The name of the context which the change in configuration refers to.
       
  1555  *
       
  1556  * @param aAccessPointName The name of the access point. This should be a descriptor of maximum length
       
  1557  * RPacketContext::KGSNNameLength such as a RPacketContext::TGSNAddress
       
  1558  *
       
  1559  * @param aPdpAddress The protocol address. This should be a descriptor of maximum length
       
  1560  * RPacketContext::KMaxPDPAddressLength such as a RPacketContext::TProtocolAddress
       
  1561  *
       
  1562  * @param aPdpCompression The PDP compression level.
       
  1563  *
       
  1564  * @param aPcoBuffer The PCO buffer. This should be a descriptor of maximum length
       
  1565  * RPacketContext::KMiscProtocolBufferLength such as a RPacketContext::TMiscProtocolBuffer.
       
  1566  *
       
  1567  * @see RPacketContext::NotifyConfigChanged()
       
  1568  */
       
  1569 	{
       
  1570 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, aPdpCompression=%d"), aError, &aContextName, aPdpCompression);
       
  1571 
       
  1572 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1573 	__ASSERT_DEBUG(aAccessPointName.Length() <= RPacketContext::KGSNNameLength, CtsyDispatcherPanic(EBadLength));
       
  1574 	__ASSERT_DEBUG(aPdpAddress.Length() <= RPacketContext::KMaxPDPAddressLength, CtsyDispatcherPanic(EBadLength));
       
  1575 	__ASSERT_DEBUG(aPcoBuffer.Length() >= KHeaderGap + KIPv4Len + KLengthLocation + KMinPCOSize, CtsyDispatcherPanic(EBadLength));
       
  1576 
       
  1577 	RPacketContext::TContextConfigGPRS contextConfig;
       
  1578 
       
  1579 	// Decode the PCO buffer and set the profile
       
  1580 	DecodePCO(aPcoBuffer, contextConfig.iProtocolConfigOption.iAuthInfo.iUsername,
       
  1581 			contextConfig.iProtocolConfigOption.iAuthInfo.iPassword,
       
  1582 			contextConfig.iProtocolConfigOption.iDnsAddresses.iPrimaryDns,
       
  1583 			contextConfig.iProtocolConfigOption.iDnsAddresses.iSecondaryDns,
       
  1584 			contextConfig.iProtocolConfigOption.iMiscBuffer);
       
  1585 
       
  1586 	// Re-constuct the profile
       
  1587 	contextConfig.iAccessPointName.Copy(aAccessPointName.Left(RPacketContext::KGSNNameLength));
       
  1588 	contextConfig.iPdpAddress.Copy(aPdpAddress.Left(RPacketContext::KMaxPDPAddressLength));
       
  1589 	contextConfig.iPdpCompression = aPdpCompression;
       
  1590 
       
  1591 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1592 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  1593 	
       
  1594 	CMmPacketDataPackage dataPackage;
       
  1595 	dataPackage.PackData(&contextName, &contextConfig);
       
  1596 	iMessageManagerCallback.Complete(EPacketContextNotifyConfigChanged, &dataPackage, aError);
       
  1597 	} // CPacketServicesDispatcher::CallbackNotifyPdpContextConfigChanged
       
  1598 
       
  1599 void CPacketServicesDispatcher::CallbackNotifyPdpContextStatusChange(TInt aError, const TDesC& aContextName, const TContextMisc& aContextMisc)
       
  1600 /**
       
  1601  * Callback function to be used by the request to complete
       
  1602  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyPdpContextStatusChangeInd()
       
  1603  *
       
  1604  * @param aError The error code to be returned.
       
  1605  * @param aContextName context name.
       
  1606  * @param aContextMisc context miscellaneous information 
       
  1607  * 
       
  1608  * @see TContextMisc.
       
  1609  */
       
  1610 	{
       
  1611 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1612 
       
  1613 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1614 
       
  1615 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1616 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  1617 	
       
  1618 	CMmDataPackage dataPackage;
       
  1619 	dataPackage.PackData(&contextName, const_cast<TContextMisc*>(&aContextMisc));
       
  1620 	iMessageManagerCallback.Complete(EPacketContextNotifyStatusChange, &dataPackage, aError);
       
  1621 
       
  1622 	} // CPacketServicesDispatcher::CallbackNotifyPdpContextStatusChange
       
  1623 
       
  1624 void CPacketServicesDispatcher::CallbackNotifyPdpContextConnectionSpeedChange(TInt aError, const TDesC& aContextName, TUint aConnectionSpeed)
       
  1625 /**
       
  1626  * Callback function to be used by the Licensee LTSY to notify context connection speed change (IPC EPacketContextNotifyConnectionSpeedChange).
       
  1627  *
       
  1628  * @param aError The error code to be returned.
       
  1629  * @param aContextName context name.
       
  1630  * @param aConnectionSpeed context connection speed in bits per second.
       
  1631  */
       
  1632 	{
       
  1633 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, aConnectionSpeed=%d"), aError, &aContextName, aConnectionSpeed);
       
  1634 
       
  1635 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1636 	
       
  1637 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1638 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  1639 	
       
  1640 	CMmDataPackage dataPackage;
       
  1641 	dataPackage.PackData(&contextName, &aConnectionSpeed);
       
  1642 	iMessageManagerCallback.Complete(EPacketContextNotifyConnectionSpeedChange, &dataPackage, aError);
       
  1643 
       
  1644 	} // CPacketServicesDispatcher::CallbackNotifyPdpContextConnectionSpeedChange
       
  1645 
       
  1646 void CPacketServicesDispatcher::CallbackNotifyPacketNetworkRegistrationStatus(TInt aError, const RPacketService::TRegistrationStatus aRegistrationStatus)
       
  1647 /**
       
  1648  * Callback function to be used by the request to complete
       
  1649  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyPacketNetworkRegistrationStatusInd()
       
  1650  *
       
  1651  *
       
  1652  * @param aError The error code.
       
  1653  * @param aRegistrationStatus network registration status.
       
  1654  *
       
  1655  * @see RPacketService::NotifyChangeOfNtwkRegStatus()
       
  1656  */
       
  1657 	{
       
  1658 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aRegistrationStatus=%d"), aError, aRegistrationStatus);
       
  1659 	
       
  1660 	CMmDataPackage dataPackage;
       
  1661 	dataPackage.PackData(const_cast<RPacketService::TRegistrationStatus*>(&aRegistrationStatus));
       
  1662 	iMessageManagerCallback.Complete(EPacketNotifyChangeOfNtwkRegStatus, &dataPackage, aError);
       
  1663 
       
  1664 	} // CPacketServicesDispatcher::CallbackNotifyPacketNetworkRegistrationStatus
       
  1665 
       
  1666 
       
  1667 void CPacketServicesDispatcher::CallbackNotifyMbmsContextConfigChanged(TInt aError, const TDesC& aContextName, const RPacketMbmsContext::TContextConfigMbmsV1& aContextConfigMbms)
       
  1668 /**
       
  1669  * Callback function to be used by the request to complete
       
  1670  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyMbmsContextConfigChangedInd()
       
  1671  *
       
  1672  *
       
  1673  * @param aError The error code to be returned.
       
  1674  * @param aContextName The context name.
       
  1675  * @param aContextConfigMbms The context configuration data.
       
  1676  *
       
  1677  * @see RPacketMbmsContext::NotifyConfigChanged()
       
  1678  */
       
  1679 	{
       
  1680 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, sId=%d, mcc=%d, mnc=%d, ab=%d, sp=%d, sm=%d, sf=%d"),
       
  1681 			aError, 
       
  1682 			&aContextName, 
       
  1683 			aContextConfigMbms.iTmgi.GetServiceId(),  
       
  1684 			aContextConfigMbms.iTmgi.GetMCC(),
       
  1685 			aContextConfigMbms.iTmgi.GetMNC(),
       
  1686 			aContextConfigMbms.iMbmsAccessBearer,
       
  1687 			aContextConfigMbms.iMbmsServicePriority,
       
  1688 			aContextConfigMbms.iMbmsServiceMode,
       
  1689 			aContextConfigMbms.iMbmsSessionFlag);
       
  1690 	
       
  1691 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1692 		
       
  1693 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1694 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  1695 	
       
  1696 	CMmDataPackage dataPackage;
       
  1697 	dataPackage.PackData(&contextName, &const_cast<RPacketMbmsContext::TContextConfigMbmsV1&>(aContextConfigMbms));
       
  1698 	iMessageManagerCallback.Complete(ECtsyPacketMbmsContextNotifyConfigChanged, &dataPackage, aError);
       
  1699 
       
  1700 	} // CPacketServicesDispatcher::CallbackNotifyMbmsContextConfigChanged
       
  1701 
       
  1702 void CPacketServicesDispatcher::CallbackPacketAttach(TInt aError)
       
  1703 /**
       
  1704  * Callback function to be used by the request to complete
       
  1705  * CCtsyDispatcherCallback::CallbackPacketServicesPacketAttachComp()
       
  1706  *
       
  1707  * @param aError The error code.
       
  1708  *
       
  1709  * @see RPacketService::Attach()
       
  1710  */
       
  1711 	{
       
  1712 	TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
       
  1713 	iMessageManagerCallback.Complete(EPacketAttach, aError);
       
  1714 	} // CPacketServicesDispatcher::CallbackPacketAttach
       
  1715 
       
  1716 void CPacketServicesDispatcher::CallbackGetPacketAttachMode(TInt aError, RPacketService::TAttachMode aAttachMode)
       
  1717 /**
       
  1718  * Callback function to be used by the request to complete
       
  1719  * CCtsyDispatcherCallback::CallbackPacketServicesGetPacketAttachModeComp()
       
  1720  *
       
  1721  * @param aError The error code.
       
  1722  * @param aAttachMode The packet attach mode.
       
  1723  *
       
  1724  * @see RPacketService::GetAttachMode()
       
  1725  */
       
  1726 	{
       
  1727 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aAttachMode=%d"), aError, aAttachMode);
       
  1728 
       
  1729 	// Pack the data to return to the Common TSY
       
  1730 	CMmDataPackage dataPackage;
       
  1731 	dataPackage.PackData(&aAttachMode);
       
  1732 
       
  1733 	iMessageManagerCallback.Complete(EPacketGetAttachMode, &dataPackage, aError);
       
  1734 
       
  1735 	} // CPacketServicesDispatcher::CallbackGetPacketAttachMode
       
  1736 
       
  1737 void CPacketServicesDispatcher::CallbackGetPacketNetworkRegistrationStatus(TInt aError,
       
  1738 		RPacketService::TRegistrationStatus aRegistrationStatus)
       
  1739 /**
       
  1740  * Callback function to be used by the request to complete
       
  1741  * CCtsyDispatcherCallback::CallbackPacketServicesGetPacketNetworkRegistrationStatusComp()
       
  1742  *
       
  1743  * @param aError The error code to be returned to the CTSY Dispatcher.
       
  1744  * @param aRegistrationStatus The current network registration status.
       
  1745  */
       
  1746 	{
       
  1747 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aRegistrationStatus=%d"), aError, aRegistrationStatus);
       
  1748 
       
  1749 	// Pack the data to return to the Common TSY
       
  1750 	CMmDataPackage dataPackage;
       
  1751 	dataPackage.PackData(&aRegistrationStatus);
       
  1752 
       
  1753 	iMessageManagerCallback.Complete(EPacketGetNtwkRegStatus, &dataPackage, aError);
       
  1754 
       
  1755 	} // CPacketServicesDispatcher::CallbackGetPacketNetworkRegistrationStatus
       
  1756 
       
  1757 void CPacketServicesDispatcher::CallbackPacketDetach(TInt aError)
       
  1758 /**
       
  1759  * Callback function to be used by the request to complete
       
  1760  * CCtsyDispatcherCallback::CallbackPacketServicesPacketDetachComp()
       
  1761  *
       
  1762  * @param aError The error code.
       
  1763  *
       
  1764  * @see RPacketService::Detach()
       
  1765  */
       
  1766 	{
       
  1767 	TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
       
  1768 	iMessageManagerCallback.Complete(EPacketDetach, aError);
       
  1769 
       
  1770 	} // CPacketServicesDispatcher::CallbackPacketDetach
       
  1771 
       
  1772 void CPacketServicesDispatcher::CallbackSetPdpContextConfig(TInt aError, const TDesC& aContextName)
       
  1773 /**
       
  1774  * Callback function to be used by the request to complete
       
  1775  * CCtsyDispatcherCallback::CallbackPacketServicesSetPdpContextConfigComp()
       
  1776  *
       
  1777  * @param aError The error code.
       
  1778  * @param callbackContextId the context name, the maximum length of the descriptor should not exceed KMaxInfoName.
       
  1779  *
       
  1780  * @see RPacketContext::SetConfig()
       
  1781  */
       
  1782 	{
       
  1783 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1784 
       
  1785 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1786 	
       
  1787 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1788 	TInfoName contextName(aContextName);
       
  1789 	
       
  1790 	// Pack the data to return to the Common TSY
       
  1791 	CMmDataPackage dataPackage;
       
  1792 	dataPackage.PackData(&contextName);
       
  1793 
       
  1794 	iMessageManagerCallback.Complete(EPacketContextSetConfig, &dataPackage, aError);
       
  1795 
       
  1796 	} // CPacketServicesDispatcher::CallbackSetPdpContextConfig
       
  1797 
       
  1798 void CPacketServicesDispatcher::CallbackModifyActivePdpContext(TInt aError, const TDesC& aContextName, TInt8 aRejectionCode)
       
  1799 /**
       
  1800  * Callback function to be used by the request to complete
       
  1801  * CCtsyDispatcherCallback::CallbackPacketServicesModifyActivePdpContextComp()
       
  1802  *
       
  1803  * @param aError The error code.
       
  1804  * @param aContextName The context name which has been modified.
       
  1805  * @param aRejectionCode The reason code for any failure of modification.
       
  1806  *
       
  1807  * @see RPacketContext::ModifyActiveContext()
       
  1808  */
       
  1809 	{
       
  1810 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, aRejectionCode=%d"), aError, &aContextName, aRejectionCode);
       
  1811 
       
  1812 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1813 	
       
  1814 	// Pack the data to return to the Common TSY
       
  1815 	CMmDataPackage dataPackage;
       
  1816 	typedef TBuf8<1> TRejectionCode;
       
  1817 	TRejectionCode rejectionCode;
       
  1818 	rejectionCode.Append(aRejectionCode);
       
  1819 	
       
  1820 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1821 	TInfoName contextName(aContextName);
       
  1822 	
       
  1823 	dataPackage.PackData(&contextName, &rejectionCode);
       
  1824 
       
  1825 	iMessageManagerCallback.Complete(EPacketContextModifyActiveContext, &dataPackage, aError);
       
  1826 
       
  1827 	} // CPacketServicesDispatcher::CallbackModifyActivePdpContext
       
  1828 
       
  1829 void CPacketServicesDispatcher::CallbackInitialisePdpContext(TInt aError, const TDesC& aContextName, const TDesC& aChannelId)
       
  1830 /**
       
  1831  * Callback function to be used by the request to complete
       
  1832  * CCtsyDispatcherCallback::CallbackPacketServicesInitialisePdpContextComp()
       
  1833  *
       
  1834  * @param aError The error code.
       
  1835  * @param aContextName The name of the current context, the descriptor should be TBuf<10>
       
  1836  * @param aChannelId The current channelId descriptor, the descriptor should be a TName
       
  1837  */
       
  1838 	{
       
  1839 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, aChannelId=%S"), aError, &aContextName, &aChannelId);
       
  1840 
       
  1841 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1842 	__ASSERT_DEBUG(aChannelId.Length() <= KMaxName, CtsyDispatcherPanic(EBadLength));
       
  1843 
       
  1844 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1845 	TInfoName contextName(aContextName);
       
  1846 	
       
  1847 	// Pack the data to return to the Common TSY
       
  1848 	CMmDataPackage dataPackage;
       
  1849 	dataPackage.PackData(&contextName, &const_cast<TDesC&>(aChannelId));
       
  1850 
       
  1851 	iMessageManagerCallback.Complete(EPacketContextInitialiseContext, &dataPackage, aError);
       
  1852 
       
  1853 	} // CPacketServicesDispatcher::CallbackInitialisePdpContext
       
  1854 
       
  1855 void CPacketServicesDispatcher::CallbackDeletePdpContext(TInt aError, const TDesC& aContextName)
       
  1856 /**
       
  1857  * Callback function to be used by the request to complete
       
  1858  * CCtsyDispatcherCallback::CallbackPacketServicesDeletePdpContextComp()
       
  1859  *
       
  1860  * @param aError The error code.
       
  1861  * @param aContextName The context name.
       
  1862  *
       
  1863  * @see RPacketContext::Delete()
       
  1864  */
       
  1865 	{
       
  1866     TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1867 
       
  1868     __ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1869     
       
  1870     //CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1871     TInfoName contextName(aContextName);
       
  1872     
       
  1873     // Pack the data to return to the Common TSY
       
  1874     CMmDataPackage dataPackage;
       
  1875     dataPackage.PackData(&contextName);
       
  1876 
       
  1877     iMessageManagerCallback.Complete(EPacketContextDelete, &dataPackage, aError);	
       
  1878 	} // CPacketServicesDispatcher::CallbackDeletePdpContext
       
  1879 
       
  1880 void CPacketServicesDispatcher::CallbackSetPacketAttachMode(TInt aError)
       
  1881 /**
       
  1882  * Callback function to be used by the request to complete
       
  1883  * CCtsyDispatcherCallback::CallbackPacketServicesSetPacketAttachModeComp()
       
  1884  *
       
  1885  * @param aError The error code.
       
  1886  */
       
  1887 	{
       
  1888 	TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
       
  1889 	iMessageManagerCallback.Complete(EPacketSetAttachMode, aError);
       
  1890 
       
  1891 	} // CPacketServicesDispatcher::CallbackSetPacketAttachMode
       
  1892 
       
  1893 void CPacketServicesDispatcher::CallbackSetDefaultPdpContextParams(TInt aError)
       
  1894 /**
       
  1895  * Callback function to be used by the request to complete
       
  1896  * CCtsyDispatcherCallback::CallbackPacketServicesSetDefaultPdpContextParamsComp()
       
  1897  *
       
  1898  * @param aError The error code.
       
  1899  *
       
  1900  * @see RPacketContext::SetDefaultContextParams()
       
  1901  */
       
  1902 	{
       
  1903 	TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
       
  1904 
       
  1905 	iMessageManagerCallback.Complete(EPacketSetDefaultContextParams, aError);
       
  1906 	} // CPacketServicesDispatcher::CallbackSetDefaultPdpContextParams
       
  1907 
       
  1908 void CPacketServicesDispatcher::CallbackActivatePdpContext(TInt aError,
       
  1909 		const TDesC& aContextName,
       
  1910 		const TDesC8& aAccessPointName,
       
  1911 		RPacketContext::TProtocolType aPdpType)
       
  1912 /**
       
  1913  * Callback function to be used by the request to complete
       
  1914  * CCtsyDispatcherCallback::CallbackPacketServicesActivatePdpContextComp()
       
  1915  *
       
  1916  * @param aError KErrNone on success, or another error code indicating the error otherwise.
       
  1917  * @param aContextName The name of the context that has been activated.
       
  1918  * @param aAccessPointName The name of the access point that has been activated.
       
  1919  * This should be a descriptor of maximum length RPacketContext::KGSNNameLength such as RPacketContext::TGSNAddress
       
  1920  * @param aPdpType The protocol used to connect to the packet data gateway.
       
  1921  */
       
  1922 	{
       
  1923 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, aAccessPointName=%S, aPdpType=%d"), aError, &aContextName, &aAccessPointName, aPdpType);
       
  1924 
       
  1925 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1926 	__ASSERT_DEBUG(aAccessPointName.Length() <= RPacketContext::KGSNNameLength, CtsyDispatcherPanic(EBadLength));
       
  1927 
       
  1928 	RPacketContext::TContextConfigGPRS contextConfig;
       
  1929 	contextConfig.iAccessPointName.Copy(aAccessPointName);
       
  1930 	contextConfig.iPdpType = aPdpType;
       
  1931 	const RPacketContext::TContextConfigGPRS* contextConfigPtr = &contextConfig;
       
  1932 
       
  1933 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  1934 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  1935 
       
  1936 	// Pack the data to return to the Common TSY
       
  1937 	CMmDataPackage dataPackage;
       
  1938 	dataPackage.PackData(&contextName, &contextConfigPtr);
       
  1939 
       
  1940 	iMessageManagerCallback.Complete(EPacketContextActivate, &dataPackage, aError);
       
  1941 
       
  1942 	} // CPacketServicesDispatcher::CallbackActivatePdpContext
       
  1943 
       
  1944 void CPacketServicesDispatcher::CallbackSetPdpContextQos(TInt aError, const TDesC& aContextName)
       
  1945 /**
       
  1946  * Callback function to be used by the request to complete
       
  1947  * CCtsyDispatcherCallback::CallbackPacketServicesSetPdpContextQosComp()
       
  1948  *
       
  1949  * @param aError The error code.
       
  1950  * @param aContextName The context's name, the maximum length of the descriptor should not exceed KMaxInfoName.
       
  1951  *
       
  1952  * @see RPacketContext::SetProfileParameters()
       
  1953  */
       
  1954 	{
       
  1955 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1956 
       
  1957 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1958 	
       
  1959 	// Pack the data to return to the Common TSY
       
  1960 	CMmDataPackage dataPackage;
       
  1961 	//CTSY unpacks as a TInfoName so safe to pack the TDesC& here.
       
  1962 	dataPackage.PackData(const_cast<TDesC*>(&aContextName));
       
  1963 
       
  1964 	iMessageManagerCallback.Complete(EPacketQoSSetProfileParams, &dataPackage, aError);
       
  1965 
       
  1966 	} // CPacketServicesDispatcher::CallbackSetPdpContextQos
       
  1967 
       
  1968 void CPacketServicesDispatcher::CallbackRejectNetworkInitiatedContextActivationRequest(TInt aError)
       
  1969 /**
       
  1970  * Callback function to be used by the request to complete
       
  1971  * CCtsyDispatcherCallback::CallbackPacketServicesRejectNetworkInitiatedContextActivationRequestComp()
       
  1972  *
       
  1973  * @param aError The error code.
       
  1974  *
       
  1975  * @see RPacketContext::RejectActivationRequest()
       
  1976  */
       
  1977 	{
       
  1978 	TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
       
  1979 	iMessageManagerCallback.Complete(EPacketRejectActivationRequest, aError);
       
  1980 
       
  1981 	} // CPacketServicesDispatcher::CallbackRejectNetworkInitiatedContextActivationRequest
       
  1982 
       
  1983 void CPacketServicesDispatcher::CallbackDeactivatePdpContext(TInt aError, const TDesC& aContextName)
       
  1984 /**
       
  1985  * Callback function to be used by the request to complete
       
  1986  * CCtsyDispatcherCallback::CallbackPacketServicesDeactivatePdpContextComp()
       
  1987  *
       
  1988  * @param aError The error code.
       
  1989  * @param aContextName The context name that has been deactivated,
       
  1990  * The maximum length of the descriptor should not exceed KMaxInfoName.
       
  1991  *
       
  1992  * @see RPacketContext::Deactivate()
       
  1993  */
       
  1994 	{
       
  1995 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  1996 
       
  1997 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  1998 	
       
  1999 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  2000 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  2001 	
       
  2002 	// Pack the data to return to the Common TSY
       
  2003 	CMmDataPackage dataPackage;
       
  2004 	dataPackage.PackData(&contextName);
       
  2005 
       
  2006 	iMessageManagerCallback.Complete(EPacketContextDeactivate, &dataPackage, aError);
       
  2007 	} // CPacketServicesDispatcher::CallbackDeactivatePdpContext
       
  2008 	
       
  2009 void CPacketServicesDispatcher::CallbackGetStatus(TInt aError, RPacketService::TStatus aPacketStatus, TBool aIsResumed)
       
  2010 /**
       
  2011  * Callback function to be used by the request to complete the packet status.
       
  2012  *
       
  2013  * @param aError The error code.
       
  2014  * @param aPacketStatus The packet status as returned from LTSY
       
  2015  * @param aIsResumed Flag indicating whether packet service has been resumed from suspended state.
       
  2016  * 
       
  2017  * @see RPacketService::GetStatus()
       
  2018  */
       
  2019 	{
       
  2020 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aPacketStatus=%d, aIsResumed=%d"), aError, aPacketStatus, aIsResumed);
       
  2021 
       
  2022 	// Pack the data to return to the Common TSY
       
  2023 	CMmDataPackage dataPackage;
       
  2024 
       
  2025 	dataPackage.PackData(&aPacketStatus, &aIsResumed);
       
  2026 
       
  2027 	iMessageManagerCallback.Complete(EPacketNotifyStatusChange, &dataPackage, aError);
       
  2028 
       
  2029 	} // CPacketServicesDispatcher::CallbackGetStatus
       
  2030 
       
  2031 
       
  2032 void CPacketServicesDispatcher::CallbackGetStaticCapabilities(TInt aError, TUint aStaticCapabilities)
       
  2033 /**
       
  2034  * Callback function to be used by the request to complete the packet static capabilities.
       
  2035  * CCtsyDispatcherCallback::CallbackPacketServicesGetStaticCapabilitiesComp()
       
  2036  *
       
  2037  * @param aError The error code.
       
  2038  * @param aStaticCapabilities A bit field containing the static capabilities to be returned to the CTSY.
       
  2039  * This can be created from a bit-wise OR (|) of values from RPacketService::TStaticMiscCaps.
       
  2040  * 
       
  2041  * @see RPacketService::TStaticMiscCaps
       
  2042  * @see RPacketService::GetStaticCaps()
       
  2043  */
       
  2044 	{
       
  2045 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aStaticCapabilities=%d"), aError, aStaticCapabilities);
       
  2046 
       
  2047 	// Pack the data to return to the Common TSY
       
  2048 	CMmDataPackage dataPackage;
       
  2049 	
       
  2050 	dataPackage.PackData(&aStaticCapabilities);
       
  2051 	
       
  2052 	iMessageManagerCallback.Complete(EPacketGetStaticCaps, &dataPackage, aError);
       
  2053 	
       
  2054 	} // CPacketServicesDispatcher::CallbackGetStaticCapabilities
       
  2055 	
       
  2056 void CPacketServicesDispatcher::CallbackGetMaxNoMonitoredServiceLists(TInt aError, TInt aMaxNoMonitoredServiceLists)
       
  2057 /**
       
  2058  * Callback function to be used by the request to complete the maximum number of monitored service lists
       
  2059  * CCtsyDispatcherCallback::CallbackPacketServicesGetMaxNoMonitoredServiceListsComp()
       
  2060  *
       
  2061  * @param aError The error code.
       
  2062  * @param aMaxNoMonitoredServiceLists The maximum number of monitored service lists.
       
  2063  * 
       
  2064  * @see RPacketService::EnumerateMbmsMonitorServiceList()
       
  2065  */
       
  2066 	{
       
  2067 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aMaxNoMonitoredServiceLists=%d"), aError, aMaxNoMonitoredServiceLists);
       
  2068 
       
  2069 	// Pack the data to return to the Common TSY
       
  2070 	CMmDataPackage dataPackage;
       
  2071 	
       
  2072 	dataPackage.PackData(&aMaxNoMonitoredServiceLists);
       
  2073 	
       
  2074 	iMessageManagerCallback.Complete(EPacketEnumerateMbmsMonitorServiceList, &dataPackage, aError);
       
  2075 	
       
  2076 	} // CPacketServicesDispatcher::CallbackGetMaxNoMonitoredServiceLists
       
  2077 
       
  2078 void CPacketServicesDispatcher::CallbackGetMaxNoActiveServices(TInt aError, TInt aMaxNoActiveServices)
       
  2079 /**
       
  2080  * Callback function to be used by the request to complete the maximum number of active services.
       
  2081  * CCtsyDispatcherCallback::CallbackPacketServicesGetMaxNoActiveServicesComp()
       
  2082  *
       
  2083  * @param aError The error code.
       
  2084  * @param aMaxNoActiveServices The maximum number of active services allowed (hence the maximum number of contexts allowed).
       
  2085  */
       
  2086 	{
       
  2087 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aMaxNoActiveServices=%d"), aError, aMaxNoActiveServices);
       
  2088 
       
  2089 	// Pack the data to return to the Common TSY
       
  2090 	CMmDataPackage dataPackage;
       
  2091 	
       
  2092 	dataPackage.PackData(&aMaxNoActiveServices);
       
  2093 	
       
  2094 	iMessageManagerCallback.Complete(EPacketEnumerateMbmsActiveServiceList, &dataPackage, aError);
       
  2095 	
       
  2096 	} // CPacketServicesDispatcher::CallbackGetMaxNoActiveServices
       
  2097 
       
  2098 void CPacketServicesDispatcher::CallbackInitialiseMbmsContext(TInt aError, const TDesC& aContextName, const TDesC& aChannelId)
       
  2099 /**
       
  2100  * Callback function to be used by the request to complete the maximum number of active services.
       
  2101  * CCtsyDispatcherCallback::CallbackPacketServicesInitialiseMbmsContextComp()
       
  2102  *
       
  2103  * @param aError The error code.
       
  2104  * @param aContextName The name of the current context, the descriptor should be a maximum length of KMaxInfoName.
       
  2105  * @param aChannelId The current channelId descriptor, the descriptor should be a maximum length of KMaxName.
       
  2106  */
       
  2107 	{
       
  2108 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, aChannelId=%S"), aError, &aContextName, &aChannelId);
       
  2109 
       
  2110 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  2111 	__ASSERT_DEBUG(aChannelId.Length() <= KMaxName, CtsyDispatcherPanic(EBadLength));
       
  2112 		
       
  2113 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  2114 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  2115 	
       
  2116 	RPacketContext::TDataChannelV2 dataChannelV2;
       
  2117 	dataChannelV2.iChannelId = aChannelId.Left(KMaxName);
       
  2118 	dataChannelV2.iPort = aContextName.Left(KMaxInfoName);
       
  2119 	
       
  2120 	// Pack the data to return to the Common TSY
       
  2121 	CMmDataPackage dataPackage;
       
  2122 	dataPackage.PackData(&contextName,&dataChannelV2);
       
  2123 	
       
  2124 	iMessageManagerCallback.Complete(ECtsyPacketMbmsInitialiseContextComp, &dataPackage, aError);
       
  2125 	
       
  2126 	} // CPacketServicesDispatcher::CallbackInitialiseMbmsContext
       
  2127 
       
  2128 void CPacketServicesDispatcher::CallbackGetMbmsNetworkServiceStatus(TInt aError, TMbmsNetworkServiceStatus aMbmsNetworkServiceStatus)
       
  2129 /**
       
  2130  * Callback function to be used by the request to complete the MBMS network service status.
       
  2131  * CCtsyDispatcherCallback::CallbackPacketServicesGetMbmsNetworkServiceStatusComp()
       
  2132  *
       
  2133  * @param aError The error code.
       
  2134  * @param aMbmsNetworkServiceStatus The network service status.
       
  2135  */
       
  2136 	{
       
  2137 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aMbmsNetworkServiceStatus=%d"), aError, aMbmsNetworkServiceStatus);
       
  2138 	
       
  2139 	// Pack the data to return to the Common TSY
       
  2140 	CMmDataPackage dataPackage;
       
  2141 	dataPackage.PackData(&aMbmsNetworkServiceStatus);
       
  2142 	
       
  2143 	iMessageManagerCallback.Complete(EPacketGetMbmsNetworkServiceStatus, &dataPackage, aError);
       
  2144 	
       
  2145 	} // CPacketServicesDispatcher::CallbackGetMbmsNetworkServiceStatus
       
  2146 
       
  2147 void CPacketServicesDispatcher::CallbackNotifyMbmsNetworkServiceStatusChange(TInt aError, TMbmsNetworkServiceStatus aMbmsNetworkServiceStatus)
       
  2148 /**
       
  2149  * Callback function to be used by the request to complete
       
  2150  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyMbmsNetworkServiceStatusChangeInd()
       
  2151  * 
       
  2152  * @param aError The error code.
       
  2153  * @param aMbmsNetworkServiceStatus The network service status.
       
  2154  */
       
  2155 	{
       
  2156 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aMbmsNetworkServiceStatus=%d"), aError, aMbmsNetworkServiceStatus);
       
  2157 	
       
  2158 	// Pack the data to return to the Common TSY
       
  2159 	CMmDataPackage dataPackage;
       
  2160 	dataPackage.PackData(&aMbmsNetworkServiceStatus);
       
  2161 	
       
  2162 	iMessageManagerCallback.Complete(EPacketNotifyMbmsNetworkServiceStatusChange, &dataPackage, aError);
       
  2163 	
       
  2164 	} // CPacketServicesDispatcher::CallbackNotifyMbmsNetworkServiceStatusChange
       
  2165 
       
  2166 
       
  2167 void CPacketServicesDispatcher::CallbackUpdateMbmsMonitorServiceList(TInt aError)
       
  2168 /**
       
  2169  * Callback function to be used by the request to complete
       
  2170  * CCtsyDispatcherCallback::CallbackPacketServicesUpdateMbmsMonitorServiceListComp()
       
  2171  * 
       
  2172  * @param aError The error code.
       
  2173  */
       
  2174 	{
       
  2175 	TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
       
  2176 	
       
  2177 	iMessageManagerCallback.Complete(EPacketUpdateMbmsMonitorServiceList, KErrNone);
       
  2178 	
       
  2179 	(void)aError; // Suppress compiler warning about unused argument in UREL
       
  2180 	} // CPacketServicesDispatcher::CallbackUpdateMbmsMonitorServiceList
       
  2181 
       
  2182 void CPacketServicesDispatcher::CallbackUpdateMbmsMonitorServiceList(TInt aError, const RArray<TUint>& aFailedServiceIds)
       
  2183 /**
       
  2184  * Callback function to be used by the request to complete
       
  2185  * CCtsyDispatcherCallback::CallbackPacketServicesUpdateMbmsMonitorServiceListComp()
       
  2186  * 
       
  2187  * @param aFailedServiceIds A list containing the service Id which cannot be updated via the action (e.g. Id of
       
  2188  * a service that could not be added)
       
  2189  */
       
  2190 	{
       
  2191 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aFailedServiceIds.Count()=%d"), aError, aFailedServiceIds.Count());
       
  2192 	
       
  2193 	CPcktMbmsMonitoredServiceList* list = NULL;
       
  2194 
       
  2195 	//if the list creation leaves then list will be NULL, which the CTSY can handle.
       
  2196 	TRAPD(err,list = CreateServiceListL(aFailedServiceIds));
       
  2197 	__ASSERT_DEBUG(err == KErrNone, CtsyDispatcherPanic(ELeaveTrapped));
       
  2198 	
       
  2199 	CMmDataPackage dataPackage;
       
  2200 	
       
  2201 	if(err == KErrNone)
       
  2202 		{
       
  2203 		//no real problem packing if list is NULL, mainly so err does not cause a UREL build warning as its not used.
       
  2204 		dataPackage.PackData(list);
       
  2205 		}
       
  2206 	
       
  2207 	iMessageManagerCallback.Complete(EPacketUpdateMbmsMonitorServiceList, &dataPackage, KErrMbmsImpreciseServiceEntries);
       
  2208 
       
  2209 	(void)aError; // Suppress compiler warning about unused argument in UREL
       
  2210 	delete list;
       
  2211 	list = NULL;
       
  2212 	} // CPacketServicesDispatcher::CallbackUpdateMbmsMonitorServiceList
       
  2213 
       
  2214 void CPacketServicesDispatcher::CallbackNotifyMbmsServiceAvailabilityChange(TInt aError, const RArray<TUint>& aAvailableServiceIds)
       
  2215 /**
       
  2216  * Callback function to be used by the request to complete
       
  2217  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyMbmsServiceAvailabilityChangeInd()
       
  2218  * 
       
  2219  * @param aError The error code.
       
  2220  * @param aAvailableServiceIds The list of Service Ids which are currently available.
       
  2221  */
       
  2222 	{
       
  2223 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aAvailableServiceIds.Count()=%d"), aError,  aAvailableServiceIds.Count());
       
  2224 	
       
  2225 	if(aError == KErrNone)
       
  2226 		{
       
  2227 		CPcktMbmsMonitoredServiceList* list = NULL;
       
  2228 
       
  2229 		//if the list creation leaves then list will be NULL, which the CTSY can handle.
       
  2230 		TRAPD(err,list = CreateServiceListL(aAvailableServiceIds));
       
  2231 
       
  2232 		CMmDataPackage dataPackage;
       
  2233 		dataPackage.PackData(list);
       
  2234 		
       
  2235 		iMessageManagerCallback.Complete(EPacketNotifyMbmsServiceAvailabilityChange, &dataPackage, err);
       
  2236 		
       
  2237 		delete list;
       
  2238 		list = NULL;
       
  2239 		
       
  2240 		}
       
  2241 	else
       
  2242 		{
       
  2243 		CMmDataPackage dataPackage;
       
  2244 		iMessageManagerCallback.Complete(EPacketNotifyMbmsServiceAvailabilityChange, &dataPackage, aError);
       
  2245 		}
       
  2246 	
       
  2247 	} //CPacketServicesDispatcher::CallbackNotifyMbmsServiceAvailabilityChange
       
  2248 
       
  2249 void CPacketServicesDispatcher::CallbackUpdateMbmsSessionList(TInt aError, const TDesC& aContextName)
       
  2250 /**
       
  2251  * Callback function to be used by the request to complete
       
  2252  * CCtsyDispatcherCallback::CallbackPacketServicesUpdateMbmsSessionListComp()
       
  2253  * 
       
  2254  * @param aError The error code.
       
  2255  * @param aContextName The name of the MBMS context, the descriptor should be a maximum length of KMaxInfoName.
       
  2256  */
       
  2257 	{
       
  2258 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S"), aError, &aContextName);
       
  2259 	
       
  2260 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));
       
  2261 	
       
  2262 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  2263 	TInfoName contextName(aContextName.Left(KMaxInfoName));
       
  2264 	
       
  2265 	CMmDataPackage dataPackage;
       
  2266 	dataPackage.PackData(&contextName);
       
  2267 			
       
  2268 	iMessageManagerCallback.Complete(EPacketContextUpdateMbmsSessionList, &dataPackage, aError);
       
  2269 	} //CPacketServicesDispatcher::CallbackUpdateMbmsSessionList
       
  2270 
       
  2271 void CPacketServicesDispatcher::CallbackNotifyConnectionInfoChange(TInt aError, const TDesC& aContextName, const RPacketContext::TConnectionInfoV1& aConnectionInfo)
       
  2272 /**
       
  2273  * Callback function to be used by the request to complete
       
  2274  * CCtsyDispatcherCallback::CallbackPacketServicesNotifyConnectionInfoChangeInd()
       
  2275  * 
       
  2276  * @param aError The error code to be returned.
       
  2277  * @param aContextName The context name, the maximum length of the descriptor should not exceed KMaxInfoName.
       
  2278  * @param aConnectionInfo The details of the connection, including HSDPA Category and HSUPA Category
       
  2279  */
       
  2280 	{
       
  2281 	TSYLOGENTRYEXITARGS(_L8("aError=%d, aContextName=%S, iHSDPACategory=%d, iHSUPACategory=%d"), 
       
  2282 	    aError, &aContextName, aConnectionInfo.iHSDPACategory, aConnectionInfo.iHSUPACategory);	
       
  2283 
       
  2284 	__ASSERT_DEBUG(aContextName.Length() <= KMaxInfoName, CtsyDispatcherPanic(EBadLength));	
       
  2285 
       
  2286 	//CTSY unpacks as a TInfoName* so we have to copy the TDesC& here to be safe.
       
  2287 	TInfoName contextName(aContextName.Left(KMaxInfoName));	
       
  2288 
       
  2289 	CMmDataPackage dataPackage;
       
  2290 	dataPackage.PackData(&contextName, &const_cast<RPacketContext::TConnectionInfoV1&>(aConnectionInfo));
       
  2291 			
       
  2292 	iMessageManagerCallback.Complete(EPacketContextNotifyConnectionInfoChange, &dataPackage, aError);	
       
  2293 	}
       
  2294 
       
  2295 void CPacketServicesDispatcher::CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage)
       
  2296 /**
       
  2297  * Part of the MDispatcherCallback interface. Used to complete requests handled
       
  2298  * synchronously by the Licensee LTSY asynchronously back to the Common TSY.
       
  2299  *
       
  2300  * @param aIpcDataPackage Package encapsulating the request.
       
  2301  *
       
  2302  * @see MDispatcherCallback::CallbackSync
       
  2303  */
       
  2304 	{
       
  2305 	TSYLOGENTRYEXIT;
       
  2306 
       
  2307 	switch (aIpcDataPackage.iIpc)
       
  2308 		{
       
  2309 
       
  2310 	default:
       
  2311 		LOG(_L8("WARNING: CPacketServicesDispatcher::CallbackSync unhandled IPC=%d"), aIpcDataPackage.iIpc);
       
  2312 		__ASSERT_DEBUG(NULL, CtsyDispatcherPanic(EUnhandledCtsyIpc));
       
  2313 		break;
       
  2314 		} // switch (aIpcDataPackage.iIpc)
       
  2315 
       
  2316 	} // CPacketServicesDispatcher::CallbackSync
       
  2317 
       
  2318 /**
       
  2319 * Perform conversion from R99 negotiated QoS to R97 negotiated QoS according to 3GPP 24.008-750
       
  2320 *
       
  2321 * @param aQoSR99_R4Negotiated - Etel R99_R4 negotiated QoS
       
  2322 * @param aQoSGPRSNegotiated - Etel GPRS negotiated QoS
       
  2323 * @return Etel error code
       
  2324 **/
       
  2325 TInt CPacketServicesDispatcher::EtelPcktR99R4NegToEtelPcktR97NegQoS(const RPacketQoS::TQoSR99_R4Negotiated& aQoSR99_R4Negotiated,
       
  2326                                            RPacketQoS::TQoSGPRSNegotiated& aQoSGPRSNegotiated)
       
  2327     {
       
  2328 
       
  2329     RPacketQoS::TQoSGPRSRequested generatedGPRSQoS;
       
  2330 
       
  2331     /* Traffic class/handling priority to delay */
       
  2332     if ((aQoSR99_R4Negotiated.iTrafficClass == RPacketQoS::ETrafficClassConversational) || (aQoSR99_R4Negotiated.iTrafficClass == RPacketQoS::ETrafficClassStreaming))
       
  2333         {
       
  2334         aQoSGPRSNegotiated.iDelay = RPacketQoS::EDelayClass1;
       
  2335         }
       
  2336     else if ((aQoSR99_R4Negotiated.iTrafficClass == RPacketQoS::ETrafficClassInteractive) && (aQoSR99_R4Negotiated.iTrafficHandlingPriority == RPacketQoS::ETrafficPriority1))
       
  2337         {
       
  2338         aQoSGPRSNegotiated.iDelay = RPacketQoS::EDelayClass1;
       
  2339         }
       
  2340     else if ((aQoSR99_R4Negotiated.iTrafficClass == RPacketQoS::ETrafficClassInteractive) && (aQoSR99_R4Negotiated.iTrafficHandlingPriority == RPacketQoS::ETrafficPriority2))
       
  2341         {
       
  2342         aQoSGPRSNegotiated.iDelay = RPacketQoS::EDelayClass2;
       
  2343         }
       
  2344     else if ((aQoSR99_R4Negotiated.iTrafficClass == RPacketQoS::ETrafficClassInteractive) && (aQoSR99_R4Negotiated.iTrafficHandlingPriority == RPacketQoS::ETrafficPriority3))
       
  2345         {
       
  2346         aQoSGPRSNegotiated.iDelay = RPacketQoS::EDelayClass3;
       
  2347         }
       
  2348     else if (aQoSR99_R4Negotiated.iTrafficClass == RPacketQoS::ETrafficClassBackground)
       
  2349         {
       
  2350         aQoSGPRSNegotiated.iDelay = RPacketQoS::EDelayClass4;
       
  2351         }
       
  2352     else
       
  2353         {
       
  2354         aQoSGPRSNegotiated.iDelay = RPacketQoS::EUnspecifiedDelayClass;
       
  2355         }
       
  2356 
       
  2357     /* Error Ratio/max BER to reliability */
       
  2358     if (aQoSR99_R4Negotiated.iSDUErrorRatio == RPacketQoS::ESDUErrorRatioOnePerHundredThousand) // Assumption this means < 0.00001
       
  2359         {
       
  2360         aQoSGPRSNegotiated.iReliability = RPacketQoS::EReliabilityClass2;
       
  2361         }
       
  2362     else if (aQoSR99_R4Negotiated.iSDUErrorRatio == RPacketQoS::ESDUErrorRatioOnePerTenThousand) // Assumption x between 0.00001 and 0.0005 best representation ESDUErrorRatioOnePerTenThousand
       
  2363         {
       
  2364         aQoSGPRSNegotiated.iReliability = RPacketQoS::EReliabilityClass3;
       
  2365         }
       
  2366     else if ((aQoSR99_R4Negotiated.iSDUErrorRatio == RPacketQoS::ESDUErrorRatioOnePerThousand) && (aQoSR99_R4Negotiated.iBER == RPacketQoS::EBEROnePerHundredThousand)) // Assumption > 0.0005 SDU & <= 0.0002 BER
       
  2367         {
       
  2368         aQoSGPRSNegotiated.iReliability = RPacketQoS::EReliabilityClass4;
       
  2369         }
       
  2370     else if ((aQoSR99_R4Negotiated.iSDUErrorRatio == RPacketQoS::ESDUErrorRatioOnePerThousand) && (aQoSR99_R4Negotiated.iBER == RPacketQoS::EBEROnePerThousand)) // Assumption > 0.0005 & > 0.0002 BER
       
  2371         {
       
  2372         aQoSGPRSNegotiated.iReliability = RPacketQoS::EReliabilityClass5;
       
  2373         }
       
  2374     else
       
  2375         {
       
  2376         aQoSGPRSNegotiated.iReliability = RPacketQoS::EUnspecifiedReliabilityClass;
       
  2377         }
       
  2378 
       
  2379     /* Max rate to peak throughput, using maximum between uplink and downlink */
       
  2380     TInt tempMaxBitRate = Max(aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate, aQoSR99_R4Negotiated.iMaxRate.iUplinkRate);
       
  2381 
       
  2382     if (tempMaxBitRate < 16)
       
  2383         {
       
  2384         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput1000;
       
  2385         }
       
  2386     else if ((tempMaxBitRate >= 16) && (tempMaxBitRate < 32))
       
  2387         {
       
  2388         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput2000;
       
  2389         }
       
  2390     else if ((tempMaxBitRate >= 32) && (tempMaxBitRate < 64))
       
  2391         {
       
  2392         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput4000;
       
  2393         }
       
  2394     else if ((tempMaxBitRate >= 64) && (tempMaxBitRate < 128))
       
  2395         {
       
  2396         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput8000;
       
  2397         }
       
  2398     else if ((tempMaxBitRate >= 128) && (tempMaxBitRate < 256))
       
  2399         {
       
  2400         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput16000;
       
  2401         }
       
  2402     else if ((tempMaxBitRate >= 256) && (tempMaxBitRate < 512))
       
  2403         {
       
  2404         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput32000;
       
  2405         }
       
  2406     else if ((tempMaxBitRate >= 512) && (tempMaxBitRate < 1024))
       
  2407         {
       
  2408         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput64000;
       
  2409         }
       
  2410     else if ((tempMaxBitRate >= 1024) && (tempMaxBitRate < 2048))
       
  2411         {
       
  2412         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput128000;
       
  2413         }        
       
  2414     else 
       
  2415         {
       
  2416         aQoSGPRSNegotiated.iPeakThroughput = RPacketQoS::EPeakThroughput256000;
       
  2417         }
       
  2418   
       
  2419     /* Traffic handling priority to precedence */
       
  2420     switch (aQoSR99_R4Negotiated.iTrafficHandlingPriority)
       
  2421     	{
       
  2422 	case RPacketQoS::ETrafficPriority1:
       
  2423 		aQoSGPRSNegotiated.iPrecedence = RPacketQoS::EPriorityHighPrecedence;
       
  2424 		break;
       
  2425 	case RPacketQoS::ETrafficPriority2:
       
  2426 		aQoSGPRSNegotiated.iPrecedence = RPacketQoS::EPriorityMediumPrecedence;
       
  2427 		break;
       
  2428 	case RPacketQoS::ETrafficPriority3:
       
  2429 		aQoSGPRSNegotiated.iPrecedence = RPacketQoS::EPriorityLowPrecedence;
       
  2430 		break;
       
  2431 	default:
       
  2432 		aQoSGPRSNegotiated.iPrecedence = RPacketQoS::EUnspecifiedPrecedence;
       
  2433 		break;
       
  2434     	}
       
  2435     
       
  2436     /* Mean throughput always at best effort */
       
  2437     aQoSGPRSNegotiated.iMeanThroughput = RPacketQoS::EMeanThroughputBestEffort;
       
  2438 
       
  2439     /* Delivery order to reordering required */
       
  2440     if (aQoSR99_R4Negotiated.iDeliveryOrderReqd == RPacketQoS::EDeliveryOrderRequired)
       
  2441         {
       
  2442         /* Not clear what corresponding value to set */
       
  2443         }
       
  2444     else if (aQoSR99_R4Negotiated.iDeliveryOrderReqd == RPacketQoS::EDeliveryOrderNotRequired)
       
  2445         {
       
  2446         /* Not clear what corresponding value to set */
       
  2447         }
       
  2448     else
       
  2449         {
       
  2450         /* Not clear what corresponding value to set */
       
  2451         }
       
  2452 
       
  2453     return KErrNone;
       
  2454     }
       
  2455 
       
  2456 /*
       
  2457 * Perform conversion from R97 negotiated QoS to R99 negotiated QoS according to 3GPP 24.008-750
       
  2458 *
       
  2459 * @param aQoSGPRSNegotiated - Etel GPRS negotiated QoS
       
  2460 * @param aQoSR99_R4Negotiated - Etel R99_R4 negotiated QoS
       
  2461 *
       
  2462 * @return Etel error code
       
  2463 */
       
  2464 TInt CPacketServicesDispatcher::EtelPcktR97NegToEtelPcktR99R4NegQoS(const RPacketQoS::TQoSGPRSNegotiated& aQoSGPRSNegotiated,
       
  2465 											   RPacketQoS::TQoSR99_R4Negotiated& aQoSR99_R4Negotiated)
       
  2466 	{
       
  2467 
       
  2468 	RPacketQoS::TQoSGPRSRequested generatedGPRSQoS;
       
  2469 
       
  2470     /* Traffic class/handling delay to traffic*/
       
  2471 	if ((aQoSGPRSNegotiated.iDelay == RPacketQoS::EDelayClass1) || (aQoSGPRSNegotiated.iDelay == RPacketQoS::EDelayClass2) || (aQoSGPRSNegotiated.iDelay == RPacketQoS::EDelayClass3))
       
  2472 		{
       
  2473 		aQoSR99_R4Negotiated.iTrafficClass = RPacketQoS::ETrafficClassInteractive;
       
  2474 		}
       
  2475 	else if (aQoSGPRSNegotiated.iDelay == RPacketQoS::EDelayClass4)
       
  2476 		{
       
  2477 		aQoSR99_R4Negotiated.iTrafficClass = RPacketQoS::ETrafficClassBackground;
       
  2478 		}
       
  2479 	else
       
  2480 		{
       
  2481 		aQoSR99_R4Negotiated.iTrafficClass = RPacketQoS::ETrafficClassUnspecified;
       
  2482 		}
       
  2483 
       
  2484 	/* Traffic handling priority class/traffic handling priority*/
       
  2485 	switch (aQoSGPRSNegotiated.iDelay)
       
  2486 		{
       
  2487 	case RPacketQoS::EDelayClass1:
       
  2488 		aQoSR99_R4Negotiated.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority1;
       
  2489 		break;
       
  2490 	case RPacketQoS::EDelayClass2:
       
  2491 		aQoSR99_R4Negotiated.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority2;
       
  2492 		break;
       
  2493 	case RPacketQoS::EDelayClass3:
       
  2494 		aQoSR99_R4Negotiated.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority3;
       
  2495 		break;
       
  2496 	default:	
       
  2497 		aQoSR99_R4Negotiated.iTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified;
       
  2498 		break;		
       
  2499 		}
       
  2500 	
       
  2501 	/* Reliability calss to SDU error ratio*/
       
  2502 	if ((aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass1) || (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass2))
       
  2503 		{
       
  2504 		aQoSR99_R4Negotiated.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerHundredThousand;
       
  2505 		}
       
  2506 	else if (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass3)
       
  2507 		{
       
  2508 		aQoSR99_R4Negotiated.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerTenThousand;
       
  2509 		}
       
  2510 	else if ((aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass4) || (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass5))
       
  2511 		{
       
  2512 		aQoSR99_R4Negotiated.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerThousand;
       
  2513 		}
       
  2514 	else
       
  2515 		{
       
  2516 		aQoSR99_R4Negotiated.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified;
       
  2517 		}
       
  2518 
       
  2519 
       
  2520 	/* Reliability calss to Residual bit error ratio*/
       
  2521     if  ((aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass1) || (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass2)
       
  2522     	|| (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass3) || (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass4))
       
  2523     	{
       
  2524     	aQoSR99_R4Negotiated.iBER = RPacketQoS::EBEROnePerHundredThousand;
       
  2525     	}
       
  2526     else if (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass5)
       
  2527         {
       
  2528         aQoSR99_R4Negotiated.iBER = RPacketQoS::EBERFourPerThousand;
       
  2529         }
       
  2530     else
       
  2531     	{
       
  2532     	aQoSR99_R4Negotiated.iBER = RPacketQoS::EBERUnspecified;
       
  2533     	}
       
  2534 
       
  2535     /* Reliability class to delivery of erroneous SDUs*/
       
  2536     if  ((aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass1) || (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass2)
       
  2537     	|| (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass3) || (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass4))
       
  2538     	{
       
  2539     	aQoSR99_R4Negotiated.iDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired;
       
  2540     	}
       
  2541     else if (aQoSGPRSNegotiated.iReliability == RPacketQoS::EReliabilityClass5)
       
  2542         {
       
  2543         aQoSR99_R4Negotiated.iDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired;
       
  2544         }
       
  2545     else
       
  2546     	{
       
  2547     	aQoSR99_R4Negotiated.iDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified;
       
  2548     	}
       
  2549 
       
  2550     /* Peak throughput class to Max bitrate*/
       
  2551     switch (aQoSGPRSNegotiated.iPeakThroughput)
       
  2552     	{
       
  2553 	case RPacketQoS::EPeakThroughput1000:		
       
  2554 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 8;
       
  2555 		break;
       
  2556 	case RPacketQoS::EPeakThroughput2000:
       
  2557 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 16;
       
  2558 		break;
       
  2559 	case RPacketQoS::EPeakThroughput4000:
       
  2560 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 32;
       
  2561 		break;
       
  2562 	case RPacketQoS::EPeakThroughput8000:
       
  2563 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 64;
       
  2564 		break;
       
  2565 	case RPacketQoS::EPeakThroughput16000:
       
  2566 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 128;
       
  2567 		break;
       
  2568 	case RPacketQoS::EPeakThroughput32000:
       
  2569 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 256;
       
  2570 		break;		
       
  2571 	case RPacketQoS::EPeakThroughput64000:
       
  2572 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 512;
       
  2573 		break;
       
  2574 	case RPacketQoS::EPeakThroughput128000:
       
  2575 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 1024;
       
  2576 		break;
       
  2577 	case RPacketQoS::EPeakThroughput256000:
       
  2578 		aQoSR99_R4Negotiated.iMaxRate.iDownlinkRate = 2048;
       
  2579 		break;
       
  2580 	case RPacketQoS::EUnspecifiedPeakThroughput:
       
  2581 	default:
       
  2582 		break;
       
  2583     	}
       
  2584 
       
  2585     /*Precendence class to allocation/retention priority*/
       
  2586     if (aQoSGPRSNegotiated.iPrecedence == RPacketQoS::EPriorityHighPrecedence)
       
  2587     	{
       
  2588     	/**/
       
  2589     	}
       
  2590     else if (aQoSGPRSNegotiated.iPrecedence == RPacketQoS::EPriorityMediumPrecedence)
       
  2591     	{
       
  2592     	/**/
       
  2593     	}
       
  2594     else if (aQoSGPRSNegotiated.iPrecedence == RPacketQoS::EPriorityMediumPrecedence)
       
  2595     	{
       
  2596     	/**/
       
  2597     	}
       
  2598     else
       
  2599     	{
       
  2600     	/**/
       
  2601     	}
       
  2602 
       
  2603 	return KErrNone;
       
  2604 	}
       
  2605 
       
  2606 /*
       
  2607 * Perform conversion from R99 negotiated QoS to R5 negotiated QoS according to 3GPP 24.008-750
       
  2608 *
       
  2609 * @param aQoSR99_R4Negotiated - Etel R99_R4 negotiated QoS
       
  2610 * @param aQoSR5Negotiated - Etel R5 negotiated QoS
       
  2611 *
       
  2612 * @return Etel error code
       
  2613 */
       
  2614 TInt CPacketServicesDispatcher::EtelPcktR99R4NegToEtelPcktR5NegQoS(const RPacketQoS::TQoSR99_R4Negotiated& aQoSR99_R4Negotiated,
       
  2615 											   RPacketQoS::TQoSR5Negotiated& aQoSR5Negotiated)
       
  2616 	{
       
  2617 	aQoSR5Negotiated.iTrafficClass = aQoSR99_R4Negotiated.iTrafficClass;
       
  2618 	aQoSR5Negotiated.iDeliveryOrderReqd = aQoSR99_R4Negotiated.iDeliveryOrderReqd;	//< Negotiated value for sequential SDU delivery
       
  2619 	aQoSR5Negotiated.iDeliverErroneousSDU = aQoSR99_R4Negotiated.iDeliverErroneousSDU;	//< Negotiated value for erroneous SDU delivery
       
  2620 	aQoSR5Negotiated.iMaxSDUSize = aQoSR99_R4Negotiated.iMaxSDUSize; //< Negotiated maximum SDU size (in octets)
       
  2621 	aQoSR5Negotiated.iMaxRate = aQoSR99_R4Negotiated.iMaxRate;		//< Negotiated maximum bit rates on the uplink and downlink
       
  2622 	aQoSR5Negotiated.iBER = aQoSR99_R4Negotiated.iBER;				//< Negotiated target BER
       
  2623 	aQoSR5Negotiated.iSDUErrorRatio = aQoSR99_R4Negotiated.iSDUErrorRatio;	//< Negotiated target SDU error ratio
       
  2624 	aQoSR5Negotiated.iTrafficHandlingPriority = aQoSR99_R4Negotiated.iTrafficHandlingPriority;	//< Negotiated traffic handling priority
       
  2625 	aQoSR5Negotiated.iTransferDelay = aQoSR99_R4Negotiated.iTransferDelay;	//< Negotiated transfer delay (in milliseconds)
       
  2626 	aQoSR5Negotiated.iGuaranteedRate = aQoSR99_R4Negotiated.iGuaranteedRate;
       
  2627 
       
  2628 	return KErrNone;
       
  2629 	}
       
  2630 
       
  2631 void CPacketServicesDispatcher::ConvertDNSToPCOBuffer
       
  2632 	(const TDes8& aPrimaryDNS, const TDes8& aSecondaryDNS, const TUint8 aRequestID, TDes8& aFormatPcoBufferAddr)
       
  2633 	{
       
  2634 
       
  2635     // Handle Primary DNS address
       
  2636     TInetAddr netPrimaryDNS;
       
  2637     TBuf<32> netPrimaryDNSConv;
       
  2638     netPrimaryDNSConv.Copy(aPrimaryDNS);
       
  2639     // coverity[check_return]
       
  2640     netPrimaryDNS.Input(netPrimaryDNSConv);
       
  2641     TUint32 primDNSaddr =  netPrimaryDNS.Address();
       
  2642 
       
  2643     // Handle Secondary DNS address
       
  2644     TInetAddr netSecondaryDNS;
       
  2645     TBuf<32> netSecondaryDNSConv;
       
  2646     netSecondaryDNSConv.Copy(aSecondaryDNS);
       
  2647     // coverity[check_return]
       
  2648     netSecondaryDNS.Input(netSecondaryDNSConv);
       
  2649     TUint32 secondaryDNSaddr =  netSecondaryDNS.Address();
       
  2650 
       
  2651 	aFormatPcoBufferAddr[0] = KPrimaryAndSecondaryDNSLength;		// Length
       
  2652 	aFormatPcoBufferAddr[1] = KIPCRequestCode; 					// IPC PRequest Code
       
  2653 	aFormatPcoBufferAddr[2] = aRequestID;  					// Request ID (CHAP challenge)
       
  2654 	aFormatPcoBufferAddr[3] = KPacketLengthMSB;					// Packet length MSB (always zero)
       
  2655 	aFormatPcoBufferAddr[4] = KPrimaryAndSecondaryDNSLength;     // Packet length LSB
       
  2656 	aFormatPcoBufferAddr[5] = KIndicatePrimaryAddress; 			// Indicate Primary address
       
  2657 	aFormatPcoBufferAddr[6]	= KDnsAddressLength;				// Length of address (inc header)
       
  2658 	aFormatPcoBufferAddr[7] = (primDNSaddr >> 24) & 0xff; 		// Primary DNS
       
  2659 	aFormatPcoBufferAddr[8] = (primDNSaddr >> 16) & 0xff; 		// Primary DNS
       
  2660 	aFormatPcoBufferAddr[9] = (primDNSaddr >> 8) & 0xff; 		// Primary DNS
       
  2661 	aFormatPcoBufferAddr[10] =  primDNSaddr & 0xff; 		    // Primary DNS
       
  2662 	aFormatPcoBufferAddr[11] = KIndicateSecondaryAddress;		// Indicate Secondary address
       
  2663 	aFormatPcoBufferAddr[12] = KDnsAddressLength;				// Length of address (inc header)
       
  2664 	aFormatPcoBufferAddr[13] = (secondaryDNSaddr >> 24) & 0xff; // Secondary DNS
       
  2665 	aFormatPcoBufferAddr[14] = (secondaryDNSaddr >> 16) & 0xff; // Secondary DNS
       
  2666 	aFormatPcoBufferAddr[15] = (secondaryDNSaddr >> 8) & 0xff; 	// Secondary DNS
       
  2667 	aFormatPcoBufferAddr[16] =  secondaryDNSaddr & 0xff; 		// Secondary DNS
       
  2668 	aFormatPcoBufferAddr.SetLength(KPrimaryAndSecondaryDNSLength + 1);
       
  2669 	}
       
  2670 
       
  2671 void CPacketServicesDispatcher::ConvertUsernameAndPasswordToPCOBuffer(const TDes8& aUsername, const TDes8& aPassword, TUint8 aRequestID, TDes8& aFormatedBuffer)
       
  2672 	{
       
  2673 	TInt usernameLen = aUsername.Length();
       
  2674 	TInt passwordLen = aPassword.Length();
       
  2675 	TInt dataLen = usernameLen + passwordLen + KPasswordUsernameHeaderLength;
       
  2676 	TInt i = 0;
       
  2677 
       
  2678 	aFormatedBuffer[i++] = dataLen; 				// Length
       
  2679 	aFormatedBuffer[i++] = KIPCRequestCode; 		// IPC PRequest Code
       
  2680 	aFormatedBuffer[i++] = aRequestID; 				// Request ID (CHAP challenge)
       
  2681 	aFormatedBuffer[i++] = KPacketLengthMSB; 		// Packet length MSB (always zero)
       
  2682 	aFormatedBuffer[i++] = dataLen; 				// Packet length LSB
       
  2683 	aFormatedBuffer[i++] = usernameLen; 			// Length of username
       
  2684 	aFormatedBuffer.SetLength(i);
       
  2685 	aFormatedBuffer.Append(aUsername); 				// Username
       
  2686 	aFormatedBuffer.SetLength(i + usernameLen + 1);
       
  2687 	aFormatedBuffer[i + usernameLen] = passwordLen; // Length of password
       
  2688 	aFormatedBuffer.Append(aPassword);				// Password
       
  2689 	}
       
  2690 
       
  2691 void CPacketServicesDispatcher::DecodePCO(const RPacketContext::TMiscProtocolBuffer& aPcoBuffer, RPacketContext::TAuthData& aUsername, RPacketContext::TAuthData& aPassword, RPacketContext::TProtocolAddress& aPrimaryDNS, RPacketContext::TProtocolAddress& aSecondaryDNS, RPacketContext::TMiscProtocolBuffer& aMiscBuffer)
       
  2692 	{
       
  2693 	TUint currIndex = KHeaderGap;
       
  2694 
       
  2695 	// Skip Headers
       
  2696 	TUint usernameLen = aPcoBuffer[currIndex++];
       
  2697 
       
  2698 	// Get the username
       
  2699 	aUsername = aPcoBuffer.Mid(currIndex, usernameLen);
       
  2700 	currIndex += usernameLen;
       
  2701 
       
  2702 	TUint passwordLen = aPcoBuffer[currIndex++];
       
  2703 	aPassword = aPcoBuffer.Mid(currIndex, passwordLen);
       
  2704 
       
  2705 	currIndex += passwordLen;
       
  2706 	currIndex += KHeaderGap;
       
  2707 
       
  2708 	// Skip primary DNS length
       
  2709 	currIndex += 2;
       
  2710 
       
  2711 	// Get the primary DNS
       
  2712 	TUint32 uintDnsAddr = 0;
       
  2713 	uintDnsAddr = aPcoBuffer[currIndex++];
       
  2714 	uintDnsAddr <<= 8;
       
  2715 	uintDnsAddr |= aPcoBuffer[currIndex++];
       
  2716 	uintDnsAddr <<= 8;
       
  2717 	uintDnsAddr |= aPcoBuffer[currIndex++];
       
  2718 	uintDnsAddr <<= 8;
       
  2719 	uintDnsAddr |= aPcoBuffer[currIndex++];
       
  2720 
       
  2721 	TInetAddr dnsInetAddr;
       
  2722 	dnsInetAddr.SetAddress(uintDnsAddr);
       
  2723 	TBuf<32> netPrimaryDNSAddrLogOutput;
       
  2724 	dnsInetAddr.Output(netPrimaryDNSAddrLogOutput);
       
  2725 	aPrimaryDNS.Copy(netPrimaryDNSAddrLogOutput);
       
  2726 
       
  2727 	// Skip the Secondary indicator
       
  2728 	currIndex += 2;
       
  2729 
       
  2730 	uintDnsAddr = 0;
       
  2731 	uintDnsAddr = aPcoBuffer[currIndex++];
       
  2732 	uintDnsAddr <<= 8;
       
  2733 	uintDnsAddr |= aPcoBuffer[currIndex++];
       
  2734 	uintDnsAddr <<= 8;
       
  2735 	uintDnsAddr |= aPcoBuffer[currIndex++];
       
  2736 	uintDnsAddr <<= 8;
       
  2737 	uintDnsAddr |= aPcoBuffer[currIndex++];
       
  2738 
       
  2739 	dnsInetAddr.SetAddress(uintDnsAddr);
       
  2740 	TBuf<32> netSecondaryDNSAddrLogOutput;
       
  2741 	dnsInetAddr.Output(netSecondaryDNSAddrLogOutput);
       
  2742 	aSecondaryDNS.Copy(netSecondaryDNSAddrLogOutput);
       
  2743 
       
  2744 	aMiscBuffer = aPcoBuffer.Mid(currIndex);
       
  2745 	}
       
  2746 
       
  2747 CPcktMbmsMonitoredServiceList* CPacketServicesDispatcher::CreateServiceListL(const RArray<TUint>& aServiceIds) const
       
  2748 	{
       
  2749 	CPcktMbmsMonitoredServiceList* updateMbmsMonitorServiceList = CPcktMbmsMonitoredServiceList::NewL();
       
  2750 	CleanupStack::PushL(updateMbmsMonitorServiceList);
       
  2751 
       
  2752 	const TInt serviceIdCount = aServiceIds.Count();
       
  2753 	RPacketService::TMbmsServiceAvailabilityV1 entry;
       
  2754 
       
  2755 	for(TInt i = 0; i < serviceIdCount; ++i)
       
  2756 		{
       
  2757 		entry.iTmgi.SetServiceId(aServiceIds[i]);
       
  2758 		updateMbmsMonitorServiceList->AddEntryL(entry);
       
  2759 		}
       
  2760 	
       
  2761 	CleanupStack::Pop(updateMbmsMonitorServiceList);
       
  2762 	return updateMbmsMonitorServiceList;
       
  2763 	}
       
  2764 
       
  2765