--- a/telephonyprotocols/rawipnif/src/RawIPFlow.cpp Mon May 24 18:38:31 2010 +0100
+++ b/telephonyprotocols/rawipnif/src/RawIPFlow.cpp Tue Jun 22 11:02:32 2010 +0100
@@ -21,6 +21,12 @@
@file
*/
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "RawIPFlowTraces.h"
+#endif
+
#include <f32file.h>
#include <nifman.h>
#include <nifmbuf.h>
@@ -46,15 +52,13 @@
static const TUint16 KTcpDumpLinkType = 12;
#endif
-CRawIPFlow::CRawIPFlow(CSubConnectionFlowFactoryBase& aFactory, const TNodeId& aSubConnId, CProtocolIntfBase* aProtocolIntf, CBttLogger* aTheLogger)
+CRawIPFlow::CRawIPFlow(CSubConnectionFlowFactoryBase& aFactory, const TNodeId& aSubConnId, CProtocolIntfBase* aProtocolIntf)
/**
* Constructor.
*
* @param aFactory Reference to the factory which created this object.
- * @param aTheLogger The logging object, ownership is passed to this object
*/
: CSubConnectionFlowBase(aFactory, aSubConnId, aProtocolIntf),
- iTheLogger(aTheLogger),
iInitError(KErrNone),
iStarted(EFalse),
iStopping(EFalse)
@@ -70,9 +74,9 @@
* @param aName The name of the NIF (unused)
*/
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tConstructL()"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_CONSTRUCTL_1, "CRawIPFlow %08x:\tConstructL()", this);
iBinderControl = new (ELeave) TBinderControlProxy(*this);
- iBcaController = CBcaIoController::NewL(*this, iTheLogger);
+ iBcaController = CBcaIoController::NewL(*this);
}
CRawIPFlow::~CRawIPFlow()
@@ -82,8 +86,6 @@
{
// Note that we don't delete iBinder because it's not owned by us.
delete iBcaController;
- // This class also deletes the logging object
- delete iTheLogger;
ASSERT(iBinder == NULL);
@@ -105,7 +107,7 @@
{
ASSERT(iStarting==EFalse);
iStarting = ETrue;
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tStartFlowL()"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_STARTFLOWL_1, "CRawIPFlow %08x:\tStartFlowL()", this);
// If there were any errors during earlier processing of the ProvisionConfig message
// then send an Error message in response to the StartFlow (because ProvisionConfig
@@ -140,13 +142,13 @@
_LIT8(KTimeFormat, "%08X");
TUint32 counter = User::FastCounter();
logFileName.Format(KTimeFormat, counter);
-
- TRAPD(err,__PACKETLOG_NEWL(KTcpDumpFirstTag, logFileName, CPacketLogger::ETcpDump, KTcpDumpLinkType));
- if (err)
- {
- _LOG_L1C1(_L8("Trapped leave from __PACKETLOG_NEWL"));
- }
-
+
+ TRAPD(err,__PACKETLOG_NEWL(KTcpDumpFirstTag, logFileName, CPacketLogger::ETcpDump, KTcpDumpLinkType));
+ if (err)
+ {
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_STARTFLOWL_2, "Trapped leave from __PACKETLOG_NEWL");
+ }
+
const TUint KLogTextLen = KModemNameLen+KTimeStampLen+30;
TBuf8<KLogTextLen> logText;
_LIT8(KLogTimeText, "TcpDump log file time stamp:");
@@ -155,7 +157,7 @@
logText.Append(logFileName);
logText.Append(KLogModemText);
logText.Append(modemName);
- _LOG_L1C1(logText);
+ OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_STARTFLOWL_3, "%s", logText);
#endif
}
@@ -167,7 +169,7 @@
* ready to go.
*/
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tLinkLayerUp()"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_LINKLAYERUP_1, "CRawIPFlow %08x:\tLinkLayerUp()", this);
iLastRequestOriginator.ReplyTo(Id(), TCFDataClient::TStarted().CRef());
@@ -186,9 +188,10 @@
* @param aError An error code to propagate to NifMan
*/
{
- _LOG_L1C3(_L8("CRawIPFlow %08x:\tLinkLayerDown(aError %d)"), this, aError);
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_LINKLAYERDOWN_1, "CRawIPFlow %08x:\tLinkLayerDown(aError %d)", (TUint)this, aError);
+
__PACKETLOG_DELETE;
-
+
if (iStopping)
{
iLastRequestOriginator.ReplyTo(Id(), TCFDataClient::TStopped(aError).CRef());
@@ -217,7 +220,7 @@
* @param aAction The action to take: disconnect or reconnect
*/
{
- _LOG_L1C3(_L8("CRawIPFlow %08x:\tStopFlow(aError %d)"), this, aError);
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_STOPFLOW_1, "CRawIPFlow %08x:\tStopFlow(aError %d)", (TUint)this, aError);
__PACKETLOG_DELETE;
iStopping = ETrue;
ShutDown(MControllerObserver::EInitialised, aError);
@@ -233,9 +236,7 @@
* @return MLowerDataSender::TSendResult
*/
{
- _LOG_L1C3(_L8("CRawIPFlow %08x:\tSendPacket(): length=%d"),
- this, aPdu.Length() - aPdu.First()->Length());
-
+ OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_SENDPACKET_1, "CRawIPFlow %08x:\tSendPacket(): length=%d, blocked=%d", (TUint)this, aPdu.Length() - aPdu.First()->Length(),iBlocked);
__PACKETLOG_WRITE_PACKET(aPdu, 0);
return iBcaController->Send(aPdu);
}
@@ -249,13 +250,12 @@
* @param aPdu The incoming packet
*/
{
- _LOG_L1C3(_L8("CRawIPFlow %08x:\tProcess() [aPdu length=%d]"),
- this, aPdu.Length() - aPdu.First()->Length());
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_PROCESS_1, "CRawIPFlow %08x:\tProcess() [aPdu length=%d]",(TUint)this, aPdu.Length() - aPdu.First()->Length());
// If the packet has zero or negative length, bin it.
if ((aPdu.Length() - aPdu.First()->Length()) <= 0)
{
- _LOG_L1C1(_L8("Dumped packet: illegal length"));
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_PROCESS_2, "Dumped packet: illegal length");
aPdu.Free();
return;
}
@@ -269,11 +269,10 @@
else
{
// The protocol didn't want the packet, so bin it.
- _LOG_L1C2(_L8("Packet was not processed: freeing (protocol code: %X)"),
- aProtocolCode);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_PROCESS_3, "Packet was not processed: freeing (protocol code: %X)",aProtocolCode);
if (iBinder == NULL)
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tProcess(): NOTE: Binder not present"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_PROCESS_4, "CRawIPFlow %08x:\tProcess(): NOTE: Binder not present", this);
}
aPdu.Free();
}
@@ -284,7 +283,7 @@
* Notifies the protocol interface that it can resume sending packets.
*/
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tResumeSending()"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_RESUMESENDING_1, "CRawIPFlow %08x:\tResumeSending()", this);
if (iBinder)
{
@@ -292,7 +291,7 @@
}
else
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tResumeSending(): NOTE: Binder not present"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_RESUMESENDING_2, "CRawIPFlow %08x:\tResumeSending(): NOTE: Binder not present", this);
}
}
@@ -307,12 +306,11 @@
* @param aError A possible error
*/
{
- _LOG_L1C4(_L8("CRawIPFlow %08x:\tInitialiseL(aState %d, aError %d)"),
- this, aState, aError);
+ OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_1, "CRawIPFlow %08x:\tInitialiseL(aState %d, aError %d)",(TUint)this, aState, aError);
if (aError != KErrNone)
{
- _LOG_L2C2(_L8(" *** FAILED to initialise NIF *** Error =%d"),aError);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_2, " *** FAILED to initialise NIF *** Error =%d",aError);
// Initialise shutdown sequence
switch (aState)
@@ -321,7 +319,7 @@
ShutDown(MControllerObserver::EInitialised, aError);
break;
default:
- _LOG_L2C3(_L8("ERROR CRawIPFlow: Unknown state:%d in NIF: %S"), aState, &KNifName);
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_3, "ERROR CRawIPFlow: Unknown state:%d in NIF: %S", aState, KNifName);
User::Leave(KErrUnknown);
break;
}
@@ -336,13 +334,13 @@
GetBinder()->UpdateContextConfigL(*iAgentProvision->iGprsConfig);
GetBinder()->UpdateConnectionSpeed(iAgentProvision->iConnectionSpeed);
- _LOG_L1C2(_L8("Port details %S"), &iProvision->GetPortName());
+ OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_4, "Port details %S", iProvision->GetPortName());
iBcaController->SetPort(iProvision->GetPortName());
- _LOG_L1C3(_L8("bcaName details %S,%S"),&iProvision->GetBCAStack(), &iProvision->GetBCAName());
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_5, "bcaName details %S,%S",iProvision->GetBCAStack(), iProvision->GetBCAName());
iBcaController->SetBcaStackAndName(iProvision->GetBCAStack(), iProvision->GetBCAName());
- _LOG_L1C2(_L8("IAP ID details %u"), iProvision->GetIAPid());
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_6, "IAP ID details %u", iProvision->GetIAPid());
iBcaController->SetIapId(iProvision->GetIAPid());
UpdateContextState(RPacketContext::EStatusActive, KErrNone);
@@ -351,11 +349,11 @@
}
break;
case MControllerObserver::EBcaController:
- _LOG_L1C1(_L8(" ***** NIF INITIALISED *****"));
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_7, " ***** NIF INITIALISED *****");
LinkLayerUp();
break;
default:
- _LOG_L2C3(_L8("ERROR CRawIPFlow: Unknown state:%d in NIF: %S"), aState, &KNifName);
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_INITIALISEL_8, "ERROR CRawIPFlow: Unknown state:%d in NIF: %S", aState, KNifName);
User::Leave(KErrUnknown);
break;
}
@@ -371,8 +369,7 @@
* @param aError A possible error (only during initialisation)
*/
{
- _LOG_L1C4(_L8("CRawIPFlow %08x:\tShutDown(aState %d, aError %d)"),
- this, aState, aError);
+ OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_SHUTDOWN_1, "CRawIPFlow %08x:\tShutDown(aState %d, aError %d)",(TUint)this, aState, aError);
if (aError != KErrNone)
{
@@ -391,8 +388,9 @@
LinkLayerDown(iInitError);
break;
default:
- _LOG_L2C1(_L8("ERROR CRawIPFlow: Unknown Shutdown step"));
- _BTT_PANIC(KNifName,KNifUnknownShutDownState);
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_SHUTDOWN_2, "ERROR CRawIPFlow: Unknown Shutdown step");
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_SHUTDOWN_3, "PANIC: %S %d", KNifName, KNifUnknownShutDownState);
+ User::Panic(KNifName,KNifUnknownShutDownState);
break;
}
}
@@ -426,7 +424,7 @@
* @param aError A possible error
*/
{
- _LOG_L1C3(_L8("CRawIPFlow %08x:\tUpdateContextState(aState %d)"), this, aState);
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_UPDATECONTEXTSTATE_1, "CRawIPFlow %08x:\tUpdateContextState(aState %d)",(TUint) this, aState);
// Note that we do not need to close the Flow down if there's been an
// error, as the context state machine will do this for us.
@@ -451,25 +449,23 @@
MLowerControl* CRawIPFlow::GetControlL(const TDesC8& aProtocol)
{
-#ifdef __BTT_LOGGING__
- //TBuf8<256> debugBuffer;
- //debugBuffer.Copy(aProtocol);
- _LOG_L1C3(_L8("CRawIPFlow %08x:\tGetControlL(aProtocol %S)"), this, &aProtocol);
-#endif
+
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_GETCONTROLL_1, "CRawIPFlow %08x:\tGetControlL(aProtocol %s)", (TUint)this, aProtocol);
+
// IPv4 and ICMP Protocols
if (aProtocol.CompareF(KDescIp()) == 0 || aProtocol.CompareF(KDescIcmp()) == 0)
{
if (!iBinder)
{
- iBinder = new (ELeave) CIPv4Binder(*this, iTheLogger);
+ iBinder = new (ELeave) CIPv4Binder(*this);
#ifdef RAWIP_HEADER_APPENDED_TO_PACKETS
iBcaController->SetType(KIp4FrameType);
#endif // RAWIP_HEADER_APPENDED_TO_PACKETS
}
else
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tGetControlL(): IPv4 binder already exists"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_GETCONTROLL_2, "CRawIPFlow %08x:\tGetControlL(): IPv4 binder already exists", this);
}
}
// IPv6 Protocol
@@ -477,14 +473,14 @@
{
if (!iBinder)
{
- iBinder = new (ELeave) CIPv6Binder(*this, iTheLogger);
+ iBinder = new (ELeave) CIPv6Binder(*this);
#ifdef RAWIP_HEADER_APPENDED_TO_PACKETS
iBcaController->SetType(KIp6FrameType);
#endif // RAWIP_HEADER_APPENDED_TO_PACKETS
}
else
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tGetControlL(): IPv6 binder already exists"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_GETCONTROLL_3, "CRawIPFlow %08x:\tGetControlL(): IPv6 binder already exists", this);
}
}
else
@@ -517,7 +513,7 @@
void CRawIPFlow::Unbind(MUpperDataReceiver* aUpperReceiver, MUpperControl* aUpperControl)
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tUnbind()"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_UNBIND_1, "CRawIPFlow %08x:\tUnbind()", this);
if (iBinder)
{
@@ -640,7 +636,6 @@
//doesn't notice anything. It does that by swapping the
//flows below the binders.
CBinderBase* localBinder = iBinder;
- CBttLogger* logger = localBinder->iTheLogger;
TBinderControlProxy* localBinderControl = iBinderControl;
iBinder = otherFlow->iBinder;
@@ -652,7 +647,6 @@
otherFlow->iBinderControl->iFlow = otherFlow;
iBinderControl->iFlow = this;
- iBinder->iTheLogger = logger;
iSubConnectionProvider.Close();
iSubConnectionProvider.Open(address_cast<TNodeId>(rejoinMsg.iNodeId));
@@ -726,7 +720,7 @@
@param aData provisioning pointer from message
*/
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tProvisionConfig()"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_PROVISIONCONFIG_1, "CRawIPFlow %08x:\tProvisionConfig()", this);
AccessPointConfig().Close();
AccessPointConfig().Open(aConfigData);
@@ -743,7 +737,7 @@
{
if (iProvision == NULL)
{
- _LOG_L1C1(_L8("CRawIPFlow:\tProvisionConfigL() - CBCAProvision config incomplete"));
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_DYNAMICPROVISIONCONFIGL_1, "CRawIPFlow:\tProvisionConfigL() - CBCAProvision config incomplete");
iProvisionError = KErrCorrupt;
return;
}
@@ -761,7 +755,7 @@
STypeId::CreateSTypeId(CIPConfig::EUid, CIPConfig::ETypeId)));
if (wcdmaIpProvision == NULL)
{
- _LOG_L1C2(_L8("CRawIPFlow %08x:\tDynamicProvisionConfigL() - WCDMA config incomplete"), this);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_DYNAMICPROVISIONCONFIGL_2, "CRawIPFlow %08x:\tDynamicProvisionConfigL() - WCDMA config incomplete", this);
iProvisionError = KErrCorrupt;
return;
}
@@ -789,13 +783,13 @@
some historical understanding.
*/
{
- _LOG_L1C3(_L8("CRawIPFlow %08x:\tNotification(aEvent %d)"), this, aEvent);
+ OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_NOTIFICATION_1, "CRawIPFlow %08x:\tNotification(aEvent %d)", (TUint)this, aEvent);
switch (aEvent)
{
- case EAgentToNifEventTypeDisableTimers: //GPRS suspension
- {
- _LOG_L1C1(_L8("CRawIPFlow::Received Suspend from Agent..."));
+ case EAgentToNifEventTypeDisableTimers: //GPRS suspension
+ {
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_NOTIFICATION_2, "CRawIPFlow::Received Suspend from Agent...");
// Let the BCA controller know that data can no longer be sent over
// the PDP context.
@@ -806,7 +800,7 @@
case EAgentToNifEventTypeEnableTimers: //GPRS resumption
{
- _LOG_L1C1(_L8("CRawIPFlow::Received Resume from Agent..."));
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_NOTIFICATION_3, "CRawIPFlow::Received Resume from Agent...");
iBcaController->ResumeSending();
break;
@@ -814,13 +808,13 @@
case (EAgentToNifEventTypeDisableConnection) :
{
// This is handled by NIFMAN and passed to Flow as a Stop() call
- _LOG_L1C1(_L8("CRawIPFlow::Received Disable connection from Agent..."));
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_NOTIFICATION_4, "CRawIPFlow::Received Disable connection from Agent...");
break;
}
default :
{
- _LOG_L1C2(_L8("CRawIPFlow::Received Notification [%d] from Agent..."), aEvent);
+ OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CRAWIPFLOW_NOTIFICATION_5, "CRawIPFlow::Received Notification [%d] from Agent...", aEvent);
break;
}
}//endswitch