tcpiputils/dnd/Test/te_dnssuffix/inc/te_dnssuffixtestwrapper.h
branchRCL_3
changeset 22 8d540f55e491
parent 20 7e41d162e158
equal deleted inserted replaced
21:abbed5a4b42a 22:8d540f55e491
       
     1 // Copyright (c) 2010 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 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21 */
       
    22 
       
    23 #ifndef __TE_DNSSUFFIXTESTWRAPPER_H__
       
    24 #define __TE_DNSSUFFIXTESTWRAPPER_H__
       
    25 
       
    26 
       
    27 #include <test/datawrapper.h>
       
    28 #include <e32base.h>
       
    29 #include <es_sock.h>
       
    30 #include <in_sock.h>
       
    31 #include <nifman.h>
       
    32 #include <commdbconnpref.h>
       
    33 #include <badesca.h>    // MDesCArray and CDesCArray
       
    34 
       
    35 #include "CallBackHandler.h"
       
    36 
       
    37 /**
       
    38 Forward declaration
       
    39 */ 
       
    40 
       
    41 
       
    42 /**
       
    43 Class implements the CDataWrapper base class and provides the commands used by the scripts file
       
    44 */
       
    45 class CDNSSuffixTestWrapper : public CDataWrapper,
       
    46                               public MCallBackHandler
       
    47                         
       
    48 	{
       
    49 public:
       
    50 	CDNSSuffixTestWrapper();
       
    51 	~CDNSSuffixTestWrapper();
       
    52 	
       
    53 	static	CDNSSuffixTestWrapper*	NewL();
       
    54 	//This function is not used currently
       
    55 	virtual TAny*	GetObject() { return this; }
       
    56 	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
       
    57 	
       
    58 protected:
       
    59 	void ConstructL();
       
    60 	
       
    61 public: // from MCallBackHandler
       
    62     void HandleCallBackL(TInt aError);
       
    63 		
       
    64 private:
       
    65     
       
    66     // Initial configuration
       
    67     void DoInitTestingL();    
       
    68     
       
    69     // Enumeration
       
    70     void DoEnumerateInterfacesL();    
       
    71     void GetAvaiableInterfacesL(MDesCArray* aInterfaceNamesArray);
       
    72     
       
    73     // Setting/Getting suffix list on/from interface.
       
    74     void DoSetAndGetSuffixListL();    
       
    75     TInt SetDNSSuffixListOnInterface(RSocketServ& aServ,RConnection& aConn,const TDesC& aInterfaceName,RInetSuffixList& aData);
       
    76     
       
    77     TInt GetDNSSuffixList(RSocketServ& aServ,const TDesC& aInterfaceName,RInetSuffixList& aData);
       
    78     
       
    79     
       
    80     // Host resolve   
       
    81     
       
    82     void DoResolveL();    
       
    83     void DoResolveHostWithoutDomainWithSuffixListSetL();
       
    84     void DoResolveHostWithoutDomainWithoutSuffixListL();
       
    85     
       
    86     void DNSSuffixSupportTC005L();
       
    87     void DNSSuffixSupportTC006L();
       
    88     void DNSSuffixSupportTC007L();
       
    89     void DNSSuffixSupportTC008L();
       
    90     void DNSSuffixSupportTC009L();
       
    91     void DNSSuffixSupportTC010L();
       
    92     void DNSSuffixSupportTC011L();
       
    93     
       
    94     
       
    95 private: // utility or helper functions
       
    96     
       
    97     TInt StartConnections(RSocketServ& aSockServ, RConnection& aConn1, RConnection& aConn2);
       
    98     TInt StartConnection(RSocketServ& aSockServ, RConnection& aConn, TUint aIapId);
       
    99     void GetConnPrefL(TUint aIapId,TCommDbConnPref& aPref);
       
   100     
       
   101     TInt32 GetFirstIapId();
       
   102     TInt32 GetSecondIapId();
       
   103     
       
   104     TInt GetFirstInterfaceNameL(TDes& aIfaceName);
       
   105     TInt GetSecondInterfaceNameL(TDes& aIfaceName);    
       
   106     TInt GetInterfaceNameL(const TDesC& aCriteria,TDes& aIfaceName);
       
   107     
       
   108     TInt FillSuffixList(RInetSuffixList& aSuffixList,TDesC& aData);
       
   109     void CloseSocketSrv();
       
   110     TInt IsSuffixListEqual(const RInetSuffixList& aSuffixList1, const RInetSuffixList& aSuffixList2);
       
   111     
       
   112 private:    
       
   113     RSocketServ        iSocketServ;
       
   114     CActiveSchedulerWait iWait;
       
   115     RInetSuffixList     iSuffixList;
       
   116     RInetSuffixList     iSuffixList2;
       
   117 	};
       
   118 	
       
   119 
       
   120 #endif //__TE_DNSSUFFIXTESTWRAPPER_H__