realtimenetprots/sipfw/SIP/ServerResolver/inc/CSIPQueryNaptr.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-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 * Name          : CSIPQueryNaptr.h
       
    16 * Part of       : ServerResolver
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 #ifndef CSIPQUERYNAPTR_H
       
    28 #define CSIPQUERYNAPTR_H
       
    29 
       
    30 //INCLUDES
       
    31 #include <e32std.h>
       
    32 #include <dns_qry.h>
       
    33 #include "CSIPQueryBase.h"
       
    34 #include "_sipcodecdefs.h"
       
    35 
       
    36 // CLASS DEFINITION
       
    37 /**
       
    38  * CSIPQueryNaptr implements a
       
    39  */
       
    40 class CSIPQueryNaptr : public CSIPQueryBase
       
    41 	{
       
    42 	public:// Constructors and destructor
       
    43 
       
    44 		static CSIPQueryNaptr* NewL( const TDesC8& aTarget, TBool aSipsUri );
       
    45 		
       
    46 		~CSIPQueryNaptr();
       
    47 
       
    48 	public:
       
    49 
       
    50 		const TDesC8& QueryBuf();
       
    51 		
       
    52 		TDes8& QueryResultBuf(); 
       
    53 		
       
    54 		TDnsRespNAPTR QueryResult();
       
    55 		
       
    56 		void AddL( TDnsRespNAPTR* aNaptr );
       
    57 		
       
    58 		static TInt Compare( const TDnsRespNAPTR& aFirst, 
       
    59 						     const TDnsRespNAPTR& aSecond );
       
    60 						     
       
    61 		TDnsRespNAPTR& NAPTRRecordL( TInt aIndex );
       
    62 			
       
    63 		TBool MatchToRulesL( const TDnsRespNAPTR& aNaptr );
       
    64 		
       
    65 		RPointerArray<TDnsRespNAPTR>& RecordArray();
       
    66 		
       
    67 		static RStringF NaptrProtocol( const TDnsRespNAPTR& aNaptr );
       
    68 		
       
    69 		void Query( MSIPHostResolver& aResolver );
       
    70 		
       
    71 		void HandleQueryResultL( MSIPHostResolver& aResolver );
       
    72 	
       
    73 		const TDesC8& ResultTargetL();
       
    74 		
       
    75 		RStringF ResultProtocolL();
       
    76 		
       
    77 		void RemoveElementL( TInt aIndex );
       
    78 		
       
    79 		TInt ArrayCount(); 
       
    80 
       
    81 	private:// Constructors and destructor
       
    82 
       
    83 		void ConstructL( const TDesC8& aTarget );
       
    84 
       
    85 		CSIPQueryNaptr(TBool aSipsUri);
       
    86 		
       
    87 	private:// Data
       
    88 		
       
    89 		HBufC8* iTarget;
       
    90 	
       
    91 		TDnsRespNAPTRBuf iResult;
       
    92 	
       
    93 		TDnsQueryBuf iQueryBuf;
       
    94 	
       
    95 		RPointerArray<TDnsRespNAPTR>* iRecordArray;
       
    96 		
       
    97 		TBool iSipsUri;
       
    98 
       
    99 	private: // For testing purposes
       
   100 
       
   101 		UNIT_TEST(CSIPQueryNaptrStub)
       
   102 		UNIT_TEST(CSIPQueryNaptrTest)
       
   103 	};
       
   104 #endif // end of CSIPQUERYNAPTR_H
       
   105 
       
   106 // End of File