networkcontrol/ipnetworklayer/inc/notify.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 /**
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Support for TCP/IP calls directly to MNifIfNotify methods
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file notify.h
       
    24 */
       
    25 
       
    26 
       
    27 #if !defined(IPSHIMFLOW_NOTIFY_H_INCLUDED_)
       
    28 #define IPSHIMFLOW_NOTIFY_H_INCLUDED_
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <comms-infras/nifif.h>
       
    32 #include "nif.h"
       
    33 
       
    34 namespace ESock
       
    35 {
       
    36 struct TDataVolumes;
       
    37 struct TNotificationThresholds;
       
    38 }
       
    39 
       
    40 class CIPShimIfBase;
       
    41 class TPacketActivity;
       
    42 
       
    43 class CIPShimNotify : public CBase, public MNifIfNotify
       
    44 /**
       
    45 Class used to support TCP/IP stack MNifIfNotify calls to NIFMAN via CNifIfBase.
       
    46 
       
    47 Only the OpenRoute()/CloseRoute()/PacketActivity() methods are actually called by the
       
    48 TCP/IP stack and are supported.  All other MNifIfNotify methods just panic.
       
    49 
       
    50 @internalComponent
       
    51 */
       
    52 	{
       
    53 public:
       
    54 	static CIPShimNotify* NewL(CIPShimIfBase* aIntf);
       
    55 
       
    56 	// from MNifIfNotify
       
    57 	// (the only methods supported are: OpenRoute(), CloseRoute(), PacketActivity())
       
    58 	void LinkLayerDown(TInt aReason, TAction aAction);
       
    59 	void LinkLayerUp();
       
    60 	void NegotiationFailed(CNifIfBase* aIf, TInt aReason);
       
    61 	TInt Authenticate(TDes& aUsername, TDes& aPassword);
       
    62 	void CancelAuthenticate();
       
    63 	TInt GetExcessData(TDes8& aBuffer);
       
    64 	void IfProgress(TInt aStage, TInt aError);
       
    65 	void IfProgress(TSubConnectionUniqueId aSubConnectionUniqueId, TInt aStage, TInt aError);
       
    66 	void OpenRoute();
       
    67 	void CloseRoute();
       
    68 	TInt Notification(TNifToAgentEventType aEvent, void * aInfo = NULL);
       
    69 	void BinderLayerDown(CNifIfBase* aBinderIf, TInt aReason, TAction aAction);
       
    70 	TInt PacketActivity(TDataTransferDirection aDirection, TUint aBytes, TBool aResetTimer);
       
    71 	void NotifyDataSent(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aUplinkVolume);
       
    72 	void NotifyDataReceived(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aDownlinkVolume);
       
    73 	void NifEvent(TNetworkAdaptorEventType aEventType, TUint aEvent, const TDesC8& aEventData, TAny* aSource);
       
    74 	TInt DoReadInt(const TDesC& aField, TUint32& aValue,const RMessagePtr2* aMessage);
       
    75 	TInt DoWriteInt(const TDesC& aField, TUint32 aValue,const RMessagePtr2* aMessage);
       
    76 	TInt DoReadDes(const TDesC& aField, TDes8& aValue,const RMessagePtr2* aMessage);
       
    77 	TInt DoReadDes(const TDesC& aField, TDes16& aValue,const RMessagePtr2* aMessage);
       
    78 	TInt DoWriteDes(const TDesC& aField, const TDesC8& aValue,const RMessagePtr2* aMessage);
       
    79 	TInt DoWriteDes(const TDesC& aField, const TDesC16& aValue,const RMessagePtr2* aMessage);
       
    80 	TInt DoReadBool(const TDesC& aField, TBool& aValue,const RMessagePtr2* aMessage);
       
    81 	TInt DoWriteBool(const TDesC& aField, TBool aValue,const RMessagePtr2* aMessage);
       
    82 	
       
    83 	// Idle timer
       
    84 	void SetPacketActivityFlag(volatile TBool* aPacketActivity);
       
    85 	
       
    86 	// Data monitoring
       
    87 	void SetDataVolumePtrs(ESock::TDataVolumes* aConnectionVolumesPtr, ESock::TDataVolumes* aSubConnectionVolumesPtr);
       
    88 	void SetNotificationThresholdPtrs(ESock::TNotificationThresholds* aConnectionThresholdsPtr, ESock::TNotificationThresholds* aSubonnectionThresholdsPtr); 
       
    89 	
       
    90 private:	
       
    91 	CIPShimNotify(CIPShimIfBase* aIntf);
       
    92 
       
    93 private:
       
    94 	CIPShimIfBase* iIntf;
       
    95 	ESock::TDataVolumes* iConnectionVolumesPtr;
       
    96 	ESock::TDataVolumes* iSubConnectionVolumesPtr;
       
    97 	ESock::TNotificationThresholds* iConnectionThresholdsPtr;
       
    98 	ESock::TNotificationThresholds* iSubConnectionThresholdsPtr;
       
    99 	volatile TBool* iPacketActivity;
       
   100 	TInt iRouteCount;	
       
   101 	};
       
   102 	
       
   103 #endif