networksecurity/ipsec/ipsecpol/inc/ipsecpolmanhandler.h
branchRCL_3
changeset 58 8d540f55e491
parent 57 abbed5a4b42a
child 75 c1029e558ef5
equal deleted inserted replaced
57:abbed5a4b42a 58:8d540f55e491
    25 #include <e32base.h>
    25 #include <e32base.h>
    26 #include <e32std.h>
    26 #include <e32std.h>
    27 #include <f32file.h>
    27 #include <f32file.h>
    28 #include <es_sock.h>
    28 #include <es_sock.h>
    29 #include <in_sock.h>
    29 #include <in_sock.h>
       
    30 #include <featdiscovery.h>
    30 
    31 
    31 #include "ipsecpolapi.h"
    32 #include "ipsecpolapi.h"
    32 #include "ipsecpol.h"
    33 #include "ipsecpol.h"
    33 #include "autoloadlistitem.h"
    34 #include "autoloadlistitem.h"
       
    35 #include "log_ipsecpol.H"
    34 #ifdef SYMBIAN_IPSEC_VOIP_SUPPORT
    36 #ifdef SYMBIAN_IPSEC_VOIP_SUPPORT
    35 #include "spdb.h"
    37 #include "spdb.h"
    36 #endif // SYMBIAN_IPSEC_VOIP_SUPPORT
    38 #endif // SYMBIAN_IPSEC_VOIP_SUPPORT
    37 
    39 
    38 //
    40 //
    50 //
    52 //
    51 //
    53 //
    52 const TInt KDropMode       = 0;          // Drop mode
    54 const TInt KDropMode       = 0;          // Drop mode
    53 const TInt KInboundBypass  = (1 << 0);   // Inbound bypass mode
    55 const TInt KInboundBypass  = (1 << 0);   // Inbound bypass mode
    54 const TInt KOutboundBypass = (1 << 1);   // Outbound bypass mode
    56 const TInt KOutboundBypass = (1 << 1);   // Outbound bypass mode
       
    57 const TInt KSymmetricBypass = (KInboundBypass | KOutboundBypass ); // To allow UMA traffic
    55 
    58 
    56 //
    59 //
    57 // Forward declarations
    60 // Forward declarations
    58 //
    61 //
    59 //
    62 //
    77     TPolicyHandle iPolicyHandle;
    80     TPolicyHandle iPolicyHandle;
    78     HBufC8* iPolicyBuf;
    81     HBufC8* iPolicyBuf;
    79     TBool iActiveState;       // EFalse = loaded, not active; ETrue = active
    82     TBool iActiveState;       // EFalse = loaded, not active; ETrue = active
    80     TInt iBypassOrDropMode;   // See flags below
    83     TInt iBypassOrDropMode;   // See flags below
    81     TPolicyType iPolicyType;
    84     TPolicyType iPolicyType;
       
    85     TBool iException;			// UMA exception
       
    86 	
    82     };
    87     };
    83 typedef CArrayFixFlat<TActivePolicyListEntry*> CActivePolicyList;
    88 typedef CArrayFixFlat<TActivePolicyListEntry*> CActivePolicyList;
    84 
    89 
    85 //
    90 //
    86 //
    91 //
   182     void ApiCallCompleted();
   187     void ApiCallCompleted();
   183 
   188 
   184     TInt DeletePolicyFromList();
   189     TInt DeletePolicyFromList();
   185 
   190 
   186     TInt SearchPolicyFromListAndActivate();
   191     TInt SearchPolicyFromListAndActivate();
   187     
   192   
   188     TInt GetAvailableSelectors(const RMessage2& aMsg);
   193     TInt GetAvailableSelectors(const RMessage2& aMsg);
   189     TInt GetSelectorsCount(const RMessage2& aMsg);
   194     TInt GetSelectorsCount(const RMessage2& aMsg);
   190 
   195 
   191     //
   196     //
   192     // Miscallenious utilities related to building policy data  
   197     // Miscallenious utilities related to building policy data  
   338     void CalculateBypassOrDropMode(TBool aForLoadPolicy);
   343     void CalculateBypassOrDropMode(TBool aForLoadPolicy);
   339 
   344 
   340     //determines whether the last manual autoload policy has been unloaded
   345     //determines whether the last manual autoload policy has been unloaded
   341     TBool IsLastManualLoadPolicy(TUint32 aPolicyHandle);
   346     TBool IsLastManualLoadPolicy(TUint32 aPolicyHandle);
   342 
   347 
       
   348     //Exception Selectors to be loaded.
       
   349      TInt AddExceptionSelectors();
       
   350      
       
   351      //Check for Exception policy loading. Work around done for UMA. Need to check more. 
       
   352      TBool CheckException();
       
   353 
       
   354 	//Method to set the SID of the application that load policy 
       
   355 	 void SetOptL(const RMessage2& aMsg);
       
   356  
       
   357 
   343 private:
   358 private:
   344     // Read the algorithms.conf file
   359     // Read the algorithms.conf file
   345     void ReadAlgorithmsFileL();
   360     void ReadAlgorithmsFileL();
   346 
   361 
   347     void ReadNextAutoloadPolicyL(
   362     void ReadNextAutoloadPolicyL(
   355                                    TInt aScopeId,
   370                                    TInt aScopeId,
   356                                    TInt aGwScopeId,
   371                                    TInt aGwScopeId,
   357                                    TBool& aIsTunnelMode);
   372                                    TBool& aIsTunnelMode);
   358 
   373 
   359     TInt CalculatePolicyBypassDropMode(CSecurityPolicy& aSp) const;
   374     TInt CalculatePolicyBypassDropMode(CSecurityPolicy& aSp) const;
       
   375 
       
   376     //UMA support
       
   377 	void SearchIAPIdL( const TUint32& aNetId, TUint32& aIapId );
       
   378     TBool CheckUMAL(TUint32 aIapId);
       
   379 	void CheckFeatureSupportL(TUid aFeature);////To check a Feature flag is enabled or not
       
   380 
       
   381 	/**
       
   382 	 *This method to check the exception.
       
   383 	 **/
       
   384 	void CheckUMAEXception(TUint32 aVpnNetId);
       
   385 
   360 
   386 
   361 public:
   387 public:
   362 
   388 
   363     // List containing all loaded policies
   389     // List containing all loaded policies
   364     CActivePolicyList* iActivePolicyList;
   390     CActivePolicyList* iActivePolicyList;
   441     
   467     
   442     // Used to retrieve the gateway address passed by client in RIpsecPolicyServ::AvailableSelectors API
   468     // Used to retrieve the gateway address passed by client in RIpsecPolicyServ::AvailableSelectors API
   443     TInetAddr iTunnel;
   469     TInetAddr iTunnel;
   444     
   470     
   445     CArrayFixFlat<TIpsecSelectorInfo>* iSelectorInfoArray;
   471     CArrayFixFlat<TIpsecSelectorInfo>* iSelectorInfoArray;
   446     };
   472 	
       
   473     //UMA support
       
   474     TBool iCurrentException;	
       
   475     //This variable holds sid of the application that loads 
       
   476     //exception policies
       
   477     TUint32 iAppSid;
       
   478     TBool iIPSecGANSupported; //To check whether FF_IPSEC_UMA_SUPPORT_ENABLE is defined and UMA supported
       
   479 	};
   447 
   480 
   448 #endif
   481 #endif